Skip to content

Commit fac53ab

Browse files
committed
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.
1 parent 3f460b4 commit fac53ab

9 files changed

Lines changed: 4761 additions & 20611 deletions

File tree

wolfcrypt/src/sp_arm32.c

Lines changed: 565 additions & 2381 deletions
Large diffs are not rendered by default.

wolfcrypt/src/sp_arm64.c

Lines changed: 687 additions & 2440 deletions
Large diffs are not rendered by default.

wolfcrypt/src/sp_armthumb.c

Lines changed: 565 additions & 2381 deletions
Large diffs are not rendered by default.

wolfcrypt/src/sp_c32.c

Lines changed: 789 additions & 3848 deletions
Large diffs are not rendered by default.

wolfcrypt/src/sp_c64.c

Lines changed: 853 additions & 4254 deletions
Large diffs are not rendered by default.

wolfcrypt/src/sp_cortexm.c

Lines changed: 565 additions & 2381 deletions
Large diffs are not rendered by default.

wolfcrypt/src/sp_x86_64.c

Lines changed: 720 additions & 2909 deletions
Large diffs are not rendered by default.

wolfcrypt/src/sp_x86_64_asm.S

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -58952,10 +58952,10 @@ L_256_mod_inv_4_store_end:
5895258952
.section __DATA,__data
5895358953
#endif /* __APPLE__ */
5895458954
L_sp256_mod_inv_avx2_4_order:
58955-
.long 0x632551,0x1e84f3b,0x3bce6fa,0x3ffffff
58956-
.long 0x3ff0000,0x0,0x0,0x0
58957-
.long 0x272b0bf,0x2b69c5e,0x3ffffff,0x3ff
58958-
.long 0x3fffff,0x0,0x0,0x0
58955+
.long 0x00632551,0x01e84f3b,0x03bce6fa,0x03ffffff
58956+
.long 0x03ff0000,0x00000000,0x00000000,0x00000000
58957+
.long 0x0272b0bf,0x02b69c5e,0x03ffffff,0x000003ff
58958+
.long 0x003fffff,0x00000000,0x00000000,0x00000000
5895958959
#ifndef __APPLE__
5896058960
.data
5896158961
#else
@@ -58975,48 +58975,48 @@ L_sp256_mod_inv_avx2_4_one:
5897558975
.section __DATA,__data
5897658976
#endif /* __APPLE__ */
5897758977
L_sp256_mod_inv_avx2_4_all_one:
58978-
.long 0x1,0x1,0x1,0x1
58979-
.long 0x1,0x1,0x1,0x1
58978+
.long 0x00000001,0x00000001,0x00000001,0x00000001
58979+
.long 0x00000001,0x00000001,0x00000001,0x00000001
5898058980
#ifndef __APPLE__
5898158981
.data
5898258982
#else
5898358983
.section __DATA,__data
5898458984
#endif /* __APPLE__ */
5898558985
L_sp256_mod_inv_avx2_4_mask01111:
58986-
.long 0x0,0x1,0x1,0x1
58987-
.long 0x1,0x0,0x0,0x0
58986+
.long 0x00000000,0x00000001,0x00000001,0x00000001
58987+
.long 0x00000001,0x00000000,0x00000000,0x00000000
5898858988
#ifndef __APPLE__
5898958989
.data
5899058990
#else
5899158991
.section __DATA,__data
5899258992
#endif /* __APPLE__ */
5899358993
L_sp256_mod_inv_avx2_4_down_one_dword:
58994-
.long 0x1,0x2,0x3,0x4
58995-
.long 0x5,0x6,0x7,0x7
58994+
.long 0x00000001,0x00000002,0x00000003,0x00000004
58995+
.long 0x00000005,0x00000006,0x00000007,0x00000007
5899658996
#ifndef __APPLE__
5899758997
.data
5899858998
#else
5899958999
.section __DATA,__data
5900059000
#endif /* __APPLE__ */
5900159001
L_sp256_mod_inv_avx2_4_neg:
59002-
.long 0x0,0x0,0x0,0x0
59003-
.long 0x80000000,0x0,0x0,0x0
59002+
.long 0x00000000,0x00000000,0x00000000,0x00000000
59003+
.long 0x80000000,0x00000000,0x00000000,0x00000000
5900459004
#ifndef __APPLE__
5900559005
.data
5900659006
#else
5900759007
.section __DATA,__data
5900859008
#endif /* __APPLE__ */
5900959009
L_sp256_mod_inv_avx2_4_up_one_dword:
59010-
.long 0x7,0x0,0x1,0x2
59011-
.long 0x3,0x7,0x7,0x7
59010+
.long 0x00000007,0x00000000,0x00000001,0x00000002
59011+
.long 0x00000003,0x00000007,0x00000007,0x00000007
5901259012
#ifndef __APPLE__
5901359013
.data
5901459014
#else
5901559015
.section __DATA,__data
5901659016
#endif /* __APPLE__ */
5901759017
L_sp256_mod_inv_avx2_4_mask26:
59018-
.long 0x3ffffff,0x3ffffff,0x3ffffff,0x3ffffff
59019-
.long 0x3ffffff,0x0,0x0,0x0
59018+
.long 0x03ffffff,0x03ffffff,0x03ffffff,0x03ffffff
59019+
.long 0x03ffffff,0x00000000,0x00000000,0x00000000
5902059020
/* Non-constant time modular inversion.
5902159021
*
5902259022
* @param [out] r Resulting number.

wolfcrypt/src/sp_x86_64_asm.asm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; /* sp_x86_64_asm.asm */
22
; /*
3-
; * Copyright (C) 2006-2025 wolfSSL Inc.
3+
; * Copyright (C) 2006-2025 wolfSSL Inc.
44
; *
55
; * This file is part of wolfSSL.
66
; *

0 commit comments

Comments
 (0)