diff options
author | Jack Lloyd <[email protected]> | 2017-05-06 16:54:58 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2017-05-06 16:54:58 -0400 |
commit | 86cc9393f6a093a48f80c01481e9496220f02c33 (patch) | |
tree | 9a8436e7770567c559ea2b423811cf6013f0e408 /src/lib/kdf/kdf.cpp | |
parent | 2a351e58a23cf3113342ce07b3d8baa8c235c94f (diff) |
Post-merge changes to SP 800-56A KDF (GH #1040)
Instead of using a template split the KDF into two different classes
that both call a template utility function to actually run the KDF algo.
Simplify the "empty salt" logic and avoid having to instantiate a hash
object just to get the hash block size.
Diffstat (limited to 'src/lib/kdf/kdf.cpp')
-rw-r--r-- | src/lib/kdf/kdf.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/kdf/kdf.cpp b/src/lib/kdf/kdf.cpp index 695523d8e..4b55b6962 100644 --- a/src/lib/kdf/kdf.cpp +++ b/src/lib/kdf/kdf.cpp @@ -193,9 +193,9 @@ std::unique_ptr<KDF> KDF::create(const std::string& algo_spec, if(req.algo_name() == "SP800-56A" && req.arg_count() == 1) { if(auto hash = HashFunction::create(req.arg(0))) - return std::unique_ptr<KDF>(new SP800_56A<HashFunction>(hash.release())); + return std::unique_ptr<KDF>(new SP800_56A_Hash(hash.release())); if(auto mac = MessageAuthenticationCode::create(req.arg(0))) - return std::unique_ptr<KDF>(new SP800_56A<MessageAuthenticationCode>(mac.release())); + return std::unique_ptr<KDF>(new SP800_56A_HMAC(mac.release())); } #endif |