8 #ifndef BOTAN_NUMBER_THEORY_H__
9 #define BOTAN_NUMBER_THEORY_H__
11 #include <botan/bigint.h>
12 #include <botan/pow_mod.h>
13 #include <botan/rng.h>
24 BigInt BOTAN_DLL
mul_add(
const BigInt& a,
35 BigInt BOTAN_DLL
sub_mul(
const BigInt& a,
52 BigInt BOTAN_DLL
gcd(
const BigInt& x,
const BigInt& y);
60 BigInt BOTAN_DLL
lcm(
const BigInt& x,
const BigInt& y);
66 BigInt BOTAN_DLL
square(
const BigInt& x);
75 const BigInt& modulus);
96 BigInt BOTAN_DLL
power_mod(
const BigInt& b,
108 BigInt BOTAN_DLL
ressol(
const BigInt& x,
const BigInt& p);
125 RandomNumberGenerator&
rng,
168 size_t bits,
const BigInt& coprime = 1,
169 size_t equiv = 1,
size_t equiv_mod = 2);
180 class Algorithm_Factory;
192 SecureVector<byte> BOTAN_DLL
194 Algorithm_Factory& af,
195 BigInt& p_out, BigInt& q_out,
196 size_t pbits,
size_t qbits);
212 Algorithm_Factory& af,
213 BigInt& p_out, BigInt& q_out,
214 size_t pbits,
size_t qbits,
215 const MemoryRegion<byte>& seed);
const size_t PRIME_TABLE_SIZE
BigInt gcd(const BigInt &a, const BigInt &b)
bool quick_check_prime(const BigInt &n, RandomNumberGenerator &rng)
BigInt BOTAN_DLL ressol(const BigInt &x, const BigInt &p)
bool primality_test(const BigInt &n, RandomNumberGenerator &rng, size_t level)
RandomNumberGenerator * rng
BigInt abs(const BigInt &n)
bool verify_prime(const BigInt &n, RandomNumberGenerator &rng)
s32bit jacobi(const BigInt &a, const BigInt &n)
BigInt random_safe_prime(RandomNumberGenerator &rng, size_t bits)
size_t low_zero_bits(const BigInt &n)
BigInt inverse_mod(const BigInt &n, const BigInt &mod)
BigInt sub_mul(const BigInt &a, const BigInt &b, const BigInt &c)
BigInt square(const BigInt &x)
BigInt power_mod(const BigInt &base, const BigInt &exp, const BigInt &mod)
const u16bit BOTAN_DLL PRIMES[]
bool generate_dsa_primes(RandomNumberGenerator &rng, Algorithm_Factory &af, BigInt &p, BigInt &q, size_t pbits, size_t qbits, const MemoryRegion< byte > &seed_c)
BigInt lcm(const BigInt &a, const BigInt &b)
BigInt mul_add(const BigInt &a, const BigInt &b, const BigInt &c)
BigInt random_prime(RandomNumberGenerator &rng, size_t bits, const BigInt &coprime, size_t equiv, size_t modulo)
bool check_prime(const BigInt &n, RandomNumberGenerator &rng)