improve mp_lshd

This fixes #61
This commit is contained in:
Steffen Jaeckel 2017-08-29 23:53:02 +02:00
parent 1d03522625
commit 356084ee31

View File

@ -24,6 +24,10 @@ int mp_lshd(mp_int *a, int b)
if (b <= 0) {
return MP_OKAY;
}
/* no need to shift 0 around */
if (mp_iszero(a) == MP_YES) {
return MP_OKAY;
}
/* grow to fit the new digits */
if (a->alloc < (a->used + b)) {