Template Function lbcrypto::RNG(const IntType&)

Function Documentation

template<typename IntType>
static IntType lbcrypto::RNG(const IntType &modulus)

Generates a uniformly random integer in [0, modulus) by drawing 32-bit chunks from the global PRNG and rejecting draws that are not below the modulus.

Parameters

modulus – the exclusive upper bound

Returns

a uniformly random integer below modulus