Skip to content

Commit 2c7eb9b

Browse files
committed
fix macro protection for sp_*_cond_add_* in ARM SP asm to prevent unused function warning when used with RSA_LOW_MEM
1 parent c413165 commit 2c7eb9b

4 files changed

Lines changed: 27 additions & 0 deletions

File tree

wolfcrypt/src/sp_arm32.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17706,6 +17706,7 @@ int sp_RsaPublic_2048(const byte* in, word32 inLen, const mp_int* em,
1770617706
}
1770717707

1770817708
#ifndef WOLFSSL_RSA_PUBLIC_ONLY
17709+
#if !defined(SP_RSA_PRIVATE_EXP_D) && !defined(RSA_LOW_MEM)
1770917710
#ifdef WOLFSSL_SP_SMALL
1771017711
/* Conditionally add a and b using the mask m.
1771117712
* m is -1 to add and 0 when not.
@@ -17911,6 +17912,7 @@ WC_OMIT_FRAME_POINTER static sp_digit sp_2048_cond_add_32(sp_digit* r,
1791117912
}
1791217913

1791317914
#endif /* WOLFSSL_SP_SMALL */
17915+
#endif /* !SP_RSA_PRIVATE_EXP_D && !RSA_LOW_MEM */
1791417916
/* RSA private key operation.
1791517917
*
1791617918
* in Array of bytes representing the number to exponentiate, base.
@@ -45428,6 +45430,7 @@ int sp_RsaPublic_3072(const byte* in, word32 inLen, const mp_int* em,
4542845430
}
4542945431

4543045432
#ifndef WOLFSSL_RSA_PUBLIC_ONLY
45433+
#if !defined(SP_RSA_PRIVATE_EXP_D) && !defined(RSA_LOW_MEM)
4543145434
#ifdef WOLFSSL_SP_SMALL
4543245435
/* Conditionally add a and b using the mask m.
4543345436
* m is -1 to add and 0 when not.
@@ -45689,6 +45692,7 @@ WC_OMIT_FRAME_POINTER static sp_digit sp_3072_cond_add_48(sp_digit* r,
4568945692
}
4569045693

4569145694
#endif /* WOLFSSL_SP_SMALL */
45695+
#endif /* !SP_RSA_PRIVATE_EXP_D && !RSA_LOW_MEM */
4569245696
/* RSA private key operation.
4569345697
*
4569445698
* in Array of bytes representing the number to exponentiate, base.
@@ -61034,6 +61038,7 @@ int sp_RsaPublic_4096(const byte* in, word32 inLen, const mp_int* em,
6103461038
}
6103561039

6103661040
#ifndef WOLFSSL_RSA_PUBLIC_ONLY
61041+
#if !defined(SP_RSA_PRIVATE_EXP_D) && !defined(RSA_LOW_MEM)
6103761042
#ifdef WOLFSSL_SP_SMALL
6103861043
/* Conditionally add a and b using the mask m.
6103961044
* m is -1 to add and 0 when not.
@@ -61351,6 +61356,7 @@ WC_OMIT_FRAME_POINTER static sp_digit sp_4096_cond_add_64(sp_digit* r,
6135161356
}
6135261357

6135361358
#endif /* WOLFSSL_SP_SMALL */
61359+
#endif /* !SP_RSA_PRIVATE_EXP_D && !RSA_LOW_MEM */
6135461360
/* RSA private key operation.
6135561361
*
6135661362
* in Array of bytes representing the number to exponentiate, base.

wolfcrypt/src/sp_arm64.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6140,6 +6140,7 @@ int sp_RsaPublic_2048(const byte* in, word32 inLen, const mp_int* em,
61406140
}
61416141

61426142
#ifndef WOLFSSL_RSA_PUBLIC_ONLY
6143+
#if !defined(SP_RSA_PRIVATE_EXP_D) && !defined(RSA_LOW_MEM)
61436144
#ifdef WOLFSSL_SP_SMALL
61446145
/* Conditionally add a and b using the mask m.
61456146
* m is -1 to add and 0 when not.
@@ -6175,7 +6176,9 @@ static sp_digit sp_2048_cond_add_16(sp_digit* r, const sp_digit* a, const sp_dig
61756176
return c;
61766177
}
61776178
#endif /* WOLFSSL_SP_SMALL */
6179+
#endif /* !SP_RSA_PRIVATE_EXP_D && !RSA_LOW_MEM */
61786180

6181+
#endif /* !SP_RSA_PRIVATE_EXP_D && !RSA_LOW_MEM */
61796182
/* RSA private key operation.
61806183
*
61816184
* in Array of bytes representing the number to exponentiate, base.
@@ -15515,6 +15518,7 @@ int sp_RsaPublic_3072(const byte* in, word32 inLen, const mp_int* em,
1551515518
}
1551615519

1551715520
#ifndef WOLFSSL_RSA_PUBLIC_ONLY
15521+
#if !defined(SP_RSA_PRIVATE_EXP_D) && !defined(RSA_LOW_MEM)
1551815522
#ifdef WOLFSSL_SP_SMALL
1551915523
/* Conditionally add a and b using the mask m.
1552015524
* m is -1 to add and 0 when not.
@@ -15550,7 +15554,9 @@ static sp_digit sp_3072_cond_add_24(sp_digit* r, const sp_digit* a, const sp_dig
1555015554
return c;
1555115555
}
1555215556
#endif /* WOLFSSL_SP_SMALL */
15557+
#endif /* !SP_RSA_PRIVATE_EXP_D && !RSA_LOW_MEM */
1555315558

15559+
#endif /* !SP_RSA_PRIVATE_EXP_D && !RSA_LOW_MEM */
1555415560
/* RSA private key operation.
1555515561
*
1555615562
* in Array of bytes representing the number to exponentiate, base.
@@ -20524,6 +20530,7 @@ int sp_RsaPublic_4096(const byte* in, word32 inLen, const mp_int* em,
2052420530
}
2052520531

2052620532
#ifndef WOLFSSL_RSA_PUBLIC_ONLY
20533+
#if !defined(SP_RSA_PRIVATE_EXP_D) && !defined(RSA_LOW_MEM)
2052720534
#ifdef WOLFSSL_SP_SMALL
2052820535
/* Conditionally add a and b using the mask m.
2052920536
* m is -1 to add and 0 when not.
@@ -20559,7 +20566,9 @@ static sp_digit sp_4096_cond_add_32(sp_digit* r, const sp_digit* a, const sp_dig
2055920566
return c;
2056020567
}
2056120568
#endif /* WOLFSSL_SP_SMALL */
20569+
#endif /* !SP_RSA_PRIVATE_EXP_D && !RSA_LOW_MEM */
2056220570

20571+
#endif /* !SP_RSA_PRIVATE_EXP_D && !RSA_LOW_MEM */
2056320572
/* RSA private key operation.
2056420573
*
2056520574
* in Array of bytes representing the number to exponentiate, base.

wolfcrypt/src/sp_armthumb.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28024,6 +28024,7 @@ int sp_RsaPublic_2048(const byte* in, word32 inLen, const mp_int* em,
2802428024
}
2802528025

2802628026
#ifndef WOLFSSL_RSA_PUBLIC_ONLY
28027+
#if !defined(SP_RSA_PRIVATE_EXP_D) && !defined(RSA_LOW_MEM)
2802728028
/* Conditionally add a and b using the mask m.
2802828029
* m is -1 to add and 0 when not.
2802928030
*
@@ -28093,6 +28094,7 @@ SP_NOINLINE static sp_digit sp_2048_cond_add_32(sp_digit* r, const sp_digit* a,
2809328094
return (word32)(size_t)r;
2809428095
}
2809528096

28097+
#endif /* !SP_RSA_PRIVATE_EXP_D && !RSA_LOW_MEM */
2809628098
/* RSA private key operation.
2809728099
*
2809828100
* in Array of bytes representing the number to exponentiate, base.
@@ -80194,6 +80196,7 @@ int sp_RsaPublic_3072(const byte* in, word32 inLen, const mp_int* em,
8019480196
}
8019580197

8019680198
#ifndef WOLFSSL_RSA_PUBLIC_ONLY
80199+
#if !defined(SP_RSA_PRIVATE_EXP_D) && !defined(RSA_LOW_MEM)
8019780200
/* Conditionally add a and b using the mask m.
8019880201
* m is -1 to add and 0 when not.
8019980202
*
@@ -80263,6 +80266,7 @@ SP_NOINLINE static sp_digit sp_3072_cond_add_48(sp_digit* r, const sp_digit* a,
8026380266
return (word32)(size_t)r;
8026480267
}
8026580268

80269+
#endif /* !SP_RSA_PRIVATE_EXP_D && !RSA_LOW_MEM */
8026680270
/* RSA private key operation.
8026780271
*
8026880272
* in Array of bytes representing the number to exponentiate, base.
@@ -92650,6 +92654,7 @@ int sp_RsaPublic_4096(const byte* in, word32 inLen, const mp_int* em,
9265092654
}
9265192655

9265292656
#ifndef WOLFSSL_RSA_PUBLIC_ONLY
92657+
#if !defined(SP_RSA_PRIVATE_EXP_D) && !defined(RSA_LOW_MEM)
9265392658
/* Conditionally add a and b using the mask m.
9265492659
* m is -1 to add and 0 when not.
9265592660
*
@@ -92724,6 +92729,7 @@ SP_NOINLINE static sp_digit sp_4096_cond_add_64(sp_digit* r, const sp_digit* a,
9272492729
return (word32)(size_t)r;
9272592730
}
9272692731

92732+
#endif /* !SP_RSA_PRIVATE_EXP_D && !RSA_LOW_MEM */
9272792733
/* RSA private key operation.
9272892734
*
9272992735
* in Array of bytes representing the number to exponentiate, base.

wolfcrypt/src/sp_cortexm.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8884,6 +8884,7 @@ int sp_RsaPublic_2048(const byte* in, word32 inLen, const mp_int* em,
88848884
}
88858885

88868886
#ifndef WOLFSSL_RSA_PUBLIC_ONLY
8887+
#if !defined(SP_RSA_PRIVATE_EXP_D) && !defined(RSA_LOW_MEM)
88878888
#ifdef WOLFSSL_SP_SMALL
88888889
/* Conditionally add a and b using the mask m.
88898890
* m is -1 to add and 0 when not.
@@ -9089,6 +9090,7 @@ WC_OMIT_FRAME_POINTER static sp_digit sp_2048_cond_add_32(sp_digit* r,
90899090
}
90909091

90919092
#endif /* WOLFSSL_SP_SMALL */
9093+
#endif /* !SP_RSA_PRIVATE_EXP_D && !RSA_LOW_MEM */
90929094
/* RSA private key operation.
90939095
*
90949096
* in Array of bytes representing the number to exponentiate, base.
@@ -21488,6 +21490,7 @@ int sp_RsaPublic_3072(const byte* in, word32 inLen, const mp_int* em,
2148821490
}
2148921491

2149021492
#ifndef WOLFSSL_RSA_PUBLIC_ONLY
21493+
#if !defined(SP_RSA_PRIVATE_EXP_D) && !defined(RSA_LOW_MEM)
2149121494
#ifdef WOLFSSL_SP_SMALL
2149221495
/* Conditionally add a and b using the mask m.
2149321496
* m is -1 to add and 0 when not.
@@ -21749,6 +21752,7 @@ WC_OMIT_FRAME_POINTER static sp_digit sp_3072_cond_add_48(sp_digit* r,
2174921752
}
2175021753

2175121754
#endif /* WOLFSSL_SP_SMALL */
21755+
#endif /* !SP_RSA_PRIVATE_EXP_D && !RSA_LOW_MEM */
2175221756
/* RSA private key operation.
2175321757
*
2175421758
* in Array of bytes representing the number to exponentiate, base.
@@ -29835,6 +29839,7 @@ int sp_RsaPublic_4096(const byte* in, word32 inLen, const mp_int* em,
2983529839
}
2983629840

2983729841
#ifndef WOLFSSL_RSA_PUBLIC_ONLY
29842+
#if !defined(SP_RSA_PRIVATE_EXP_D) && !defined(RSA_LOW_MEM)
2983829843
#ifdef WOLFSSL_SP_SMALL
2983929844
/* Conditionally add a and b using the mask m.
2984029845
* m is -1 to add and 0 when not.
@@ -30152,6 +30157,7 @@ WC_OMIT_FRAME_POINTER static sp_digit sp_4096_cond_add_64(sp_digit* r,
3015230157
}
3015330158

3015430159
#endif /* WOLFSSL_SP_SMALL */
30160+
#endif /* !SP_RSA_PRIVATE_EXP_D && !RSA_LOW_MEM */
3015530161
/* RSA private key operation.
3015630162
*
3015730163
* in Array of bytes representing the number to exponentiate, base.

0 commit comments

Comments
 (0)