|
Botan
2.13.0
Crypto and TLS for C++11
|
#include <pow_mod.h>
Public Types | |
| enum | Usage_Hints { NO_HINTS = 0x0000, BASE_IS_FIXED = 0x0001, BASE_IS_SMALL = 0x0002, BASE_IS_LARGE = 0x0004, BASE_IS_2 = 0x0008, EXP_IS_FIXED = 0x0100, EXP_IS_SMALL = 0x0200, EXP_IS_LARGE = 0x0400 } |
Public Member Functions | |
| BigInt | execute () const |
| Power_Mod & | operator= (const Power_Mod &) |
| Power_Mod (const BigInt &modulus=0, Usage_Hints hints=NO_HINTS, bool disable_montgomery_arith=false) | |
| Power_Mod (const Power_Mod &) | |
| void | set_base (const BigInt &base) const |
| void | set_exponent (const BigInt &exponent) const |
| void | set_modulus (const BigInt &modulus, Usage_Hints hints=NO_HINTS, bool disable_montgomery_arith=false) const |
| virtual | ~Power_Mod () |
Static Public Member Functions | |
| static size_t | window_bits (size_t exp_bits, size_t base_bits, Power_Mod::Usage_Hints hints) |
| Enumerator | |
|---|---|
| NO_HINTS | |
| BASE_IS_FIXED | |
| BASE_IS_SMALL | |
| BASE_IS_LARGE | |
| BASE_IS_2 | |
| EXP_IS_FIXED | |
| EXP_IS_SMALL | |
| EXP_IS_LARGE | |
Definition at line 26 of file pow_mod.h.
| Botan::Power_Mod::Power_Mod | ( | const BigInt & | modulus = 0, |
| Usage_Hints | hints = NO_HINTS, |
||
| bool | disable_montgomery_arith = false |
||
| ) |
| modulus | Optionally call set_modulus |
| hints | Passed to set_modulus if modulus > 0 |
| disable_montgomery_arith | Disables use of Montgomery representation. Likely only useful for testing. |
Definition at line 146 of file pow_mod.cpp.
| Botan::Power_Mod::Power_Mod | ( | const Power_Mod & | other | ) |
Definition at line 156 of file pow_mod.cpp.
|
virtual |
Definition at line 151 of file pow_mod.cpp.
| BigInt Botan::Power_Mod::execute | ( | ) | const |
All three of the above functions must have already been called.
Definition at line 224 of file pow_mod.cpp.
Referenced by Botan::Fixed_Exponent_Power_Mod::operator()(), and Botan::Fixed_Base_Power_Mod::operator()().
Definition at line 165 of file pow_mod.cpp.
| void Botan::Power_Mod::set_base | ( | const BigInt & | base | ) | const |
Set the base
Definition at line 198 of file pow_mod.cpp.
References Botan::BigInt::is_negative().
Referenced by Botan::Fixed_Base_Power_Mod::Fixed_Base_Power_Mod(), and Botan::Fixed_Exponent_Power_Mod::operator()().
| void Botan::Power_Mod::set_exponent | ( | const BigInt & | exponent | ) | const |
Set the exponent
Definition at line 211 of file pow_mod.cpp.
References Botan::BigInt::is_negative().
Referenced by Botan::Fixed_Exponent_Power_Mod::Fixed_Exponent_Power_Mod(), and Botan::Fixed_Base_Power_Mod::operator()().
| void Botan::Power_Mod::set_modulus | ( | const BigInt & | modulus, |
| Usage_Hints | hints = NO_HINTS, |
||
| bool | disable_montgomery_arith = false |
||
| ) | const |
| modulus | the modulus |
| hints | Passed to set_modulus if modulus > 0 |
| disable_montgomery_arith | Disables use of Montgomery representation. Likely only useful for testing. |
Definition at line 180 of file pow_mod.cpp.
References Botan::BigInt::is_odd().
|
static |
Definition at line 234 of file pow_mod.cpp.
1.8.9.1