Module bigrand

Module bigrand 

Source
Expand description

Randomization of big integers

Structs§

RandomBits
A random distribution for BigUint and BigInt values of a particular bit size.
SMALL_PRIMES_PRODUCT 🔒
The product of the values in SMALL_PRIMES and allows us to reduce a candidate prime by this number and then determine whether it’s coprime to all the elements of SMALL_PRIMES without further BigUint operations.
UniformBigInt
The back-end implementing rand’s UniformSampler for BigInt.
UniformBigUint
The back-end implementing rand’s UniformSampler for BigUint.

Constants§

SMALL_PRIMES 🔒
A list of small, prime numbers that allows us to rapidly exclude some fraction of composite candidates when searching for a random prime. This list is truncated at the point where smallPrimesProduct exceeds a u64. It does not include two because we ensure that the candidates are odd by construction.

Traits§

RandBigInt
RandPrime
A generic trait for generating random primes.