Curve25519 converted from inline assembly to asm only

Fixed large values (top bit set) in tables to be negative as the type is
signed.
Put C++ protection around function prototypes in fe_operations.h.
This commit is contained in:
Sean Parkinson
2019-04-11 16:17:48 +10:00
parent c78b0c3a40
commit e5bf2ed1d1
7 changed files with 17578 additions and 3475 deletions

View File

@ -372,6 +372,9 @@ if BUILD_CURVE25519_SMALL
src_libwolfssl_la_SOURCES += wolfcrypt/src/fe_low_mem.c
else
src_libwolfssl_la_SOURCES += wolfcrypt/src/fe_operations.c
if BUILD_INTELASM
src_libwolfssl_la_SOURCES += wolfcrypt/src/fe_x25519_asm.S
endif
endif
endif
@ -382,6 +385,9 @@ else
src_libwolfssl_la_SOURCES += wolfcrypt/src/ge_operations.c
if !BUILD_FEMATH
src_libwolfssl_la_SOURCES += wolfcrypt/src/fe_operations.c
if BUILD_INTELASM
src_libwolfssl_la_SOURCES += wolfcrypt/src/fe_x25519_asm.S
endif
endif
endif
endif

View File

@ -42,7 +42,7 @@
#endif
#ifdef CURVED25519_X64
#include "fe_x25519_x64.i"
/* Assumbly code in fe_x25519_asm.* */
#elif defined(CURVED25519_128BIT)
#include "fe_x25519_128.i"
#else

16178
wolfcrypt/src/fe_x25519_asm.S Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -40,8 +40,7 @@ EXTRA_DIST += \
wolfcrypt/src/fp_sqr_comba_8.i \
wolfcrypt/src/fp_sqr_comba_9.i \
wolfcrypt/src/fp_sqr_comba_small_set.i \
wolfcrypt/src/fe_x25519_128.i \
wolfcrypt/src/fe_x25519_x64.i
wolfcrypt/src/fe_x25519_128.i
EXTRA_DIST += wolfcrypt/src/port/ti/ti-aes.c \
wolfcrypt/src/port/ti/ti-des3.c \

View File

@ -47,6 +47,10 @@ t[0]+2^26 t[1]+2^51 t[2]+2^77 t[3]+2^102 t[4]+...+2^230 t[9].
Bounds on each t[i] vary depending on context.
*/
#ifdef __cplusplus
extern "C" {
#endif
#if defined(CURVE25519_SMALL) || defined(ED25519_SMALL)
#define F25519_SIZE 32
@ -181,6 +185,11 @@ WOLFSSL_LOCAL void fprime_mul(byte *r, const byte *a, const byte *b,
WOLFSSL_LOCAL void fprime_copy(byte *x, const byte *a);
#endif /* CURVE25519_SMALL || ED25519_SMALL */
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* HAVE_CURVE25519 || HAVE_ED25519 */
#endif /* WOLF_CRYPT_FE_OPERATIONS_H */