Botan 2.19.3
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 13 of file monty.cpp.
References 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 30 of file monty.cpp.
References Botan::BigInt::is_even(), Botan::BigInt::is_negative(), 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 50 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 73 of file monty.cpp.
References Botan::bigint_monty_redc(), Botan::bigint_mul(), BOTAN_DEBUG_ASSERT, Botan::BigInt::data(), Botan::BigInt::mutable_data(), Botan::BigInt::Positive, Botan::BigInt::sig_words(), and Botan::BigInt::size().
BigInt Botan::Montgomery_Params::mul | ( | const BigInt & | x, |
const secure_vector< word > & | y, | ||
secure_vector< word > & | ws | ||
) | const |
Definition at line 97 of file monty.cpp.
References Botan::bigint_monty_redc(), Botan::bigint_mul(), BOTAN_DEBUG_ASSERT, Botan::BigInt::data(), Botan::BigInt::mutable_data(), Botan::BigInt::Positive, Botan::BigInt::sig_words(), and Botan::BigInt::size().
void Botan::Montgomery_Params::mul_by | ( | BigInt & | x, |
const BigInt & | y, | ||
secure_vector< word > & | ws | ||
) | const |
Definition at line 148 of file monty.cpp.
References Botan::bigint_monty_redc(), Botan::bigint_mul(), BOTAN_DEBUG_ASSERT, Botan::copy_mem(), Botan::BigInt::data(), 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 120 of file monty.cpp.
References Botan::bigint_monty_redc(), Botan::bigint_mul(), BOTAN_DEBUG_ASSERT, Botan::copy_mem(), Botan::BigInt::data(), Botan::BigInt::grow_to(), Botan::BigInt::mutable_data(), Botan::BigInt::sig_words(), and Botan::BigInt::size().
|
inline |
Definition at line 145 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_monty_redc(), Botan::BigInt::data(), 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 176 of file monty.cpp.
References Botan::bigint_monty_redc(), Botan::bigint_sqr(), BOTAN_DEBUG_ASSERT, Botan::BigInt::data(), Botan::BigInt::mutable_data(), Botan::BigInt::Positive, Botan::BigInt::sig_words(), and Botan::BigInt::size().
void Botan::Montgomery_Params::square_this | ( | BigInt & | x, |
secure_vector< word > & | ws | ||
) | const |
Definition at line 198 of file monty.cpp.
References Botan::bigint_monty_redc(), Botan::bigint_sqr(), BOTAN_DEBUG_ASSERT, Botan::copy_mem(), Botan::BigInt::data(), Botan::BigInt::grow_to(), Botan::BigInt::mutable_data(), Botan::BigInt::sig_words(), and Botan::BigInt::size().