diff options
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); |