diff options
Diffstat (limited to 'doc/examples/rsa_enc.cpp')
-rw-r--r-- | doc/examples/rsa_enc.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/doc/examples/rsa_enc.cpp b/doc/examples/rsa_enc.cpp index aebe42e72..4f37af6d6 100644 --- a/doc/examples/rsa_enc.cpp +++ b/doc/examples/rsa_enc.cpp @@ -73,8 +73,7 @@ int main(int argc, char* argv[]) return 1; } - std::auto_ptr<RandomNumberGenerator> rng( - RandomNumberGenerator::make_rng()); + AutoSeeded_RNG rng; std::auto_ptr<PK_Encryptor> encryptor(get_pk_encryptor(*rsakey, "EME1(SHA-1)")); @@ -90,7 +89,7 @@ int main(int argc, char* argv[]) statistically indepedent. Practically speaking I don't think this is a problem. */ - SymmetricKey masterkey(*rng, + SymmetricKey masterkey(rng, std::min(32U, encryptor->maximum_input_size())); SymmetricKey cast_key = derive_key("CAST", masterkey, 16); @@ -98,7 +97,7 @@ int main(int argc, char* argv[]) SymmetricKey iv = derive_key("IV", masterkey, 8); SecureVector<byte> encrypted_key = - encryptor->encrypt(masterkey.bits_of(), *rng); + encryptor->encrypt(masterkey.bits_of(), rng); ciphertext << b64_encode(encrypted_key) << std::endl; |