Skip to content

Commit b7b6752

Browse files
authored
Merge pull request #7333 from gojimmypi/PR-tfm-mp_sqr
Enable TFM mp_sqr even when HAVE_ECC disabled
2 parents 5dff8aa + bebfb12 commit b7b6752

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

wolfcrypt/src/tfm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6092,14 +6092,14 @@ int mp_montgomery_setup(fp_int *a, fp_digit *rho)
60926092

60936093
#endif /* HAVE_ECC || (!NO_RSA && WC_RSA_BLINDING) */
60946094

6095-
#ifdef HAVE_ECC
6096-
60976095
/* fast math conversion */
60986096
int mp_sqr(fp_int *A, fp_int *B)
60996097
{
61006098
return fp_sqr(A, B);
61016099
}
61026100

6101+
#ifdef HAVE_ECC
6102+
61036103
/* fast math conversion */
61046104
int mp_div_2(fp_int * a, fp_int * b)
61056105
{

wolfssl/wolfcrypt/tfm.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -877,8 +877,9 @@ MP_API int mp_radix_size (mp_int * a, int radix, int *size);
877877
MP_API int mp_montgomery_reduce(fp_int *a, fp_int *m, fp_digit mp);
878878
MP_API int mp_montgomery_reduce_ex(fp_int *a, fp_int *m, fp_digit mp, int ct);
879879
MP_API int mp_montgomery_setup(fp_int *a, fp_digit *rho);
880+
MP_API int mp_sqr(fp_int *a, fp_int *b);
881+
880882
#ifdef HAVE_ECC
881-
MP_API int mp_sqr(fp_int *a, fp_int *b);
882883
MP_API int mp_div_2(fp_int * a, fp_int * b);
883884
MP_API int mp_div_2_mod_ct(mp_int *a, mp_int *b, mp_int *c);
884885
#endif

0 commit comments

Comments
 (0)