mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-31 19:24:42 +02:00
Add ARM32 asm code for X25519 and Ed25519
Improvements to performance of ARM64 code for X25519 and Ed25519
This commit is contained in:
@@ -375,6 +375,7 @@ if BUILD_INTELASM
|
||||
src_libwolfssl_la_SOURCES += wolfcrypt/src/fe_x25519_asm.S
|
||||
else
|
||||
if BUILD_ARMASM
|
||||
src_libwolfssl_la_SOURCES += wolfcrypt/src/port/arm/armv7-curve25519.S
|
||||
src_libwolfssl_la_SOURCES += wolfcrypt/src/port/arm/armv8-curve25519.S
|
||||
else
|
||||
src_libwolfssl_la_SOURCES += wolfcrypt/src/fe_operations.c
|
||||
@@ -393,6 +394,7 @@ if BUILD_INTELASM
|
||||
src_libwolfssl_la_SOURCES += wolfcrypt/src/fe_x25519_asm.S
|
||||
else
|
||||
if BUILD_ARMASM
|
||||
src_libwolfssl_la_SOURCES += wolfcrypt/src/port/arm/armv7-curve25519.S
|
||||
src_libwolfssl_la_SOURCES += wolfcrypt/src/port/arm/armv8-curve25519.S
|
||||
else
|
||||
src_libwolfssl_la_SOURCES += wolfcrypt/src/fe_operations.c
|
||||
|
@@ -42,7 +42,9 @@
|
||||
#endif
|
||||
|
||||
#ifdef CURVED25519_X64
|
||||
/* Assumbly code in fe_x25519_asm.* */
|
||||
/* Assembly code in fe_x25519_asm.* */
|
||||
#elif defined(WOLFSSL_ARMASM)
|
||||
/* Assembly code in fe_armv[78]_x25519.* */
|
||||
#elif defined(CURVED25519_128BIT)
|
||||
#include "fe_x25519_128.i"
|
||||
#else
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -52,6 +52,8 @@ EXTRA_DIST += wolfcrypt/src/port/ti/ti-aes.c \
|
||||
wolfcrypt/src/port/arm/armv8-sha256.c \
|
||||
wolfcrypt/src/port/arm/armv8-curve25519.c \
|
||||
wolfcrypt/src/port/arm/armv8-curve25519.S \
|
||||
wolfcrypt/src/port/arm/armv7-curve25519.c \
|
||||
wolfcrypt/src/port/arm/armv7-curve25519.S \
|
||||
wolfcrypt/src/port/nxp/ksdk_port.c \
|
||||
wolfcrypt/src/port/atmel/README.md \
|
||||
wolfcrypt/src/port/xilinx/xil-sha3.c \
|
||||
|
6005
wolfcrypt/src/port/arm/armv7-curve25519.S
Normal file
6005
wolfcrypt/src/port/arm/armv7-curve25519.S
Normal file
File diff suppressed because it is too large
Load Diff
5623
wolfcrypt/src/port/arm/armv7-curve25519.c
Normal file
5623
wolfcrypt/src/port/arm/armv7-curve25519.c
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
@@ -39,8 +39,17 @@
|
||||
#define CURVED25519_128BIT
|
||||
#endif
|
||||
|
||||
#if defined(CURVED25519_X64) || defined(WOLFSSL_ARMASM)
|
||||
#if defined(CURVED25519_X64)
|
||||
#define CURVED25519_ASM_64BIT
|
||||
#define CURVED25519_ASM
|
||||
#endif
|
||||
#if defined(WOLFSSL_ARMASM)
|
||||
#ifdef __aarch64__
|
||||
#define CURVED25519_ASM_64BIT
|
||||
#else
|
||||
#define CURVED25519_ASM_32BIT
|
||||
#endif
|
||||
#define CURVED25519_ASM
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -78,6 +87,8 @@ WOLFSSL_LOCAL int curve25519(byte * q, byte * n, byte * p);
|
||||
|
||||
#ifdef CURVED25519_ASM_64BIT
|
||||
typedef int64_t fe[4];
|
||||
#elif defined(CURVED25519_ASM_32BIT)
|
||||
typedef int32_t fe[8];
|
||||
#elif defined(CURVED25519_128BIT)
|
||||
typedef int64_t fe[5];
|
||||
#else
|
||||
@@ -112,7 +123,7 @@ WOLFSSL_LOCAL void fe_pow22523(fe,const fe);
|
||||
WOLFSSL_LOCAL uint64_t load_3(const unsigned char *in);
|
||||
WOLFSSL_LOCAL uint64_t load_4(const unsigned char *in);
|
||||
|
||||
#ifdef CURVED25519_ASM_64BIT
|
||||
#ifdef CURVED25519_ASM
|
||||
WOLFSSL_LOCAL void fe_ge_to_p2(fe rx, fe ry, fe rz, const fe px, const fe py,
|
||||
const fe pz, const fe pt);
|
||||
WOLFSSL_LOCAL void fe_ge_to_p3(fe rx, fe ry, fe rz, fe rt, const fe px,
|
||||
@@ -136,7 +147,7 @@ WOLFSSL_LOCAL void fe_ge_sub(fe rx, fe ry, fe rz, fe rt, const fe px,
|
||||
const fe qt2d, const fe qyplusx,
|
||||
const fe qyminusx);
|
||||
WOLFSSL_LOCAL void fe_cmov_table(fe* r, fe* base, signed char b);
|
||||
#endif /* CURVED25519_ASM_64BIT */
|
||||
#endif /* CURVED25519_ASM */
|
||||
#endif /* !CURVE25519_SMALL || !ED25519_SMALL */
|
||||
|
||||
/* Use less memory and only 32bit types or less, but is slower
|
||||
|
@@ -49,6 +49,8 @@ Representations:
|
||||
typedef byte ge[F25519_SIZE];
|
||||
#elif defined(CURVED25519_ASM_64BIT)
|
||||
typedef int64_t ge[4];
|
||||
#elif defined(CURVED25519_ASM_32BIT)
|
||||
typedef int32_t ge[8];
|
||||
#elif defined(CURVED25519_128BIT)
|
||||
typedef int64_t ge[5];
|
||||
#else
|
||||
|
Reference in New Issue
Block a user