MCPcopy Create free account
hub / github.com/c3d/tao3D / Randomize

Method Randomize

libcryptopp/cryptopp/integer.cpp:3200–3208  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3198}
3199
3200void 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
3210void Integer::Randomize(RandomNumberGenerator &rng, const Integer &min, const Integer &max)
3211{

Callers

nothing calls this directly

Calls 4

CropFunction · 0.85
MakeParametersFunction · 0.85
GenerateBlockMethod · 0.45
BitCountMethod · 0.45

Tested by

no test coverage detected