libmp: fix mptov unwanted overflow when shifting

Change-Id: Ia7e970210d9d3b31948b37ee9d2ca6ec6a4a52a8
This commit is contained in:
Neven Sajko 2020-01-04 03:02:45 +00:00
parent 1fd98d37f5
commit dd59d6bdc2

View file

@ -62,7 +62,7 @@ mptov(mpint *b)
v = 0ULL;
for(s = 0; s < b->top; s++)
v |= b->p[s]<<(s*sizeof(mpdigit)*8);
v |= (uvlong)b->p[s]<<(s*sizeof(mpdigit)*8);
if(b->sign > 0){
if(v > MAXVLONG)