- abs
BigInt abs(const(BigInt)* n)
Return the absolute value
- checkPrime
bool checkPrime(const(BigInt)* n, RandomNumberGenerator rng)
Undocumented in source. Be warned that the author may not have intended to support it.
- fips1863ValidSize
bool fips1863ValidSize(size_t pbits, size_t qbits)
Undocumented in source. Be warned that the author may not have intended to support it.
- gcd
BigInt gcd(const(BigInt)* a, const(BigInt)* b)
Compute the greatest common divisor
- generateDsaPrimes
Vector!ubyte generateDsaPrimes(RandomNumberGenerator rng, AlgorithmFactory af, BigInt p_out, BigInt q_out, size_t pbits, size_t qbits)
Generate DSA parameters using the FIPS 186 kosherizer
- generateDsaPrimes
bool generateDsaPrimes(RandomNumberGenerator rng, AlgorithmFactory af, BigInt p_out, BigInt q_out, size_t pbits, size_t qbits, Vector!ubyte seed_c)
Generate DSA parameters using the FIPS 186 kosherizer
- inverseMod
BigInt inverseMod(const(BigInt)* n, const(BigInt)* mod)
- inverseModOddModulus
BigInt inverseModOddModulus(const(BigInt)* n, const(BigInt)* mod)
Undocumented in source. Be warned that the author may not have intended to support it.
- isPrime
bool isPrime(const(BigInt)* n, RandomNumberGenerator rng, size_t prob, bool is_random)
Check for primality using Miller-Rabin
- jacobi
int jacobi(const(BigInt)* a, const(BigInt)* n)
- lcm
BigInt lcm(const(BigInt)* a, const(BigInt)* b)
- lcm
BigInt lcm(const(BigInt) a, const(BigInt) b)
Undocumented in source. Be warned that the author may not have intended to support it.
- lowZeroBits
size_t lowZeroBits(const(BigInt)* n)
- montyInverse
word montyInverse(word input)
Undocumented in source. Be warned that the author may not have intended to support it.
- mrTestIterations
size_t mrTestIterations(size_t n_bits, size_t prob, bool random)
Undocumented in source. Be warned that the author may not have intended to support it.
- mrWitness
bool mrWitness(BigInt y, T reducer_n, const(BigInt)* n_minus_1, size_t s)
Undocumented in source. Be warned that the author may not have intended to support it.
- mulAdd
BigInt mulAdd(const(BigInt)* a, const(BigInt)* b, const(BigInt)* c)
- powerMod
BigInt powerMod(const(BigInt)* base, const(BigInt)* exp, const(BigInt)* mod)
- quickCheckPrime
bool quickCheckPrime(const(BigInt)* n, RandomNumberGenerator rng)
Undocumented in source. Be warned that the author may not have intended to support it.
- randomPrime
BigInt randomPrime(RandomNumberGenerator rng, size_t bits, const(BigInt)* coprime, size_t equiv, size_t modulo)
BigInt randomPrime(RandomNumberGenerator rng, size_t bits, BigInt coprime, size_t equiv, size_t modulo)
Randomly generate a prime
- randomSafePrime
BigInt randomSafePrime(RandomNumberGenerator rng, size_t bits)
Return a random 'safe' prime, of the form p=2*q+1 with q prime
- ressol
BigInt ressol(const(BigInt)* a, const(BigInt)* p)
Compute the square root of x modulo a prime using the
Shanks-Tonnelli algorithm
- square
BigInt square(const(BigInt)* x)
- subMul
BigInt subMul(const(BigInt)* a, const(BigInt)* b, const(BigInt)* c)
- verifyPrime
bool verifyPrime(const(BigInt)* n, RandomNumberGenerator rng)
Undocumented in source. Be warned that the author may not have intended to support it.
Number Theory Functions