diff options
author | lloyd <[email protected]> | 2011-04-11 20:30:04 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2011-04-11 20:30:04 +0000 |
commit | b958d1d28fab4d9c23a85c0745dc7c1dc3446b61 (patch) | |
tree | 66c61effd1b23c9ddcc3d86078dd5416cba091bf /src/passhash | |
parent | 14fa61b489d059e7a7b10a205a4b0b498fac1695 (diff) |
Make the alg_id param for passhash9 optional. Update callers.
Diffstat (limited to 'src/passhash')
-rw-r--r-- | src/passhash/passhash9/passhash9.cpp | 13 | ||||
-rw-r--r-- | src/passhash/passhash9/passhash9.h | 14 |
2 files changed, 4 insertions, 23 deletions
diff --git a/src/passhash/passhash9/passhash9.cpp b/src/passhash/passhash9/passhash9.cpp index e5f379052..e1e37da1e 100644 --- a/src/passhash/passhash9/passhash9.cpp +++ b/src/passhash/passhash9/passhash9.cpp @@ -23,8 +23,6 @@ const size_t ALGID_BYTES = 1; const size_t SALT_BYTES = 12; // 96 bits of salt const size_t PASSHASH9_PBKDF_OUTPUT_LEN = 24; // 192 bits output -const byte PASSHASH9_DEFAULT_ALGO = 0; // HMAC(SHA-1) - const size_t WORK_FACTOR_SCALE = 10000; MessageAuthenticationCode* get_pbkdf_prf(byte alg_id) @@ -49,15 +47,8 @@ MessageAuthenticationCode* get_pbkdf_prf(byte alg_id) std::string generate_passhash9(const std::string& pass, RandomNumberGenerator& rng, - u16bit work_factor) - { - return generate_passhash9(pass, PASSHASH9_DEFAULT_ALGO, rng, work_factor); - } - -std::string generate_passhash9(const std::string& pass, - byte alg_id, - RandomNumberGenerator& rng, - u16bit work_factor) + u16bit work_factor, + byte alg_id) { MessageAuthenticationCode* prf = get_pbkdf_prf(alg_id); diff --git a/src/passhash/passhash9/passhash9.h b/src/passhash/passhash9/passhash9.h index 92cc391dc..3c0a4be51 100644 --- a/src/passhash/passhash9/passhash9.h +++ b/src/passhash/passhash9/passhash9.h @@ -17,26 +17,16 @@ namespace Botan { * @param password the password * @param rng a random number generator * @param work_factor how much work to do to slow down guessing attacks -*/ -std::string BOTAN_DLL generate_passhash9(const std::string& password, - RandomNumberGenerator& rng, - u16bit work_factor = 10); - -/** -* Create a password hash using PBKDF2 -* @param password the password * @param alg_id specifies which PRF to use with PBKDF2 * 0 is HMAC(SHA-1) * 1 is HMAC(SHA-256) * 2 is CMAC(Blowfish) * all other values are currently undefined -* @param rng a random number generator -* @param work_factor how much work to do to slow down guessing attacks */ std::string BOTAN_DLL generate_passhash9(const std::string& password, - byte alg_id, RandomNumberGenerator& rng, - u16bit work_factor = 10); + u16bit work_factor = 10, + byte alg_id = 0); /** * Check a previously created password hash |