Module scicrypt::number_theory[][src]

Expand description

Functions for generating random prime numbers.

Functions

Generates a uniformly random coprime $x$ to the other integer $y$. This means that $\gcd(x, y) = 1$.

Generates a uniformly random prime number of a given bit length. So, the number contains bit_length bits, of which the first and the last bit are always 1.

Generates a uniformly random RSA modulus, which is the product of two safe primes $p$ and $q$. This method returns both the modulus and $\lambda$, which is the least common multiple of $p - 1$ and $q - 1$.

Generates a uniformly random safe prime number of a given bit length. This is a prime $p$ of the form $p = 2q + 1$, where $q$ is a smaller prime.