diff --git a/sys/src/libmp/port/mpnrand.c b/sys/src/libmp/port/mpnrand.c index 34ca63a2f..600283d9d 100644 --- a/sys/src/libmp/port/mpnrand.c +++ b/sys/src/libmp/port/mpnrand.c @@ -13,16 +13,11 @@ mpnrand(mpint *n, void (*gen)(uchar*, int), mpint *b) /* m = 2^bits - 1 */ bits = mpsignif(n); m = mpnew(bits+1); - if(m == nil) - sysfatal("mpnrand: %r"); mpleft(mpone, bits, m); mpsub(m, mpone, m); - if(b == nil){ + if(b == nil) b = mpnew(bits); - if(b == nil) - sysfatal("mpnrand: %r"); - } /* m = m - (m % n) */ mpmod(m, n, b);