simplify calculation

This commit is contained in:
Steffen Jaeckel 2017-10-28 00:22:01 +02:00
parent b7e35e9f57
commit f5e5c6eed7

View File

@ -43,7 +43,7 @@ int rng_make_prng(int bits, int wprng, prng_state *prng,
return err;
}
bits = ((bits/8)+((bits&7)!=0?1:0)) * 2;
bits = ((bits+7)/8) * 2;
if (rng_get_bytes(buf, (unsigned long)bits, callback) != (unsigned long)bits) {
return CRYPT_ERROR_READPRNG;
}