diff options
author | lloyd <[email protected]> | 2008-05-24 18:47:11 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2008-05-24 18:47:11 +0000 |
commit | c4bad5476b30811ad51b1edd3bd873864d423c07 (patch) | |
tree | 94679d6cee3a38da1d64b8f5f671986566ac8a18 /doc/examples/rsa_kgen.cpp | |
parent | ebc67ae27481549a152858f24fff4a7a82ad4e51 (diff) |
Avoid using the global RNG in check_key, instead pass a reference.
Update the examples
Diffstat (limited to 'doc/examples/rsa_kgen.cpp')
-rw-r--r-- | doc/examples/rsa_kgen.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/doc/examples/rsa_kgen.cpp b/doc/examples/rsa_kgen.cpp index e57f60c06..de2ed0db7 100644 --- a/doc/examples/rsa_kgen.cpp +++ b/doc/examples/rsa_kgen.cpp @@ -14,6 +14,7 @@ This file is in the public domain #include <string> #include <botan/botan.h> #include <botan/rsa.h> +#include <botan/libstate.h> using namespace Botan; int main(int argc, char* argv[]) @@ -26,7 +27,7 @@ int main(int argc, char* argv[]) } u32bit bits = std::atoi(argv[1]); - if(bits < 512 || bits > 4096) + if(bits < 1024 || bits > 4096) { std::cout << "Invalid argument for bitsize" << std::endl; return 1; @@ -42,7 +43,7 @@ int main(int argc, char* argv[]) try { - RSA_PrivateKey key(bits); + RSA_PrivateKey key(bits, global_state().prng_reference()); pub << X509::PEM_encode(key); if(argc == 2) |