9 #include <botan/numthry.h>
10 #include <botan/keypair.h>
11 #include <botan/parsing.h>
20 size_t bits,
size_t exp)
25 if(exp < 2 || exp % 2 == 1)
35 }
while(
n.
bits() != bits);
56 if((
e *
d) % (
lcm(
p - 1,
q - 1) / 2) != 1)
67 powermod_d1_p(rw.get_d1(), rw.get_p()),
68 powermod_d2_q(rw.get_d2(), rw.get_q()),
85 if(i >= n || i % 16 != 12)
93 BigInt j1 = powermod_d1_p(i);
94 BigInt j2 = powermod_d2_q(i);
99 r = std::min(r, n - r);
bool check_key(RandomNumberGenerator &rng, bool) const
bool signature_consistency_check(RandomNumberGenerator &rng, const Private_Key &key, const std::string &padding)
RW_Signature_Operation(const RW_PrivateKey &rw)
SecureVector< byte > sign(const byte msg[], size_t msg_len, RandomNumberGenerator &rng)
std::invalid_argument Invalid_Argument
static SecureVector< byte > encode(const BigInt &n, Base base=Binary)
SecureVector< byte > verify_mr(const byte msg[], size_t msg_len)
RW_PrivateKey(const AlgorithmIdentifier &alg_id, const MemoryRegion< byte > &key_bits, RandomNumberGenerator &rng)
RandomNumberGenerator * rng
BigInt unblind(const BigInt &x) const
s32bit jacobi(const BigInt &a, const BigInt &n)
BigInt reduce(const BigInt &x) const
bool check_key(RandomNumberGenerator &rng, bool) const
BigInt inverse_mod(const BigInt &n, const BigInt &mod)
std::string algo_name() const
BigInt blind(const BigInt &x) const
BigInt sub_mul(const BigInt &a, const BigInt &b, const BigInt &c)
BigInt power_mod(const BigInt &base, const BigInt &exp, const BigInt &mod)
std::string to_string(u64bit n, size_t min_len)
void gen_check(RandomNumberGenerator &rng) const
static SecureVector< byte > encode_1363(const BigInt &n, size_t bytes)
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)