Botan 3.6.1
Crypto and TLS for C&
|
#include <reducer.h>
Public Member Functions | |
BigInt | cube (const BigInt &x) const |
const BigInt & | get_modulus () const |
bool | initialized () const |
Modular_Reducer () | |
Modular_Reducer (const BigInt &mod) | |
BigInt | multiply (const BigInt &x, const BigInt &y) const |
BigInt | multiply (const BigInt &x, const BigInt &y, const BigInt &z) const |
void | reduce (BigInt &out, const BigInt &x, secure_vector< word > &ws) const |
BigInt | reduce (const BigInt &x) const |
BigInt | square (const BigInt &x) const |
|
inline |
|
explicit |
Definition at line 19 of file reducer.cpp.
References BOTAN_MP_WORD_BITS, Botan::ct_divide(), Botan::BigInt::set_bit(), and Botan::BigInt::sig_words().
Cube mod p
x | the value to cube |
Definition at line 52 of file reducer.h.
References Botan::square().
Referenced by Botan::EC_Group::verify_group().
|
inline |
Definition at line 22 of file reducer.h.
Referenced by Botan::EC_Point_Base_Point_Precompute::EC_Point_Base_Point_Precompute().
|
inline |
Definition at line 62 of file reducer.h.
Referenced by Botan::Blinder::blind(), and Botan::Blinder::unblind().
Multiply mod p
x | the first operand |
y | the second operand |
Definition at line 32 of file reducer.h.
References Botan::reduce().
Referenced by Botan::Blinder::blind(), botan_mp_mod_mul(), Botan::is_lucas_probable_prime(), Botan::Montgomery_Params::Montgomery_Params(), Botan::Montgomery_Params::Montgomery_Params(), Botan::EC_Group_Data::multiply_mod_order(), Botan::EC_Group_Data::multiply_mod_order(), Botan::power_mod(), Botan::sqrt_modulo_prime(), Botan::Blinder::unblind(), and Botan::EC_Group::verify_group().
|
inline |
Multiply mod p
Definition at line 38 of file reducer.h.
References multiply().
Referenced by multiply().
void Botan::Modular_Reducer::reduce | ( | BigInt & | out, |
const BigInt & | x, | ||
secure_vector< word > & | ws ) const |
Low level reduction function. Mostly for internal use. Sometimes useful for performance by reducing temporaries Reduce x mod p and place the output in out. ** X and out must not reference each other ** ws is a temporary workspace.
Definition at line 69 of file reducer.cpp.
References Botan::BigInt::_data(), Botan::BigInt::add(), BOTAN_MP_WORD_BITS, Botan::clear_mem(), Botan::ct_modulo(), Botan::BigInt::ct_reduce_below(), Botan::BigInt::is_negative(), Botan::BigInt::is_nonzero(), Botan::BigInt::mask_bits(), Botan::BigInt::mul(), Botan::BigInt::Positive, Botan::BigInt::rev_sub(), Botan::BigInt::set_sign(), Botan::BigInt::sig_words(), and Botan::BigInt::size().
Definition at line 37 of file reducer.cpp.
References reduce().
Referenced by Botan::DL_Group::DL_Group(), Botan::generate_dsa_primes(), Botan::is_lucas_probable_prime(), Botan::EC_Group_Data::mod_order(), Botan::Montgomery_Params::Montgomery_Params(), Botan::Montgomery_Params::Montgomery_Params(), Botan::EC_Point_Base_Point_Precompute::mul(), Botan::power_mod(), reduce(), and Botan::EC_Group::verify_group().
Square mod p
x | the value to square |
Definition at line 45 of file reducer.h.
References Botan::reduce(), and Botan::square().
Referenced by Botan::Blinder::blind(), Botan::is_lucas_probable_prime(), Botan::Montgomery_Params::Montgomery_Params(), Botan::Montgomery_Params::Montgomery_Params(), Botan::passes_miller_rabin_test(), Botan::power_mod(), Botan::sqrt_modulo_prime(), Botan::EC_Group_Data::square_mod_order(), and Botan::EC_Group::verify_group().