aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/selftest/poly1305.h
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-06-16 04:52:35 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-06-17 19:36:37 +0200
commit6d7f0b0a746b06a903ec8e14fe14cd0605fb210f (patch)
treed5d8a55faba0202587877594622ec89e6cadcd04 /src/selftest/poly1305.h
parentqueueing: re-enable preemption periodically to lower latency (diff)
downloadwireguard-monolithic-historical-6d7f0b0a746b06a903ec8e14fe14cd0605fb210f.tar.xz
wireguard-monolithic-historical-6d7f0b0a746b06a903ec8e14fe14cd0605fb210f.zip
simd: encapsulate fpu amortization into nice functions
Diffstat (limited to 'src/selftest/poly1305.h')
-rw-r--r--src/selftest/poly1305.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/selftest/poly1305.h b/src/selftest/poly1305.h
index 41acf7c..b3b74e1 100644
--- a/src/selftest/poly1305.h
+++ b/src/selftest/poly1305.h
@@ -7,6 +7,7 @@
#ifdef DEBUG
#include "../crypto/chacha20poly1305.h"
+#include "../crypto/simd.h"
struct poly1305_testdata {
size_t size;
@@ -1489,7 +1490,7 @@ static const struct poly1305_testvec poly1305_testvecs[] = {
bool __init poly1305_selftest(void)
{
- bool have_simd = chacha20poly1305_init_simd();
+ bool have_simd = simd_get();
bool success = true;
size_t i;
@@ -1558,7 +1559,7 @@ bool __init poly1305_selftest(void)
}
}
}
- chacha20poly1305_deinit_simd(have_simd);
+ simd_put(have_simd);
if (success)
pr_info("poly1305 self-tests: pass\n");