curve25519: replace fiat64 with faster hacl64

This reverts commit da4ff396cc5d5e0ff21f9ecbc2f951c048c63fff and adds
some optimizations to hacl64.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld 2018-02-01 19:15:28 +01:00
parent 40ae0e0bba
commit bee5bbb6f3
2 changed files with 4 additions and 4 deletions

View File

@ -48,7 +48,7 @@ static __always_inline void normalize_secret(u8 secret[CURVE25519_POINT_SIZE])
secret[31] |= 64; secret[31] |= 64;
} }
#include "../../../../src/crypto/curve25519-generic.h" #include "../../../../src/crypto/curve25519-fiat32.h"
EMSCRIPTEN_KEEPALIVE void curve25519_generate_public(u8 public[static 32], const u8 private[static 32]) EMSCRIPTEN_KEEPALIVE void curve25519_generate_public(u8 public[static 32], const u8 private[static 32])
{ {

View File

@ -39,11 +39,11 @@ static noinline void memzero_explicit(void *s, size_t count)
} }
#ifdef __SIZEOF_INT128__ #ifdef __SIZEOF_INT128__
#define CONFIG_ARCH_SUPPORTS_INT128 #include "../crypto/curve25519-hacl64.h"
#else
#include "../crypto/curve25519-fiat32.h"
#endif #endif
#include "../crypto/curve25519-generic.h"
void curve25519_generate_public(uint8_t pub[static CURVE25519_POINT_SIZE], const uint8_t secret[static CURVE25519_POINT_SIZE]) void curve25519_generate_public(uint8_t pub[static CURVE25519_POINT_SIZE], const uint8_t secret[static CURVE25519_POINT_SIZE])
{ {
static const uint8_t basepoint[CURVE25519_POINT_SIZE] = { 9 }; static const uint8_t basepoint[CURVE25519_POINT_SIZE] = { 9 };