diff options
author | Matthias Gierlings <[email protected]> | 2017-10-09 23:23:28 +0200 |
---|---|---|
committer | Matthias Gierlings <[email protected]> | 2017-11-21 21:03:16 +0100 |
commit | 306a665f07e21eefa19f1f9c047ed9e5bd9ba224 (patch) | |
tree | e799a0b9d41ad4d853f1988f588132e5de86b914 /src/lib/pubkey/xmss/xmss_wots_parameters.cpp | |
parent | f1b1c6e3506fea734bc41cdb7794bf26666d293a (diff) |
Implements multithreading support for XMSS
Diffstat (limited to 'src/lib/pubkey/xmss/xmss_wots_parameters.cpp')
-rw-r--r-- | src/lib/pubkey/xmss/xmss_wots_parameters.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/lib/pubkey/xmss/xmss_wots_parameters.cpp b/src/lib/pubkey/xmss/xmss_wots_parameters.cpp index 20f758ed2..3d11739eb 100644 --- a/src/lib/pubkey/xmss/xmss_wots_parameters.cpp +++ b/src/lib/pubkey/xmss/xmss_wots_parameters.cpp @@ -19,18 +19,17 @@ namespace Botan { -//static XMSS_WOTS_Parameters::ots_algorithm_t XMSS_WOTS_Parameters::xmss_wots_id_from_string(const std::string& param_set) { if(param_set == "WOTSP_SHA2-256_W16") - return WOTSP_SHA2_256_W16; + { return WOTSP_SHA2_256_W16; } if(param_set == "WOTSP_SHA2-512_W16") - return WOTSP_SHA2_512_W16; + { return WOTSP_SHA2_512_W16; } if(param_set == "WOTSP_SHAKE128_W16") - return WOTSP_SHAKE128_W16; + { return WOTSP_SHAKE128_W16; } if(param_set == "WOTSP_SHAKE256_W16") - return WOTSP_SHAKE256_W16; + { return WOTSP_SHAKE256_W16; } throw Invalid_Argument("Unknown XMSS-WOTS algorithm param '" + param_set + "'"); } @@ -84,7 +83,7 @@ XMSS_WOTS_Parameters::XMSS_WOTS_Parameters(ots_algorithm_t oid) m_w == 16 ? m_lg_w = 4 : m_lg_w = 2; m_len_1 = static_cast<size_t>(std::ceil((8 * element_size()) / m_lg_w)); m_len_2 = static_cast<size_t>( - floor(log2(m_len_1 * (wots_parameter() - 1)) / m_lg_w) + 1); + floor(log2(m_len_1 * (wots_parameter() - 1)) / m_lg_w) + 1); BOTAN_ASSERT(m_len == m_len_1 + m_len_2, "Invalid XMSS WOTS parameter " "\"len\" detedted."); } @@ -116,7 +115,7 @@ XMSS_WOTS_Parameters::base_w(size_t value) const { value <<= (8 - ((m_len_2 * m_lg_w) % 8)); size_t len_2_bytes = static_cast<size_t>( - std::ceil(static_cast<float>(m_len_2 * m_lg_w) / 8.f)); + std::ceil(static_cast<float>(m_len_2 * m_lg_w) / 8.f)); secure_vector<uint8_t> result; XMSS_Tools::concat(result, value, len_2_bytes); return base_w(result, m_len_2); |