| 3198 | } |
| 3199 | |
| 3200 | void Integer::Randomize(RandomNumberGenerator &rng, size_t nbits) |
| 3201 | { |
| 3202 | const size_t nbytes = nbits/8 + 1; |
| 3203 | SecByteBlock buf(nbytes); |
| 3204 | rng.GenerateBlock(buf, nbytes); |
| 3205 | if (nbytes) |
| 3206 | buf[0] = (byte)Crop(buf[0], nbits % 8); |
| 3207 | Decode(buf, nbytes, UNSIGNED); |
| 3208 | } |
| 3209 | |
| 3210 | void Integer::Randomize(RandomNumberGenerator &rng, const Integer &min, const Integer &max) |
| 3211 | { |
nothing calls this directly
no test coverage detected