From 683a655908d5b9b0e368c6fcc5d2556f6f3913be Mon Sep 17 00:00:00 2001 From: Sean Parkinson Date: Tue, 4 Apr 2017 14:17:54 +1000 Subject: [PATCH] Starting 128-bit FE implementation --- wolfcrypt/src/fe_operations.c | 4 ++++ wolfssl/wolfcrypt/fe_operations.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/wolfcrypt/src/fe_operations.c b/wolfcrypt/src/fe_operations.c index a47ff3cfb..76b3ef147 100755 --- a/wolfcrypt/src/fe_operations.c +++ b/wolfcrypt/src/fe_operations.c @@ -41,6 +41,9 @@ #include #endif +#ifdef FE_128BIT +#include "fe_x25519.c" +#else /* fe means field element. Here the field is \Z/(2^255-19). @@ -1407,6 +1410,7 @@ void fe_cmov(fe f, const fe g, int b) f[8] = f8 ^ x8; f[9] = f9 ^ x9; } +#endif #endif /* HAVE ED25519 or CURVE25519 */ #endif /* not defined CURVED25519_SMALL */ diff --git a/wolfssl/wolfcrypt/fe_operations.h b/wolfssl/wolfcrypt/fe_operations.h index 0696b6789..9b0ffd318 100644 --- a/wolfssl/wolfcrypt/fe_operations.h +++ b/wolfssl/wolfcrypt/fe_operations.h @@ -43,6 +43,8 @@ Bounds on each t[i] vary depending on context. #ifdef CURVED25519_SMALL #define F25519_SIZE 32 typedef byte fe[32]; +#elif defined(FE_128BIT) + typedef int64_t fe[5]; #else typedef int32_t fe[10]; #endif