fix macro protection for sp_*_cond_add_* in ARM SP asm to prevent unused function warning when used with RSA_LOW_MEM

This commit is contained in:
Brett Nicholas
2026-02-13 14:29:59 -07:00
parent c4131659cc
commit 2c7eb9bc12
4 changed files with 27 additions and 0 deletions
+6
View File
@@ -17706,6 +17706,7 @@ int sp_RsaPublic_2048(const byte* in, word32 inLen, const mp_int* em,
}
#ifndef WOLFSSL_RSA_PUBLIC_ONLY
#if !defined(SP_RSA_PRIVATE_EXP_D) && !defined(RSA_LOW_MEM)
#ifdef WOLFSSL_SP_SMALL
/* Conditionally add a and b using the mask m.
* 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,
}
#endif /* WOLFSSL_SP_SMALL */
#endif /* !SP_RSA_PRIVATE_EXP_D && !RSA_LOW_MEM */
/* RSA private key operation.
*
* 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,
}
#ifndef WOLFSSL_RSA_PUBLIC_ONLY
#if !defined(SP_RSA_PRIVATE_EXP_D) && !defined(RSA_LOW_MEM)
#ifdef WOLFSSL_SP_SMALL
/* Conditionally add a and b using the mask m.
* 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,
}
#endif /* WOLFSSL_SP_SMALL */
#endif /* !SP_RSA_PRIVATE_EXP_D && !RSA_LOW_MEM */
/* RSA private key operation.
*
* 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,
}
#ifndef WOLFSSL_RSA_PUBLIC_ONLY
#if !defined(SP_RSA_PRIVATE_EXP_D) && !defined(RSA_LOW_MEM)
#ifdef WOLFSSL_SP_SMALL
/* Conditionally add a and b using the mask m.
* 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,
}
#endif /* WOLFSSL_SP_SMALL */
#endif /* !SP_RSA_PRIVATE_EXP_D && !RSA_LOW_MEM */
/* RSA private key operation.
*
* in Array of bytes representing the number to exponentiate, base.
+9
View File
@@ -6140,6 +6140,7 @@ int sp_RsaPublic_2048(const byte* in, word32 inLen, const mp_int* em,
}
#ifndef WOLFSSL_RSA_PUBLIC_ONLY
#if !defined(SP_RSA_PRIVATE_EXP_D) && !defined(RSA_LOW_MEM)
#ifdef WOLFSSL_SP_SMALL
/* Conditionally add a and b using the mask m.
* 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
return c;
}
#endif /* WOLFSSL_SP_SMALL */
#endif /* !SP_RSA_PRIVATE_EXP_D && !RSA_LOW_MEM */
#endif /* !SP_RSA_PRIVATE_EXP_D && !RSA_LOW_MEM */
/* RSA private key operation.
*
* 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,
}
#ifndef WOLFSSL_RSA_PUBLIC_ONLY
#if !defined(SP_RSA_PRIVATE_EXP_D) && !defined(RSA_LOW_MEM)
#ifdef WOLFSSL_SP_SMALL
/* Conditionally add a and b using the mask m.
* 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
return c;
}
#endif /* WOLFSSL_SP_SMALL */
#endif /* !SP_RSA_PRIVATE_EXP_D && !RSA_LOW_MEM */
#endif /* !SP_RSA_PRIVATE_EXP_D && !RSA_LOW_MEM */
/* RSA private key operation.
*
* 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,
}
#ifndef WOLFSSL_RSA_PUBLIC_ONLY
#if !defined(SP_RSA_PRIVATE_EXP_D) && !defined(RSA_LOW_MEM)
#ifdef WOLFSSL_SP_SMALL
/* Conditionally add a and b using the mask m.
* 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
return c;
}
#endif /* WOLFSSL_SP_SMALL */
#endif /* !SP_RSA_PRIVATE_EXP_D && !RSA_LOW_MEM */
#endif /* !SP_RSA_PRIVATE_EXP_D && !RSA_LOW_MEM */
/* RSA private key operation.
*
* in Array of bytes representing the number to exponentiate, base.
+6
View File
@@ -28024,6 +28024,7 @@ int sp_RsaPublic_2048(const byte* in, word32 inLen, const mp_int* em,
}
#ifndef WOLFSSL_RSA_PUBLIC_ONLY
#if !defined(SP_RSA_PRIVATE_EXP_D) && !defined(RSA_LOW_MEM)
/* Conditionally add a and b using the mask m.
* m is -1 to add and 0 when not.
*
@@ -28093,6 +28094,7 @@ SP_NOINLINE static sp_digit sp_2048_cond_add_32(sp_digit* r, const sp_digit* a,
return (word32)(size_t)r;
}
#endif /* !SP_RSA_PRIVATE_EXP_D && !RSA_LOW_MEM */
/* RSA private key operation.
*
* 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,
}
#ifndef WOLFSSL_RSA_PUBLIC_ONLY
#if !defined(SP_RSA_PRIVATE_EXP_D) && !defined(RSA_LOW_MEM)
/* Conditionally add a and b using the mask m.
* m is -1 to add and 0 when not.
*
@@ -80263,6 +80266,7 @@ SP_NOINLINE static sp_digit sp_3072_cond_add_48(sp_digit* r, const sp_digit* a,
return (word32)(size_t)r;
}
#endif /* !SP_RSA_PRIVATE_EXP_D && !RSA_LOW_MEM */
/* RSA private key operation.
*
* 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,
}
#ifndef WOLFSSL_RSA_PUBLIC_ONLY
#if !defined(SP_RSA_PRIVATE_EXP_D) && !defined(RSA_LOW_MEM)
/* Conditionally add a and b using the mask m.
* m is -1 to add and 0 when not.
*
@@ -92724,6 +92729,7 @@ SP_NOINLINE static sp_digit sp_4096_cond_add_64(sp_digit* r, const sp_digit* a,
return (word32)(size_t)r;
}
#endif /* !SP_RSA_PRIVATE_EXP_D && !RSA_LOW_MEM */
/* RSA private key operation.
*
* in Array of bytes representing the number to exponentiate, base.
+6
View File
@@ -8884,6 +8884,7 @@ int sp_RsaPublic_2048(const byte* in, word32 inLen, const mp_int* em,
}
#ifndef WOLFSSL_RSA_PUBLIC_ONLY
#if !defined(SP_RSA_PRIVATE_EXP_D) && !defined(RSA_LOW_MEM)
#ifdef WOLFSSL_SP_SMALL
/* Conditionally add a and b using the mask m.
* 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,
}
#endif /* WOLFSSL_SP_SMALL */
#endif /* !SP_RSA_PRIVATE_EXP_D && !RSA_LOW_MEM */
/* RSA private key operation.
*
* 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,
}
#ifndef WOLFSSL_RSA_PUBLIC_ONLY
#if !defined(SP_RSA_PRIVATE_EXP_D) && !defined(RSA_LOW_MEM)
#ifdef WOLFSSL_SP_SMALL
/* Conditionally add a and b using the mask m.
* 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,
}
#endif /* WOLFSSL_SP_SMALL */
#endif /* !SP_RSA_PRIVATE_EXP_D && !RSA_LOW_MEM */
/* RSA private key operation.
*
* 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,
}
#ifndef WOLFSSL_RSA_PUBLIC_ONLY
#if !defined(SP_RSA_PRIVATE_EXP_D) && !defined(RSA_LOW_MEM)
#ifdef WOLFSSL_SP_SMALL
/* Conditionally add a and b using the mask m.
* 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,
}
#endif /* WOLFSSL_SP_SMALL */
#endif /* !SP_RSA_PRIVATE_EXP_D && !RSA_LOW_MEM */
/* RSA private key operation.
*
* in Array of bytes representing the number to exponentiate, base.