Botan 3.6.1
Crypto and TLS for C&
|
#include <monty.h>
Public Member Functions | |
BigInt | inv_mod_p (const BigInt &x) const |
Montgomery_Params (const BigInt &p) | |
Montgomery_Params (const BigInt &p, const Modular_Reducer &mod_p) | |
BigInt | mul (const BigInt &x, const BigInt &y, secure_vector< word > &ws) const |
BigInt | mul (const BigInt &x, const secure_vector< word > &y, secure_vector< word > &ws) const |
void | mul_by (BigInt &x, const BigInt &y, secure_vector< word > &ws) const |
void | mul_by (BigInt &x, const secure_vector< word > &y, secure_vector< word > &ws) const |
const BigInt & | p () const |
word | p_dash () const |
size_t | p_words () const |
const BigInt & | R1 () const |
const BigInt & | R2 () const |
const BigInt & | R3 () const |
BigInt | redc (const BigInt &x, secure_vector< word > &ws) const |
BigInt | sqr (const BigInt &x, secure_vector< word > &ws) const |
void | square_this (BigInt &x, secure_vector< word > &ws) const |
Botan::Montgomery_Params::Montgomery_Params | ( | const BigInt & | p, |
const Modular_Reducer & | mod_p ) |
Initialize a set of Montgomery reduction parameters. These values can be shared by all values in a specific Montgomery domain.
Definition at line 16 of file monty.cpp.
References BOTAN_MP_WORD_BITS, Botan::BigInt::is_even(), Botan::monty_inverse(), Botan::Modular_Reducer::multiply(), p(), Botan::BigInt::power_of_2(), Botan::Modular_Reducer::reduce(), Botan::BigInt::sig_words(), Botan::Modular_Reducer::square(), and Botan::BigInt::word_at().
Botan::Montgomery_Params::Montgomery_Params | ( | const BigInt & | p | ) |
Initialize a set of Montgomery reduction parameters. These values can be shared by all values in a specific Montgomery domain.
Definition at line 32 of file monty.cpp.
References BOTAN_MP_WORD_BITS, Botan::BigInt::is_even(), Botan::monty_inverse(), Botan::Modular_Reducer::multiply(), p(), Botan::BigInt::power_of_2(), Botan::Modular_Reducer::reduce(), Botan::BigInt::sig_words(), Botan::Modular_Reducer::square(), and Botan::BigInt::word_at().
Definition at line 51 of file monty.cpp.
References Botan::inverse_mod(), and p().
BigInt Botan::Montgomery_Params::mul | ( | const BigInt & | x, |
const BigInt & | y, | ||
secure_vector< word > & | ws ) const |
Definition at line 71 of file monty.cpp.
References Botan::BigInt::_data(), Botan::bigint_monty_redc(), Botan::bigint_mul(), BOTAN_DEBUG_ASSERT, Botan::BigInt::mutable_data(), Botan::BigInt::sig_words(), Botan::BigInt::size(), and Botan::BigInt::with_capacity().
BigInt Botan::Montgomery_Params::mul | ( | const BigInt & | x, |
const secure_vector< word > & | y, | ||
secure_vector< word > & | ws ) const |
Definition at line 98 of file monty.cpp.
References Botan::BigInt::_data(), Botan::bigint_monty_redc(), Botan::bigint_mul(), BOTAN_DEBUG_ASSERT, Botan::BigInt::mutable_data(), Botan::BigInt::sig_words(), Botan::BigInt::size(), and Botan::BigInt::with_capacity().
void Botan::Montgomery_Params::mul_by | ( | BigInt & | x, |
const BigInt & | y, | ||
secure_vector< word > & | ws ) const |
Definition at line 154 of file monty.cpp.
References Botan::BigInt::_data(), Botan::bigint_monty_redc(), Botan::bigint_mul(), BOTAN_DEBUG_ASSERT, Botan::copy_mem(), Botan::BigInt::grow_to(), Botan::BigInt::mutable_data(), Botan::BigInt::sig_words(), and Botan::BigInt::size().
void Botan::Montgomery_Params::mul_by | ( | BigInt & | x, |
const secure_vector< word > & | y, | ||
secure_vector< word > & | ws ) const |
Definition at line 123 of file monty.cpp.
References Botan::BigInt::_data(), Botan::bigint_monty_redc(), Botan::bigint_mul(), BOTAN_DEBUG_ASSERT, Botan::copy_mem(), Botan::BigInt::grow_to(), Botan::BigInt::mutable_data(), Botan::BigInt::sig_words(), and Botan::BigInt::size().
|
inline |
Definition at line 143 of file monty.h.
Referenced by inv_mod_p(), Montgomery_Params(), and Montgomery_Params().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
BigInt Botan::Montgomery_Params::redc | ( | const BigInt & | x, |
secure_vector< word > & | ws ) const |
Definition at line 56 of file monty.cpp.
References Botan::BigInt::_data(), Botan::bigint_monty_redc(), Botan::BigInt::grow_to(), and Botan::BigInt::mutable_data().
BigInt Botan::Montgomery_Params::sqr | ( | const BigInt & | x, |
secure_vector< word > & | ws ) const |
Definition at line 185 of file monty.cpp.
References Botan::BigInt::_data(), Botan::bigint_monty_redc(), Botan::bigint_sqr(), BOTAN_DEBUG_ASSERT, Botan::BigInt::mutable_data(), Botan::BigInt::sig_words(), Botan::BigInt::size(), and Botan::BigInt::with_capacity().
void Botan::Montgomery_Params::square_this | ( | BigInt & | x, |
secure_vector< word > & | ws ) const |
Definition at line 203 of file monty.cpp.
References Botan::BigInt::_data(), Botan::bigint_monty_redc(), Botan::bigint_sqr(), BOTAN_DEBUG_ASSERT, Botan::copy_mem(), Botan::BigInt::grow_to(), Botan::BigInt::mutable_data(), Botan::BigInt::sig_words(), and Botan::BigInt::size().