From 576ada6d0b1ae20b781d487ba9bbeaadef17b202 Mon Sep 17 00:00:00 2001 From: Krzysztof Kwiatkowski Date: Sun, 30 Apr 2017 15:48:47 +0100 Subject: Adds KDF based on SP 800-56A. Currently it is revision 1 (alternative 1). It should be extended to revision 2. --- src/lib/kdf/kdf.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/lib/kdf/kdf.cpp') 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 #endif +#if defined(BOTAN_HAS_SP800_56A) +#include +#endif + #if defined(BOTAN_HAS_SP800_56C) #include #endif @@ -185,6 +189,16 @@ std::unique_ptr 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(new SP800_56A(hash.release())); + } + } +#endif + #if defined(BOTAN_HAS_SP800_56C) if(req.algo_name() == "SP800-56C" && req.arg_count() == 1) { -- cgit v1.2.3