diff --git a/wolfcrypt/src/integer.c b/wolfcrypt/src/integer.c index 75e7ca7b0d..91e457cdee 100644 --- a/wolfcrypt/src/integer.c +++ b/wolfcrypt/src/integer.c @@ -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) { diff --git a/wolfssl/wolfcrypt/integer.h b/wolfssl/wolfcrypt/integer.h index 6dd4baea04..7e4792a6d5 100644 --- a/wolfssl/wolfcrypt/integer.h +++ b/wolfssl/wolfcrypt/integer.h @@ -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);