Skip to content

Commit 49b9764

Browse files
author
Andras Fekete
committed
Can guarantee not to modify arguments of mp_isodd and mp_iszero
1 parent c920337 commit 49b9764

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

wolfcrypt/src/tfm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4884,12 +4884,12 @@ int mp_copy(const fp_int* a, fp_int* b)
48844884
return MP_OKAY;
48854885
}
48864886

4887-
int mp_isodd(mp_int* a)
4887+
int mp_isodd(const mp_int* a)
48884888
{
48894889
return fp_isodd(a);
48904890
}
48914891

4892-
int mp_iszero(mp_int* a)
4892+
int mp_iszero(const mp_int* a)
48934893
{
48944894
return fp_iszero(a);
48954895
}

wolfssl/wolfcrypt/tfm.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -847,8 +847,8 @@ MP_API int mp_to_unsigned_bin_len(mp_int * a, unsigned char *b, int c);
847847

848848
MP_API int mp_sub_d(fp_int *a, fp_digit b, fp_int *c);
849849
MP_API int mp_copy(const fp_int* a, fp_int* b);
850-
MP_API int mp_isodd(mp_int* a);
851-
MP_API int mp_iszero(mp_int* a);
850+
MP_API int mp_isodd(const mp_int* a);
851+
MP_API int mp_iszero(const mp_int* a);
852852
MP_API int mp_count_bits(const mp_int *a);
853853
MP_API int mp_leading_bit(mp_int *a);
854854
MP_API int mp_set_int(mp_int *a, unsigned long b);

0 commit comments

Comments
 (0)