From b3180551851d6f736a98eb059d5b46b0872666e2 Mon Sep 17 00:00:00 2001 From: Mark Haines Date: Wed, 19 Aug 2015 17:18:09 +0100 Subject: Replace hard coded references to the 32-byte key length with a constant, add utilities for copying data to and from fixed sized arrays --- src/utility.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/utility.cpp') diff --git a/src/utility.cpp b/src/utility.cpp index 1d8c5c1..bc51cff 100644 --- a/src/utility.cpp +++ b/src/utility.cpp @@ -23,7 +23,7 @@ olm::Utility::Utility( size_t olm::Utility::sha256_length() { - return olm::HMAC_SHA256_OUTPUT_LENGTH; + return olm::SHA256_OUTPUT_LENGTH; } @@ -36,7 +36,7 @@ size_t olm::Utility::sha256( return std::size_t(-1); } olm::sha256(input, input_length, output); - return 32; + return olm::SHA256_OUTPUT_LENGTH; } @@ -45,7 +45,7 @@ size_t olm::Utility::ed25519_verify( std::uint8_t const * message, std::size_t message_length, std::uint8_t const * signature, std::size_t signature_length ) { - if (signature_length < 64) { + if (signature_length < olm::SIGNATURE_LENGTH) { last_error = olm::ErrorCode::BAD_MESSAGE_MAC; return std::size_t(-1); } -- cgit v1.2.3