mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 18:57:27 +02:00
Merge pull request #3932 from guidovranken/zd12012
MP integer.c: Use unsigned integers in mp_is_bit_set
This commit is contained in:
@ -1446,10 +1446,10 @@ int mp_set (mp_int * a, mp_digit b)
|
|||||||
/* check if a bit is set */
|
/* check if a bit is set */
|
||||||
int mp_is_bit_set (mp_int *a, mp_digit b)
|
int mp_is_bit_set (mp_int *a, mp_digit b)
|
||||||
{
|
{
|
||||||
int i = (int)(b / DIGIT_BIT); /* word index */
|
mp_digit i = b / DIGIT_BIT; /* word index */
|
||||||
int s = b % DIGIT_BIT; /* bit index */
|
mp_digit s = b % DIGIT_BIT; /* bit index */
|
||||||
|
|
||||||
if (a->used <= i) {
|
if ((mp_digit)a->used <= i) {
|
||||||
/* no words avaialable at that bit count */
|
/* no words avaialable at that bit count */
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user