From 38c18b1364f7afa358b1a96464c0a4d6f737c78f Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Tue, 25 Sep 2018 23:01:32 +0200 Subject: 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 --- src/crypto/zinc/blake2s/blake2s.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/crypto/zinc/blake2s/blake2s.c') 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 -- cgit v1.2.3