aboutsummaryrefslogtreecommitdiffstats
path: root/checks/validate.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-08-22 01:11:05 +0000
committerlloyd <[email protected]>2010-08-22 01:11:05 +0000
commitdad1a47b186ac7501f1213336d77f8cc878e99e9 (patch)
treef660f730aa59f713b432d60814c0af3ec710d32c /checks/validate.cpp
parente7d9701a86658efbc316ccfeaf48cec8c094fc35 (diff)
For passhash9, add another interface that allows the caller to specify
which PRF they want to use. The old interface just calls this new version with alg_id set to 0 which is HMAC(SHA-1), which was previously the only supported PRF. Assign new codepoints for HMAC(SHA-256) and CMAC(Blowfish) to allow their use with passhash9. Have the generate+check tests run a test for each supported PRF.
Diffstat (limited to 'checks/validate.cpp')
-rw-r--r--checks/validate.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/checks/validate.cpp b/checks/validate.cpp
index 68035f293..6e7a2e553 100644
--- a/checks/validate.cpp
+++ b/checks/validate.cpp
@@ -71,12 +71,17 @@ bool test_passhash(RandomNumberGenerator& rng)
std::cout << "." << std::flush;
- std::string gen_hash = generate_passhash9(input, rng, 5);
+ for(byte alg_id = 0; alg_id <= 2; ++alg_id)
+ {
+ std::string gen_hash = generate_passhash9(input, alg_id, rng, 1);
- if(!check_passhash9(input, gen_hash))
- return false;
+ if(!check_passhash9(input, gen_hash))
+ return false;
+
+ std::cout << "." << std::flush;
+ }
- std::cout << "." << std::endl;;
+ std::cout << std::endl;
#endif