From 5f3104cf5f9947f07b2c1e27bab83e3949019843 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Sun, 31 Mar 2013 14:56:27 -0700 Subject: [PATCH] Turn COMPILER_ASSERT() to assert() in generichash_blake2b.c Thanks to @sneves --- .../crypto_generichash/blake2/ref/generichash_blake2b.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/libsodium/crypto_generichash/blake2/ref/generichash_blake2b.c b/src/libsodium/crypto_generichash/blake2/ref/generichash_blake2b.c index 5382cbae..dfcfa19e 100644 --- a/src/libsodium/crypto_generichash/blake2/ref/generichash_blake2b.c +++ b/src/libsodium/crypto_generichash/blake2/ref/generichash_blake2b.c @@ -1,12 +1,11 @@ +#include #include #include #include "blake2.h" #include "crypto_generichash.h" -#define COMPILER_ASSERT(X) (void) sizeof(char[(X) ? 1 : -1]) - int crypto_generichash_blake2b(unsigned char *out, const unsigned char *in, const unsigned char *key, @@ -18,8 +17,8 @@ crypto_generichash_blake2b(unsigned char *out, const unsigned char *in, inlen > UINT64_MAX) { return -1; } - COMPILER_ASSERT(outlen <= UINT8_MAX); - COMPILER_ASSERT(keylen <= UINT8_MAX); + assert(outlen <= UINT8_MAX); + assert(keylen <= UINT8_MAX); return blake2b((uint8_t *) out, in, key, (uint8_t) outlen, inlen, (uint8_t) keylen);