wolfcrypt/src/integer.c and wolfssl/wolfcrypt/integer.h: constify args to mp_cmp() and mp_cmp_mag().

This commit is contained in:
Daniel Pouzzner
2026-04-01 16:32:15 -05:00
parent faf2ff26de
commit 4228bedbcf
2 changed files with 5 additions and 5 deletions
+3 -3
View File
@@ -1392,10 +1392,10 @@ LBL_ERR:mp_clear(&x);
/* compare magnitude of two ints (unsigned) */
int mp_cmp_mag (mp_int * a, mp_int * b)
int mp_cmp_mag (const mp_int * a, const mp_int * b)
{
int n;
mp_digit *tmpa, *tmpb;
const mp_digit *tmpa, *tmpb;
/* compare based on # of non-zero digits */
if (a->used > b->used) {
@@ -1430,7 +1430,7 @@ int mp_cmp_mag (mp_int * a, mp_int * b)
/* compare two ints (signed)*/
int mp_cmp (mp_int * a, mp_int * b)
int mp_cmp (const mp_int * a, const mp_int * b)
{
/* compare based on sign */
if (a->sign != b->sign) {
+2 -2
View File
@@ -345,8 +345,8 @@ MP_API int mp_abs (mp_int * a, mp_int * b);
MP_API int mp_invmod (mp_int * a, mp_int * b, mp_int * c);
int fast_mp_invmod (mp_int * a, mp_int * b, mp_int * c);
MP_API int mp_invmod_slow (mp_int * a, mp_int * b, mp_int * c);
MP_API int mp_cmp_mag (mp_int * a, mp_int * b);
MP_API int mp_cmp (mp_int * a, mp_int * b);
MP_API int mp_cmp_mag (const mp_int * a, const mp_int * b);
MP_API int mp_cmp (const mp_int * a, const mp_int * b);
#define mp_cmp_ct(a, b, n) mp_cmp(a, b)
MP_API int mp_cmp_d(mp_int * a, mp_digit b);
MP_API int mp_set (mp_int * a, mp_digit b);