Merge pull request #2202 from SparkiDev/curve25519_asm_file

Curve25519 converted from inline assembly to asm only
This commit is contained in:
toddouska
2019-04-12 16:31:08 -07:00
committed by GitHub
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 src_libwolfssl_la_SOURCES += wolfcrypt/src/fe_low_mem.c
else else
src_libwolfssl_la_SOURCES += wolfcrypt/src/fe_operations.c 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 endif
@ -382,6 +385,9 @@ else
src_libwolfssl_la_SOURCES += wolfcrypt/src/ge_operations.c src_libwolfssl_la_SOURCES += wolfcrypt/src/ge_operations.c
if !BUILD_FEMATH if !BUILD_FEMATH
src_libwolfssl_la_SOURCES += wolfcrypt/src/fe_operations.c 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 endif
endif endif

View File

@ -42,7 +42,7 @@
#endif #endif
#ifdef CURVED25519_X64 #ifdef CURVED25519_X64
#include "fe_x25519_x64.i" /* Assumbly code in fe_x25519_asm.* */
#elif defined(CURVED25519_128BIT) #elif defined(CURVED25519_128BIT)
#include "fe_x25519_128.i" #include "fe_x25519_128.i"
#else #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_8.i \
wolfcrypt/src/fp_sqr_comba_9.i \ wolfcrypt/src/fp_sqr_comba_9.i \
wolfcrypt/src/fp_sqr_comba_small_set.i \ wolfcrypt/src/fp_sqr_comba_small_set.i \
wolfcrypt/src/fe_x25519_128.i \ wolfcrypt/src/fe_x25519_128.i
wolfcrypt/src/fe_x25519_x64.i
EXTRA_DIST += wolfcrypt/src/port/ti/ti-aes.c \ EXTRA_DIST += wolfcrypt/src/port/ti/ti-aes.c \
wolfcrypt/src/port/ti/ti-des3.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. Bounds on each t[i] vary depending on context.
*/ */
#ifdef __cplusplus
extern "C" {
#endif
#if defined(CURVE25519_SMALL) || defined(ED25519_SMALL) #if defined(CURVE25519_SMALL) || defined(ED25519_SMALL)
#define F25519_SIZE 32 #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); WOLFSSL_LOCAL void fprime_copy(byte *x, const byte *a);
#endif /* CURVE25519_SMALL || ED25519_SMALL */ #endif /* CURVE25519_SMALL || ED25519_SMALL */
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* HAVE_CURVE25519 || HAVE_ED25519 */ #endif /* HAVE_CURVE25519 || HAVE_ED25519 */
#endif /* WOLF_CRYPT_FE_OPERATIONS_H */ #endif /* WOLF_CRYPT_FE_OPERATIONS_H */