Skip to content

Commit 4228bed

Browse files
committed
wolfcrypt/src/integer.c and wolfssl/wolfcrypt/integer.h: constify args to mp_cmp() and mp_cmp_mag().
1 parent faf2ff2 commit 4228bed

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

wolfcrypt/src/integer.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1392,10 +1392,10 @@ LBL_ERR:mp_clear(&x);
13921392

13931393

13941394
/* compare magnitude of two ints (unsigned) */
1395-
int mp_cmp_mag (mp_int * a, mp_int * b)
1395+
int mp_cmp_mag (const mp_int * a, const mp_int * b)
13961396
{
13971397
int n;
1398-
mp_digit *tmpa, *tmpb;
1398+
const mp_digit *tmpa, *tmpb;
13991399

14001400
/* compare based on # of non-zero digits */
14011401
if (a->used > b->used) {
@@ -1430,7 +1430,7 @@ int mp_cmp_mag (mp_int * a, mp_int * b)
14301430

14311431

14321432
/* compare two ints (signed)*/
1433-
int mp_cmp (mp_int * a, mp_int * b)
1433+
int mp_cmp (const mp_int * a, const mp_int * b)
14341434
{
14351435
/* compare based on sign */
14361436
if (a->sign != b->sign) {

wolfssl/wolfcrypt/integer.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,8 +345,8 @@ MP_API int mp_abs (mp_int * a, mp_int * b);
345345
MP_API int mp_invmod (mp_int * a, mp_int * b, mp_int * c);
346346
int fast_mp_invmod (mp_int * a, mp_int * b, mp_int * c);
347347
MP_API int mp_invmod_slow (mp_int * a, mp_int * b, mp_int * c);
348-
MP_API int mp_cmp_mag (mp_int * a, mp_int * b);
349-
MP_API int mp_cmp (mp_int * a, mp_int * b);
348+
MP_API int mp_cmp_mag (const mp_int * a, const mp_int * b);
349+
MP_API int mp_cmp (const mp_int * a, const mp_int * b);
350350
#define mp_cmp_ct(a, b, n) mp_cmp(a, b)
351351
MP_API int mp_cmp_d(mp_int * a, mp_digit b);
352352
MP_API int mp_set (mp_int * a, mp_digit b);

0 commit comments

Comments
 (0)