diff --git a/src/libsodium/include/sodium/utils.h b/src/libsodium/include/sodium/utils.h index e962d71d..aaf3fc5d 100644 --- a/src/libsodium/include/sodium/utils.h +++ b/src/libsodium/include/sodium/utils.h @@ -23,7 +23,7 @@ SODIUM_EXPORT void sodium_memzero(void * const pnt, const size_t len); SODIUM_EXPORT -int sodium_memcmp(const void * const b1_, const void * const b2_, size_t size); +int sodium_memcmp(const void * const b1_, const void * const b2_, size_t len); SODIUM_EXPORT char *sodium_bin2hex(char * const hex, const size_t hex_maxlen, diff --git a/src/libsodium/sodium/utils.c b/src/libsodium/sodium/utils.c index 27a0a9f8..75e74b08 100644 --- a/src/libsodium/sodium/utils.c +++ b/src/libsodium/sodium/utils.c @@ -36,14 +36,14 @@ sodium_memzero(void * const pnt, const size_t len) } int -sodium_memcmp(const void * const b1_, const void * const b2_, size_t size) +sodium_memcmp(const void * const b1_, const void * const b2_, size_t len) { const unsigned char *b1 = (const unsigned char *) b1_; const unsigned char *b2 = (const unsigned char *) b2_; size_t i; unsigned char d = (unsigned char) 0U; - for (i = 0U; i < size; i++) { + for (i = 0U; i < len; i++) { d |= b1[i] ^ b2[i]; } return (int) ((1 & ((d - 1) >> 8)) - 1);