diff --git a/src/lib/mac/kmac/kmac.cpp b/src/lib/mac/kmac/kmac.cpp index 63f99b875a7..62ab1a4f3a3 100644 --- a/src/lib/mac/kmac/kmac.cpp +++ b/src/lib/mac/kmac/kmac.cpp @@ -46,7 +46,7 @@ size_t left_or_right_encode(size_t s, T& output_container) { i = 1; } if(IS_LEFT_ENCODE) { - output_container.push_back(i); + output_container.push_back(static_cast(i)); bytes_appended++; } // big endian encoding of s @@ -55,7 +55,7 @@ size_t left_or_right_encode(size_t s, T& output_container) { bytes_appended++; } if(!IS_LEFT_ENCODE) { - output_container.push_back(i); + output_container.push_back(static_cast(i)); bytes_appended++; } return bytes_appended; @@ -154,7 +154,7 @@ void KMAC256::start_msg(const uint8_t nonce[], size_t nonce_len) { m_hash.absorb(std::span(newX_head)); } -KMAC256::KMAC256(uint32_t output_bit_length) : +KMAC256::KMAC256(size_t output_bit_length) : m_output_bit_length(output_bit_length), m_hash(output_bit_length, 512, 00, 2), m_pad_byte_length(136) { // ensure valid output length byte_len_from_bit_len(m_output_bit_length); diff --git a/src/lib/mac/kmac/kmac.h b/src/lib/mac/kmac/kmac.h index 97722bbe2d2..e2cee93f82d 100644 --- a/src/lib/mac/kmac/kmac.h +++ b/src/lib/mac/kmac/kmac.h @@ -28,7 +28,7 @@ class KMAC256 final : public MessageAuthenticationCode { Key_Length_Specification key_spec() const override; void start_msg(const uint8_t nonce[], size_t nonce_len) override; - explicit KMAC256(uint32_t output_byte_length); + explicit KMAC256(size_t output_byte_length); KMAC256(const KMAC256&) = delete; KMAC256& operator=(const KMAC256&) = delete;