From 035081b44b68f9a91261e5086291c97842f88e51 Mon Sep 17 00:00:00 2001 From: Matthias Gierlings Date: Thu, 24 Nov 2016 14:57:18 +0100 Subject: Adds SHAKE support for XMSS - Enables code for shake support - Creating SHAKE hash function by name now allows to select output size of 256 Bit for SHAKE128 and 512 Bit for SHAKE256. - Adds *self-generated*, unverified test vectors for XMSS/SHAKE. --- src/lib/pubkey/xmss/xmss_wots_parameters.cpp | 37 ++++++++++++++-------------- 1 file changed, 19 insertions(+), 18 deletions(-) (limited to 'src/lib/pubkey/xmss/xmss_wots_parameters.cpp') diff --git a/src/lib/pubkey/xmss/xmss_wots_parameters.cpp b/src/lib/pubkey/xmss/xmss_wots_parameters.cpp index 903885d72..febfa26bd 100644 --- a/src/lib/pubkey/xmss/xmss_wots_parameters.cpp +++ b/src/lib/pubkey/xmss/xmss_wots_parameters.cpp @@ -21,7 +21,9 @@ const std::map XMSS_WOTS_Parameters::m_oid_name_lut = { { "WOTSP_SHA2-256_W16", WOTSP_SHA2_256_W16 }, - { "WOTSP_SHA2-512_W16", WOTSP_SHA2_512_W16 } + { "WOTSP_SHA2-512_W16", WOTSP_SHA2_512_W16 }, + { "WOTSP_SHAKE128_W16", WOTSP_SHAKE128_W16 }, + { "WOTSP_SHAKE256_W16", WOTSP_SHAKE256_W16 } }; XMSS_WOTS_Parameters::XMSS_WOTS_Parameters(const std::string& algo_name) @@ -49,23 +51,22 @@ XMSS_WOTS_Parameters::XMSS_WOTS_Parameters(ots_algorithm_t oid) m_hash_name = "SHA-512"; m_strength = 512; break; -// FIXME: Uncomment once SHAKE128/256 implementation is available in Botan. -// case WOTSP_SHAKE128_W16: -// m_element_size = 32; -// m_w = 16; -// m_len = 67; -// m_name = "WOTSP_SHAKE128_W16"; -// m_hash_name = ""; -// m_strength = 256; -// break; -// case WOTSP_SHAKE256_W16: -// m_element_size = 64; -// m_w = 16; -// m_len = 131; -// m_name = "WOTSP_SHAKE256_W16"; -// m_hash_name = ""; -// m_strength = 512; -// break; + case WOTSP_SHAKE128_W16: + m_element_size = 32; + m_w = 16; + m_len = 67; + m_name = "WOTSP_SHAKE128_W16"; + m_hash_name = "SHAKE-128(256)"; + m_strength = 256; + break; + case WOTSP_SHAKE256_W16: + m_element_size = 64; + m_w = 16; + m_len = 131; + m_name = "WOTSP_SHAKE256_W16"; + m_hash_name = "SHAKE-256(512)"; + m_strength = 512; + break; default: throw Unsupported_Argument( "Algorithm id does not match any XMSS WOTS algorithm id."); -- cgit v1.2.3