forked from wolfSSL/wolfssl
SP: Thumb assembly for older Keil compilers and optimize
Improve the generated instructions for multiplying 32 bits by 32 bits and squaring 32 bits with 64 bit results. Minimize loads in montgomery reduction, mul and sqr. Pull conditional subtract into montgomery reduction assembly code. Added unrolled square and multiply Define WOLFSSL_SP_LARGE_CODE to use the unrolled versions.
This commit is contained in:
@@ -50,7 +50,7 @@
|
||||
#ifdef WOLFSSL_SP_ARM32_ASM
|
||||
#define SP_PRINT_NUM(var, name, total, words, bits) \
|
||||
do { \
|
||||
int ii \
|
||||
int ii; \
|
||||
fprintf(stderr, name "=0x"); \
|
||||
for (ii = words - 1; ii >= 0; ii--) \
|
||||
fprintf(stderr, SP_PRINT_FMT, (var)[ii]); \
|
||||
|
@@ -50,7 +50,7 @@
|
||||
#ifdef WOLFSSL_SP_ARM64_ASM
|
||||
#define SP_PRINT_NUM(var, name, total, words, bits) \
|
||||
do { \
|
||||
int ii \
|
||||
int ii; \
|
||||
fprintf(stderr, name "=0x"); \
|
||||
for (ii = words - 1; ii >= 0; ii--) \
|
||||
fprintf(stderr, SP_PRINT_FMT, (var)[ii]); \
|
||||
|
162088
wolfcrypt/src/sp_armthumb.c
162088
wolfcrypt/src/sp_armthumb.c
File diff suppressed because it is too large
Load Diff
@@ -59,7 +59,7 @@
|
||||
#ifdef WOLFSSL_SP_ARM_CORTEX_M_ASM
|
||||
#define SP_PRINT_NUM(var, name, total, words, bits) \
|
||||
do { \
|
||||
int ii \
|
||||
int ii; \
|
||||
fprintf(stderr, name "=0x"); \
|
||||
for (ii = words - 1; ii >= 0; ii--) \
|
||||
fprintf(stderr, SP_PRINT_FMT, (var)[ii]); \
|
||||
|
@@ -12340,9 +12340,6 @@ int sp_read_unsigned_bin(sp_int* a, const byte* in, word32 inSz)
|
||||
return err;
|
||||
}
|
||||
|
||||
#if (!defined(NO_DH) || defined(HAVE_ECC) || defined(WC_RSA_BLINDING) || \
|
||||
defined(WOLFSSL_RSA_PUBLIC_ONLY)) && (!defined(WOLFSSL_RSA_VERIFY_ONLY) || \
|
||||
defined(HAVE_ECC_KEY_EXPORT))
|
||||
/* Convert the multi-precision number to an array of bytes in big-endian format.
|
||||
*
|
||||
* The array must be large enough for encoded number - use mp_unsigned_bin_size
|
||||
@@ -12358,8 +12355,6 @@ int sp_to_unsigned_bin(sp_int* a, byte* out)
|
||||
{
|
||||
return sp_to_unsigned_bin_len(a, out, sp_unsigned_bin_size(a));
|
||||
}
|
||||
#endif /* (!NO_DH || HAVE_ECC || WC_RSA_BLINDING || WOLFSSL_RSA_PUBLIC_ONLY)
|
||||
&& !WOLFSSL_RSA_VERIFY_ONLY */
|
||||
|
||||
/* Convert the multi-precision number to an array of bytes in big-endian format.
|
||||
*
|
||||
|
@@ -50,7 +50,7 @@
|
||||
#ifdef WOLFSSL_SP_X86_64_ASM
|
||||
#define SP_PRINT_NUM(var, name, total, words, bits) \
|
||||
do { \
|
||||
int ii \
|
||||
int ii; \
|
||||
fprintf(stderr, name "=0x"); \
|
||||
for (ii = words - 1; ii >= 0; ii--) \
|
||||
fprintf(stderr, SP_PRINT_FMT, (var)[ii]); \
|
||||
|
Reference in New Issue
Block a user