aboutsummaryrefslogtreecommitdiffstats
path: root/src/pubkey/keypair
diff options
context:
space:
mode:
authorlloyd <[email protected]>2012-05-18 20:32:36 +0000
committerlloyd <[email protected]>2012-05-18 20:32:36 +0000
commitc691561f3198f481c13457433efbccc1c9fcd898 (patch)
treea45ea2c5a30e0cb009fbcb68a61ef39332ff790c /src/pubkey/keypair
parentd76700f01c7ecac5633edf75f8d7408b46c5dbac (diff)
Fairly huge update that replaces the old secmem types with std::vector
using a custom allocator. Currently our allocator just does new/delete with a memset before deletion, and the mmap and mlock allocators have been removed.
Diffstat (limited to 'src/pubkey/keypair')
-rw-r--r--src/pubkey/keypair/keypair.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/pubkey/keypair/keypair.cpp b/src/pubkey/keypair/keypair.cpp
index 857a5328a..a8631062d 100644
--- a/src/pubkey/keypair/keypair.cpp
+++ b/src/pubkey/keypair/keypair.cpp
@@ -29,14 +29,14 @@ bool encryption_consistency_check(RandomNumberGenerator& rng,
if(encryptor.maximum_input_size() == 0)
return true;
- SecureVector<byte> plaintext =
- rng.random_vec(encryptor.maximum_input_size() - 1);
+ std::vector<byte> plaintext =
+ unlock(rng.random_vec(encryptor.maximum_input_size() - 1));
- SecureVector<byte> ciphertext = encryptor.encrypt(plaintext, rng);
+ std::vector<byte> ciphertext = encryptor.encrypt(plaintext, rng);
if(ciphertext == plaintext)
return false;
- SecureVector<byte> decrypted = decryptor.decrypt(ciphertext);
+ std::vector<byte> decrypted = unlock(decryptor.decrypt(ciphertext));
return (plaintext == decrypted);
}
@@ -51,9 +51,9 @@ bool signature_consistency_check(RandomNumberGenerator& rng,
PK_Signer signer(key, padding);
PK_Verifier verifier(key, padding);
- SecureVector<byte> message = rng.random_vec(16);
+ std::vector<byte> message = unlock(rng.random_vec(16));
- SecureVector<byte> signature;
+ std::vector<byte> signature;
try
{