diff options
author | Richard van der Hoff <richard@matrix.org> | 2016-05-24 13:33:33 +0100 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2016-05-24 13:33:33 +0100 |
commit | 2e7800cf650197f4b8998ef8ac24d08daa316a2f (patch) | |
tree | 1f9e5e06b755f929c7bad363b77eaafdd21d706c /src/utility.cpp | |
parent | b1c5732fc8c89ee9217d0f54408f860565fa01f4 (diff) | |
parent | 2fd28a66824bda7b86c08b065736009c39761987 (diff) |
Merge branch 'rav/c_bindings'
Diffstat (limited to 'src/utility.cpp')
-rw-r--r-- | src/utility.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/utility.cpp b/src/utility.cpp index bc51cff..67029c9 100644 --- a/src/utility.cpp +++ b/src/utility.cpp @@ -18,12 +18,12 @@ olm::Utility::Utility( -) : last_error(olm::ErrorCode::SUCCESS) { +) : last_error(OlmErrorCode::OLM_SUCCESS) { } size_t olm::Utility::sha256_length() { - return olm::SHA256_OUTPUT_LENGTH; + return SHA256_OUTPUT_LENGTH; } @@ -32,11 +32,11 @@ size_t olm::Utility::sha256( std::uint8_t * output, std::size_t output_length ) { if (output_length < sha256_length()) { - last_error = olm::ErrorCode::OUTPUT_BUFFER_TOO_SMALL; + last_error = OlmErrorCode::OLM_OUTPUT_BUFFER_TOO_SMALL; return std::size_t(-1); } - olm::sha256(input, input_length, output); - return olm::SHA256_OUTPUT_LENGTH; + _olm_crypto_sha256(input, input_length, output); + return SHA256_OUTPUT_LENGTH; } @@ -46,11 +46,11 @@ size_t olm::Utility::ed25519_verify( std::uint8_t const * signature, std::size_t signature_length ) { if (signature_length < olm::SIGNATURE_LENGTH) { - last_error = olm::ErrorCode::BAD_MESSAGE_MAC; + last_error = OlmErrorCode::OLM_BAD_MESSAGE_MAC; return std::size_t(-1); } if (!olm::ed25519_verify(key, message, message_length, signature)) { - last_error = olm::ErrorCode::BAD_MESSAGE_MAC; + last_error = OlmErrorCode::OLM_BAD_MESSAGE_MAC; return std::size_t(-1); } return std::size_t(0); |