From b7ae8043e963467eb222a44f48d66a1df36d9371 Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Thu, 10 Nov 2016 13:25:10 -0500 Subject: Add SHAKE-128 and SHAKE-256 as hash functions --- src/lib/hash/hash.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/lib/hash/hash.cpp') diff --git a/src/lib/hash/hash.cpp b/src/lib/hash/hash.cpp index ede2f8c99..112554127 100644 --- a/src/lib/hash/hash.cpp +++ b/src/lib/hash/hash.cpp @@ -56,6 +56,10 @@ #include #endif +#if defined(BOTAN_HAS_SHAKE) + #include +#endif + #if defined(BOTAN_HAS_SKEIN_512) #include #endif @@ -242,6 +246,17 @@ std::unique_ptr HashFunction::create(const std::string& algo_spec, } #endif +#if defined(BOTAN_HAS_SHAKE) + if(req.algo_name() == "SHAKE-128") + { + return std::unique_ptr(new SHAKE_128(req.arg_as_integer(0, 128))); + } + if(req.algo_name() == "SHAKE-256") + { + return std::unique_ptr(new SHAKE_256(req.arg_as_integer(0, 256))); + } +#endif + #if defined(BOTAN_HAS_WHIRLPOOL) if(req.algo_name() == "Whirlpool") { -- cgit v1.2.3