8 #ifndef BOTAN_POWER_MOD_H__
9 #define BOTAN_POWER_MOD_H__
11 #include <botan/bigint.h>
21 virtual void set_base(
const BigInt&) = 0;
22 virtual void set_exponent(
const BigInt&) = 0;
23 virtual BigInt execute()
const = 0;
42 BASE_IS_FIXED = 0x0001,
43 BASE_IS_SMALL = 0x0002,
44 BASE_IS_LARGE = 0x0004,
47 EXP_IS_FIXED = 0x0100,
48 EXP_IS_SMALL = 0x0200,
55 static size_t window_bits(
size_t exp_bits,
size_t base_bits,
64 void set_modulus(
const BigInt& modulus,
65 Usage_Hints = NO_HINTS,
66 bool disable_montgomery_arith =
false)
const;
71 void set_base(
const BigInt& base)
const;
76 void set_exponent(
const BigInt& exponent)
const;
93 Usage_Hints hints = NO_HINTS,
94 bool disable_montgomery_arith =
false);
108 { set_base(b);
return execute(); }
114 Usage_Hints hints = NO_HINTS);
124 { set_exponent(e);
return execute(); }
130 Usage_Hints hints = NO_HINTS);
BigInt operator()(const BigInt &b) const
BigInt operator()(const BigInt &e) const