diff options
author | Jack Lloyd <[email protected]> | 2017-09-21 13:49:14 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2017-09-21 13:49:14 -0400 |
commit | 5cc5e1bd3fac87186f511a48cee9cda86e4607ca (patch) | |
tree | ea64916bb405f215bc5aed2cddfecdc85322bada /src/lib/pubkey/xmss/xmss_wots_parameters.cpp | |
parent | b331caf9ae61410aaa6e7e7fc4b33267562bd78e (diff) |
Clean up header includes
Avoid including build.h or assert.h directly, instead always take
them though types.h
Avoid math.h in favor of cmath
Diffstat (limited to 'src/lib/pubkey/xmss/xmss_wots_parameters.cpp')
-rw-r--r-- | src/lib/pubkey/xmss/xmss_wots_parameters.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/pubkey/xmss/xmss_wots_parameters.cpp b/src/lib/pubkey/xmss/xmss_wots_parameters.cpp index 704bcab36..20f758ed2 100644 --- a/src/lib/pubkey/xmss/xmss_wots_parameters.cpp +++ b/src/lib/pubkey/xmss/xmss_wots_parameters.cpp @@ -14,6 +14,8 @@ **/ #include <botan/xmss_wots_parameters.h> +#include <botan/exceptn.h> +#include <cmath> namespace Botan { @@ -80,7 +82,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>(ceil((8 * element_size()) / m_lg_w)); + 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); BOTAN_ASSERT(m_len == m_len_1 + m_len_2, "Invalid XMSS WOTS parameter " @@ -114,7 +116,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>( - 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); |