aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/crypto/zinc/chacha20/chacha20.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/crypto/zinc/chacha20/chacha20.c')
-rw-r--r--src/crypto/zinc/chacha20/chacha20.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/crypto/zinc/chacha20/chacha20.c b/src/crypto/zinc/chacha20/chacha20.c
index ef2404f..a7c7adc 100644
--- a/src/crypto/zinc/chacha20/chacha20.c
+++ b/src/crypto/zinc/chacha20/chacha20.c
@@ -172,6 +172,8 @@ void hchacha20(u8 derived_key[CHACHA20_KEY_SIZE],
}
EXPORT_SYMBOL(hchacha20);
+#include "../selftest/chacha20.h"
+
static bool nosimd __initdata = false;
#ifndef COMPAT_ZINC_IS_A_MODULE
@@ -182,6 +184,10 @@ static int __init mod_init(void)
{
if (!nosimd)
chacha20_fpu_init();
+#ifdef DEBUG
+ if (!chacha20_selftest())
+ return -ENOTRECOVERABLE;
+#endif
return 0;
}