Skip to content

Commit b156e83

Browse files
authored
Merge pull request #6711 from bandi13/mp_sqrtmod_prime-static
Set mp_sqrtmod_prime as static
2 parents cc4e327 + c917eee commit b156e83

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

wolfcrypt/src/ecc.c

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1341,8 +1341,16 @@ static int _ecc_pairwise_consistency_test(ecc_key* key, WC_RNG* rng);
13411341
#endif
13421342

13431343

1344-
int mp_jacobi(mp_int* a, mp_int* n, int* c);
1345-
int mp_sqrtmod_prime(mp_int* n, mp_int* prime, mp_int* ret);
1344+
#ifdef HAVE_COMP_KEY
1345+
#if !defined(WOLFSSL_ATECC508A) && !defined(WOLFSSL_ATECC608A) && \
1346+
!defined(WOLFSSL_CRYPTOCELL)
1347+
1348+
#ifndef WOLFSSL_SP_MATH
1349+
static int mp_jacobi(mp_int* a, mp_int* n, int* c);
1350+
static int mp_sqrtmod_prime(mp_int* n, mp_int* prime, mp_int* ret);
1351+
#endif
1352+
#endif
1353+
#endif
13461354

13471355

13481356
/* Curve Specs */
@@ -14428,7 +14436,7 @@ int wc_ecc_decrypt(ecc_key* privKey, ecc_key* pubKey, const byte* msg,
1442814436
#ifndef WOLFSSL_SP_MATH
1442914437
/* computes the jacobi c = (a | n) (or Legendre if n is prime)
1443014438
*/
14431-
int mp_jacobi(mp_int* a, mp_int* n, int* c)
14439+
static int mp_jacobi(mp_int* a, mp_int* n, int* c)
1443214440
{
1443314441
#ifdef WOLFSSL_SMALL_STACK
1443414442
mp_int* a1 = NULL;
@@ -14552,7 +14560,7 @@ int mp_jacobi(mp_int* a, mp_int* n, int* c)
1455214560
* The result is returned in the third argument x
1455314561
* the function returns MP_OKAY on success, MP_VAL or another error on failure
1455414562
*/
14555-
int mp_sqrtmod_prime(mp_int* n, mp_int* prime, mp_int* ret)
14563+
static int mp_sqrtmod_prime(mp_int* n, mp_int* prime, mp_int* ret)
1455614564
{
1455714565
#ifdef SQRTMOD_USE_MOD_EXP
1455814566
int res;

0 commit comments

Comments
 (0)