SP: macros for variables that may be allocated

Add macros to make the code simpler around allocating from dynamic
memory when WOLFSSL_SP_SMALL_STACK is defined.
Change over to using macros where it makes sense.
This commit is contained in:
Sean Parkinson
2025-10-09 22:03:32 +10:00
parent 3f460b40bc
commit fac53abc14
9 changed files with 4629 additions and 20479 deletions
+565 -2381
View File
File diff suppressed because it is too large Load Diff
+555 -2308
View File
File diff suppressed because it is too large Load Diff
+565 -2381
View File
File diff suppressed because it is too large Load Diff
+789 -3848
View File
File diff suppressed because it is too large Load Diff
+853 -4254
View File
File diff suppressed because it is too large Load Diff
+565 -2381
View File
File diff suppressed because it is too large Load Diff
+720 -2909
View File
File diff suppressed because it is too large Load Diff
+16 -16
View File
@@ -58952,10 +58952,10 @@ L_256_mod_inv_4_store_end:
.section __DATA,__data
#endif /* __APPLE__ */
L_sp256_mod_inv_avx2_4_order:
.long 0x632551,0x1e84f3b,0x3bce6fa,0x3ffffff
.long 0x3ff0000,0x0,0x0,0x0
.long 0x272b0bf,0x2b69c5e,0x3ffffff,0x3ff
.long 0x3fffff,0x0,0x0,0x0
.long 0x00632551,0x01e84f3b,0x03bce6fa,0x03ffffff
.long 0x03ff0000,0x00000000,0x00000000,0x00000000
.long 0x0272b0bf,0x02b69c5e,0x03ffffff,0x000003ff
.long 0x003fffff,0x00000000,0x00000000,0x00000000
#ifndef __APPLE__
.data
#else
@@ -58975,48 +58975,48 @@ L_sp256_mod_inv_avx2_4_one:
.section __DATA,__data
#endif /* __APPLE__ */
L_sp256_mod_inv_avx2_4_all_one:
.long 0x1,0x1,0x1,0x1
.long 0x1,0x1,0x1,0x1
.long 0x00000001,0x00000001,0x00000001,0x00000001
.long 0x00000001,0x00000001,0x00000001,0x00000001
#ifndef __APPLE__
.data
#else
.section __DATA,__data
#endif /* __APPLE__ */
L_sp256_mod_inv_avx2_4_mask01111:
.long 0x0,0x1,0x1,0x1
.long 0x1,0x0,0x0,0x0
.long 0x00000000,0x00000001,0x00000001,0x00000001
.long 0x00000001,0x00000000,0x00000000,0x00000000
#ifndef __APPLE__
.data
#else
.section __DATA,__data
#endif /* __APPLE__ */
L_sp256_mod_inv_avx2_4_down_one_dword:
.long 0x1,0x2,0x3,0x4
.long 0x5,0x6,0x7,0x7
.long 0x00000001,0x00000002,0x00000003,0x00000004
.long 0x00000005,0x00000006,0x00000007,0x00000007
#ifndef __APPLE__
.data
#else
.section __DATA,__data
#endif /* __APPLE__ */
L_sp256_mod_inv_avx2_4_neg:
.long 0x0,0x0,0x0,0x0
.long 0x80000000,0x0,0x0,0x0
.long 0x00000000,0x00000000,0x00000000,0x00000000
.long 0x80000000,0x00000000,0x00000000,0x00000000
#ifndef __APPLE__
.data
#else
.section __DATA,__data
#endif /* __APPLE__ */
L_sp256_mod_inv_avx2_4_up_one_dword:
.long 0x7,0x0,0x1,0x2
.long 0x3,0x7,0x7,0x7
.long 0x00000007,0x00000000,0x00000001,0x00000002
.long 0x00000003,0x00000007,0x00000007,0x00000007
#ifndef __APPLE__
.data
#else
.section __DATA,__data
#endif /* __APPLE__ */
L_sp256_mod_inv_avx2_4_mask26:
.long 0x3ffffff,0x3ffffff,0x3ffffff,0x3ffffff
.long 0x3ffffff,0x0,0x0,0x0
.long 0x03ffffff,0x03ffffff,0x03ffffff,0x03ffffff
.long 0x03ffffff,0x00000000,0x00000000,0x00000000
/* Non-constant time modular inversion.
*
* @param [out] r Resulting number.
+1 -1
View File
@@ -1,6 +1,6 @@
; /* sp_x86_64_asm.asm */
; /*
; * Copyright (C) 2006-2025 wolfSSL Inc.
; * Copyright (C) 2006-2025 wolfSSL Inc.
; *
; * This file is part of wolfSSL.
; *