diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-01-18 11:29:04 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-01-18 13:28:16 +0100 |
commit | 88336607d9526321da3b4a70ad391dec7687d504 (patch) | |
tree | 46570470e4f81c266b05d2bb947889aaa528d822 /src/crypto/curve25519.c | |
parent | 111b2cfc82b111c1d697531324cb75a47e02b953 (diff) |
curve25519: wire up new impls and remove donna
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/crypto/curve25519.c')
-rw-r--r-- | src/crypto/curve25519.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/crypto/curve25519.c b/src/crypto/curve25519.c index dd7f4bd..eba94cd 100644 --- a/src/crypto/curve25519.c +++ b/src/crypto/curve25519.c @@ -26,17 +26,15 @@ void __init curve25519_fpu_init(void) { } #endif #if defined(CONFIG_ARCH_SUPPORTS_INT128) && defined(__SIZEOF_INT128__) -#include "curve25519-u128.h" +#include "curve25519-hacl64.h" #else -#include "curve25519-generic.h" +#include "curve25519-fiat32.h" #endif static const u8 null_point[CURVE25519_POINT_SIZE] = { 0 }; bool curve25519(u8 mypublic[CURVE25519_POINT_SIZE], const u8 secret[CURVE25519_POINT_SIZE], const u8 basepoint[CURVE25519_POINT_SIZE]) { - bool ret = true; - #if defined(CONFIG_X86_64) && defined(CONFIG_AS_AVX) if (curve25519_use_avx && irq_fpu_usable()) { kernel_fpu_begin(); @@ -50,10 +48,7 @@ bool curve25519(u8 mypublic[CURVE25519_POINT_SIZE], const u8 secret[CURVE25519_P kernel_neon_end(); } else #endif - ret = curve25519_donna(mypublic, secret, basepoint); - - if (!ret) /* OOM or the like; not the result of a cryptographic operation or string comparison. */ - return ret; + curve25519_generic(mypublic, secret, basepoint); return crypto_memneq(mypublic, null_point, CURVE25519_POINT_SIZE); } |