Use unsigned integers in mp_is_bit_set
ZD 12012
This commit is contained in:
parent
95b91d8913
commit
2ecaa3c4c6
@ -1446,10 +1446,10 @@ int mp_set (mp_int * a, mp_digit b)
|
||||
/* check if a bit is set */
|
||||
int mp_is_bit_set (mp_int *a, mp_digit b)
|
||||
{
|
||||
int i = (int)(b / DIGIT_BIT); /* word index */
|
||||
int s = b % DIGIT_BIT; /* bit index */
|
||||
mp_digit i = b / DIGIT_BIT; /* word 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 */
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user