randomPrime

Randomly generate a prime

  1. BigInt randomPrime(RandomNumberGenerator rng, size_t bits, BigInt coprime, size_t equiv, size_t modulo)
  2. BigInt randomPrime(RandomNumberGenerator rng, size_t bits, BigInt coprime, size_t equiv, size_t modulo)
    static if(BOTAN_HAS_PUBLIC_KEY_CRYPTO)
    randomPrime
    ()
    (,
    size_t bits
    ,
    const BigInt coprime = BigInt(1)
    ,
    size_t equiv = 1
    ,
    size_t modulo = 2
    )

Parameters

rng RandomNumberGenerator

a random number generator

bits size_t

how large the resulting prime should be in bits

coprime BigInt

a positive integer the result should be coprime to

equiv size_t

a non-negative number that the result should be equivalent to modulo equiv_mod

modulo size_t

the modulus equiv should be checked against

Return Value

Type: BigInt

random prime with the specified criteria

Meta