diff options
Diffstat (limited to 'src/lib/pubkey/xmss/xmss_verification_operation.cpp')
-rw-r--r-- | src/lib/pubkey/xmss/xmss_verification_operation.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/lib/pubkey/xmss/xmss_verification_operation.cpp b/src/lib/pubkey/xmss/xmss_verification_operation.cpp index 34d7ee647..fe712d4c8 100644 --- a/src/lib/pubkey/xmss/xmss_verification_operation.cpp +++ b/src/lib/pubkey/xmss/xmss_verification_operation.cpp @@ -20,11 +20,11 @@ XMSS_Verification_Operation::XMSS_Verification_Operation( { } -secure_vector<byte> +secure_vector<uint8_t> XMSS_Verification_Operation::root_from_signature(const XMSS_Signature& sig, - const secure_vector<byte>& msg, + const secure_vector<uint8_t>& msg, XMSS_Address& adrs, - const secure_vector<byte>& seed) + const secure_vector<uint8_t>& seed) { adrs.set_type(XMSS_Address::Type::OTS_Hash_Address); adrs.set_ots_address(sig.unused_leaf_index()); @@ -38,7 +38,7 @@ XMSS_Verification_Operation::root_from_signature(const XMSS_Signature& sig, adrs.set_type(XMSS_Address::Type::LTree_Address); adrs.set_ltree_address(sig.unused_leaf_index()); - std::array<secure_vector<byte>, 2> node; + std::array<secure_vector<uint8_t>, 2> node; create_l_tree(node[0], pub_key_ots, adrs, seed); adrs.set_type(XMSS_Address::Type::Hash_Tree_Address); @@ -72,21 +72,21 @@ XMSS_Verification_Operation::root_from_signature(const XMSS_Signature& sig, bool XMSS_Verification_Operation::verify(const XMSS_Signature& sig, - const secure_vector<byte>& msg, + const secure_vector<uint8_t>& msg, const XMSS_PublicKey& public_key) { XMSS_Address adrs; - secure_vector<byte> index_bytes; + secure_vector<uint8_t> index_bytes; XMSS_Tools::concat(index_bytes, sig.unused_leaf_index(), m_xmss_params.element_size()); - secure_vector<byte> msg_digest = + secure_vector<uint8_t> msg_digest = m_hash.h_msg(sig.randomness(), public_key.root(), index_bytes, msg); - secure_vector<byte> node = root_from_signature(sig, + secure_vector<uint8_t> node = root_from_signature(sig, msg_digest, adrs, public_key.public_seed()); @@ -101,18 +101,18 @@ XMSS_Verification_Operation::verify(const XMSS_Signature& sig, // impossible. // Possible solution: Change PK_Ops::Verification interface to take the // signature as constructor argument, make sign a parameterless member call. -void XMSS_Verification_Operation::update(const byte msg[], size_t msg_len) +void XMSS_Verification_Operation::update(const uint8_t msg[], size_t msg_len) { std::copy(msg, msg + msg_len, std::back_inserter(m_msg_buf)); } -bool XMSS_Verification_Operation::is_valid_signature(const byte sig[], +bool XMSS_Verification_Operation::is_valid_signature(const uint8_t sig[], size_t sig_len) { try { XMSS_Signature signature(m_pub_key.xmss_parameters().oid(), - secure_vector<byte>(sig, sig + sig_len)); + secure_vector<uint8_t>(sig, sig + sig_len)); bool result = verify(signature, m_msg_buf, m_pub_key); m_msg_buf.clear(); return result; |