| 1471 | } |
| 1472 | |
| 1473 | void Integer::Randomize(RandomNumberGenerator &rng, unsigned int nbits) |
| 1474 | { |
| 1475 | const unsigned int nbytes = nbits/8 + 1; |
| 1476 | SecByteBlock buf(nbytes); |
| 1477 | rng.GetBlock(buf, nbytes); |
| 1478 | buf[(unsigned int)0] = (byte)Crop(buf[(unsigned int)0], nbits % 8); |
| 1479 | Decode(buf, nbytes, UNSIGNED); |
| 1480 | } |
| 1481 | |
| 1482 | void Integer::Randomize(RandomNumberGenerator &rng, const Integer &min, const Integer &max) |
| 1483 | { |
no test coverage detected