Turn COMPILER_ASSERT() to assert() in generichash_blake2b.c

Thanks to @sneves
This commit is contained in:
Frank Denis 2013-03-31 14:56:27 -07:00
parent 077e89b6b5
commit 5f3104cf5f

View File

@ -1,12 +1,11 @@
#include <assert.h>
#include <limits.h> #include <limits.h>
#include <stdint.h> #include <stdint.h>
#include "blake2.h" #include "blake2.h"
#include "crypto_generichash.h" #include "crypto_generichash.h"
#define COMPILER_ASSERT(X) (void) sizeof(char[(X) ? 1 : -1])
int int
crypto_generichash_blake2b(unsigned char *out, const unsigned char *in, crypto_generichash_blake2b(unsigned char *out, const unsigned char *in,
const unsigned char *key, const unsigned char *key,
@ -18,8 +17,8 @@ crypto_generichash_blake2b(unsigned char *out, const unsigned char *in,
inlen > UINT64_MAX) { inlen > UINT64_MAX) {
return -1; return -1;
} }
COMPILER_ASSERT(outlen <= UINT8_MAX); assert(outlen <= UINT8_MAX);
COMPILER_ASSERT(keylen <= UINT8_MAX); assert(keylen <= UINT8_MAX);
return blake2b((uint8_t *) out, in, key, return blake2b((uint8_t *) out, in, key,
(uint8_t) outlen, inlen, (uint8_t) keylen); (uint8_t) outlen, inlen, (uint8_t) keylen);