aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/crypto/zinc/poly1305/poly1305.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
commit97e9a61fd5631985232923cff83b2ddc0ca476c0 (patch)
treeb05245f7be911d091cc0f4e4b6bc3d04db385e9e /src/crypto/zinc/poly1305/poly1305.c
parentglobal: rename include'd C files to be .c (diff)
downloadwireguard-monolithic-historical-97e9a61fd5631985232923cff83b2ddc0ca476c0.tar.xz
wireguard-monolithic-historical-97e9a61fd5631985232923cff83b2ddc0ca476c0.zip
crypto: test all SIMD combinations
Diffstat (limited to 'src/crypto/zinc/poly1305/poly1305.c')
-rw-r--r--src/crypto/zinc/poly1305/poly1305.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/crypto/zinc/poly1305/poly1305.c b/src/crypto/zinc/poly1305/poly1305.c
index 88f94cd..6da8bf1 100644
--- a/src/crypto/zinc/poly1305/poly1305.c
+++ b/src/crypto/zinc/poly1305/poly1305.c
@@ -8,6 +8,7 @@
*/
#include <zinc/poly1305.h>
+#include "../selftest/run.h"
#include <asm/unaligned.h>
#include <linux/kernel.h>
@@ -39,6 +40,7 @@ static inline bool poly1305_emit_arch(void *ctx, u8 mac[POLY1305_MAC_SIZE],
{
return false;
}
+static bool *const poly1305_nobs[] __initconst = { };
static void __init poly1305_fpu_init(void)
{
}
@@ -146,10 +148,9 @@ static int __init mod_init(void)
{
if (!nosimd)
poly1305_fpu_init();
-#ifdef CONFIG_ZINC_SELFTEST
- if (WARN_ON(!poly1305_selftest()))
+ if (!selftest_run("poly1305", poly1305_selftest, poly1305_nobs,
+ ARRAY_SIZE(poly1305_nobs)))
return -ENOTRECOVERABLE;
-#endif
return 0;
}