diff options
author | lloyd <[email protected]> | 2008-05-25 21:14:40 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2008-05-25 21:14:40 +0000 |
commit | 25609cd77358c4de86a9100dcd49b1d8ad07f19a (patch) | |
tree | c63ec72513883260e3124065dfd709b282a351eb /checks | |
parent | 89e20a742ada5000c8a78fbbf0bf8bd3b13565eb (diff) |
Make the two parameters of Randpool (which underlying block cipher and MAC
to use) explicit arguments to the constructor instead of being hardcoded.
Diffstat (limited to 'checks')
-rw-r--r-- | checks/dolook2.cpp | 5 | ||||
-rw-r--r-- | checks/pk.cpp | 13 |
2 files changed, 13 insertions, 5 deletions
diff --git a/checks/dolook2.cpp b/checks/dolook2.cpp index 1b7123b30..1571e5db2 100644 --- a/checks/dolook2.cpp +++ b/checks/dolook2.cpp @@ -113,9 +113,10 @@ void RNG_Filter::write(const byte[], u32bit length) Filter* lookup_rng(const std::string& algname) { if(algname == "X9.31-RNG") - return new RNG_Filter(new ANSI_X931_RNG("AES-256", new Randpool)); + return new RNG_Filter(new ANSI_X931_RNG("AES-256", + new Randpool("AES-256", "HMAC(SHA-256)"))); if(algname == "Randpool") - return new RNG_Filter(new Randpool); + return new RNG_Filter(new Randpool("AES-256", "HMAC(SHA-256)")); return 0; } diff --git a/checks/pk.cpp b/checks/pk.cpp index 0deab355c..fdb22624d 100644 --- a/checks/pk.cpp +++ b/checks/pk.cpp @@ -195,7 +195,9 @@ u32bit do_pk_validation_tests(const std::string& filename) std::cout << std::endl; - global_state().set_prng(new ANSI_X931_RNG("AES-128", new Randpool)); + global_state().set_prng(new ANSI_X931_RNG("AES-128", + new Randpool("AES-256", + "HMAC(SHA-256)"))); for(u32bit j = 0; j != 2; j++) global_state().seed_prng(true, 384); @@ -250,7 +252,10 @@ void validate_encryption(PK_Encryptor* e, PK_Decryptor* d, failure = true; } - global_state().set_prng(new ANSI_X931_RNG("AES-128", new Randpool)); + global_state().set_prng(new ANSI_X931_RNG("AES-128", + new Randpool("AES-256", + "HMAC(SHA-256)"))); + for(u32bit j = 0; j != 2; j++) global_state().seed_prng(true, 384); @@ -291,7 +296,9 @@ void validate_signature(PK_Verifier* v, PK_Signer* s, const std::string& algo, failure = true; } - global_state().set_prng(new ANSI_X931_RNG("AES-128", new Randpool)); + global_state().set_prng(new ANSI_X931_RNG("AES-128", + new Randpool("AES-256", + "HMAC(SHA-256)"))); for(u32bit j = 0; j != 2; j++) global_state().seed_prng(true, 384); |