forked from wolfSSL/wolfssl
sp_int: When setting digit of 0, set used to 0
This commit is contained in:
@ -420,8 +420,14 @@ int sp_init_copy (sp_int * a, sp_int * b)
|
|||||||
*/
|
*/
|
||||||
int sp_set(sp_int* a, sp_int_digit d)
|
int sp_set(sp_int* a, sp_int_digit d)
|
||||||
{
|
{
|
||||||
a->dp[0] = d;
|
if (d == 0) {
|
||||||
a->used = 1;
|
a->dp[0] = d;
|
||||||
|
a->used = 0;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
a->dp[0] = d;
|
||||||
|
a->used = 1;
|
||||||
|
}
|
||||||
return MP_OKAY;
|
return MP_OKAY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user