summaryrefslogtreecommitdiffhomepage
path: root/src/crypto/zinc/blake2s/blake2s.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-10-05 03:13:30 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-10-06 02:19:47 +0200
commit15278beaa6f5a416725f9be9212323e8c19e57c4 (patch)
tree4020d614248eb3fb95ac4cab11feeaddfafd4cb0 /src/crypto/zinc/blake2s/blake2s.c
parentff0f6e667ff877cd605d2b107c897b039f9829d9 (diff)
crypto: test all SIMD combinations
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.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/crypto/zinc/blake2s/blake2s.c b/src/crypto/zinc/blake2s/blake2s.c
index fe4d4b4..311c3fd 100644
--- a/src/crypto/zinc/blake2s/blake2s.c
+++ b/src/crypto/zinc/blake2s/blake2s.c
@@ -10,6 +10,7 @@
*/
#include <zinc/blake2s.h>
+#include "../selftest/run.h"
#include <linux/types.h>
#include <linux/string.h>
@@ -112,6 +113,7 @@ EXPORT_SYMBOL(blake2s_init_key);
#if defined(CONFIG_ZINC_ARCH_X86_64)
#include "blake2s-x86_64-glue.c"
#else
+static bool *const blake2s_nobs[] __initconst = { };
static void __init blake2s_fpu_init(void)
{
}
@@ -283,10 +285,9 @@ static int __init mod_init(void)
{
if (!nosimd)
blake2s_fpu_init();
-#ifdef CONFIG_ZINC_SELFTEST
- if (WARN_ON(!blake2s_selftest()))
+ if (!selftest_run("blake2s", blake2s_selftest, blake2s_nobs,
+ ARRAY_SIZE(blake2s_nobs)))
return -ENOTRECOVERABLE;
-#endif
return 0;
}