diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-09-25 23:01:32 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-09-25 23:26:35 +0200 |
commit | 38c18b1364f7afa358b1a96464c0a4d6f737c78f (patch) | |
tree | 4048844deb9625c25f874e56ad336e9d0642d0df /src/crypto/zinc/blake2s/blake2s.c | |
parent | b161ec0f59cb93132fe6289f2b19a2fb7f893595 (diff) |
crypto: rename DEBUG to SELFTEST
Also we make selftest errors of type err, so that they're obvious in
dmesg.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/crypto/zinc/blake2s/blake2s.c')
-rw-r--r-- | src/crypto/zinc/blake2s/blake2s.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/crypto/zinc/blake2s/blake2s.c b/src/crypto/zinc/blake2s/blake2s.c index 5ce74c1..bd7146b 100644 --- a/src/crypto/zinc/blake2s/blake2s.c +++ b/src/crypto/zinc/blake2s/blake2s.c @@ -86,7 +86,7 @@ void blake2s_init(struct blake2s_state *state, const size_t outlen) .depth = 1 }; -#ifdef DEBUG +#ifdef CONFIG_ZINC_SELFTEST BUG_ON(!outlen || outlen > BLAKE2S_HASH_SIZE); #endif blake2s_init_param(state, ¶m); @@ -102,7 +102,7 @@ void blake2s_init_key(struct blake2s_state *state, const size_t outlen, .depth = 1 }; u8 block[BLAKE2S_BLOCK_SIZE] = { 0 }; -#ifdef DEBUG +#ifdef CONFIG_ZINC_SELFTEST BUG_ON(!outlen || outlen > BLAKE2S_HASH_SIZE || !key || !keylen || keylen > BLAKE2S_KEY_SIZE); #endif @@ -135,7 +135,7 @@ static inline void blake2s_compress(struct blake2s_state *state, u32 v[16]; int i; -#ifdef DEBUG +#ifdef CONFIG_ZINC_SELFTEST BUG_ON(nblocks > 1 && inc != BLAKE2S_BLOCK_SIZE); #endif @@ -232,7 +232,7 @@ EXPORT_SYMBOL(blake2s_update); void blake2s_final(struct blake2s_state *state, u8 *out, const size_t outlen) { -#ifdef DEBUG +#ifdef CONFIG_ZINC_SELFTEST BUG_ON(!out || !outlen || outlen > BLAKE2S_HASH_SIZE); #endif blake2s_set_lastblock(state); @@ -294,7 +294,7 @@ static int __init mod_init(void) { if (!nosimd) blake2s_fpu_init(); -#ifdef DEBUG +#ifdef CONFIG_ZINC_SELFTEST if (!blake2s_selftest()) return -ENOTRECOVERABLE; #endif |