aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/kdf/kdf.cpp
diff options
context:
space:
mode:
authorKrzysztof Kwiatkowski <[email protected]>2017-04-30 15:48:47 +0100
committerKrzysztof Kwiatkowski <[email protected]>2017-05-03 00:44:28 +0100
commit576ada6d0b1ae20b781d487ba9bbeaadef17b202 (patch)
treeef0122d482dd6bbb36fe6a5fa82138bc6599dcaf /src/lib/kdf/kdf.cpp
parent29cc6bebe132a34f882d450b35a69bf71bb3e27b (diff)
Adds KDF based on SP 800-56A. Currently it is revision 1 (alternative 1). It should be extended to revision 2.
Diffstat (limited to 'src/lib/kdf/kdf.cpp')
-rw-r--r--src/lib/kdf/kdf.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/lib/kdf/kdf.cpp b/src/lib/kdf/kdf.cpp
index 0e9d840c1..122719f6d 100644
--- a/src/lib/kdf/kdf.cpp
+++ b/src/lib/kdf/kdf.cpp
@@ -42,6 +42,10 @@
#include <botan/sp800_108.h>
#endif
+#if defined(BOTAN_HAS_SP800_56A)
+#include <botan/sp800_56a.h>
+#endif
+
#if defined(BOTAN_HAS_SP800_56C)
#include <botan/sp800_56c.h>
#endif
@@ -185,6 +189,16 @@ std::unique_ptr<KDF> KDF::create(const std::string& algo_spec,
}
#endif
+#if defined(BOTAN_HAS_SP800_56A)
+ 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(hash.release()));
+ }
+ }
+#endif
+
#if defined(BOTAN_HAS_SP800_56C)
if(req.algo_name() == "SP800-56C" && req.arg_count() == 1)
{