Botan 3.9.0
Crypto and TLS for C&
|
#include <monty.h>
Public Member Functions | |
Montgomery_Params (const BigInt &p) | |
Montgomery_Params (const BigInt &p, const Barrett_Reduction &mod_p) | |
void | mul (BigInt &z, const BigInt &x, const BigInt &y, secure_vector< word > &ws) const |
void | mul (BigInt &z, const BigInt &x, std::span< const word > y, secure_vector< word > &ws) const |
BigInt | mul (const BigInt &x, const BigInt &y, secure_vector< word > &ws) const |
void | mul_by (BigInt &x, const BigInt &y, secure_vector< word > &ws) const |
bool | operator!= (const Montgomery_Params &other) const |
bool | operator== (const Montgomery_Params &other) 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 |
void | sqr (BigInt &z, const BigInt &x, secure_vector< word > &ws) const |
void | sqr (BigInt &z, std::span< const word > x, secure_vector< word > &ws) const |
BigInt | sqr (const BigInt &x, secure_vector< word > &ws) const |
Botan::Montgomery_Params::Montgomery_Params | ( | const BigInt & | p, |
const Barrett_Reduction & | 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 45 of file monty.cpp.
References p().
Referenced by Montgomery_Params(), operator!=(), and operator==().
|
explicit |
Initialize a set of Montgomery reduction parameters. These values can be shared by all values in a specific Montgomery domain.
Definition at line 48 of file monty.cpp.
References Montgomery_Params(), and p().
void Botan::Montgomery_Params::mul | ( | BigInt & | z, |
const BigInt & | x, | ||
const BigInt & | y, | ||
secure_vector< word > & | ws ) const |
Definition at line 81 of file monty.cpp.
References Botan::BigInt::_data(), Botan::bigint_monty_redc_inplace(), Botan::bigint_mul(), BOTAN_DEBUG_ASSERT, Botan::BigInt::grow_to(), Botan::BigInt::mutable_data(), p_words(), Botan::BigInt::sig_words(), and Botan::BigInt::size().
Referenced by Botan::Montgomery_Int::from_wide_int(), and mul().
void Botan::Montgomery_Params::mul | ( | BigInt & | z, |
const BigInt & | x, | ||
std::span< const word > | y, | ||
secure_vector< word > & | ws ) const |
Definition at line 109 of file monty.cpp.
References Botan::BigInt::_data(), Botan::bigint_monty_redc_inplace(), Botan::bigint_mul(), BOTAN_DEBUG_ASSERT, Botan::BigInt::grow_to(), Botan::BigInt::mutable_data(), p_words(), Botan::BigInt::sig_words(), and Botan::BigInt::size().
BigInt Botan::Montgomery_Params::mul | ( | const BigInt & | x, |
const BigInt & | y, | ||
secure_vector< word > & | ws ) const |
Definition at line 74 of file monty.cpp.
References mul(), p_words(), and Botan::BigInt::with_capacity().
void Botan::Montgomery_Params::mul_by | ( | BigInt & | x, |
const BigInt & | y, | ||
secure_vector< word > & | ws ) const |
Definition at line 135 of file monty.cpp.
References Botan::BigInt::_data(), Botan::bigint_monty_redc_inplace(), Botan::bigint_mul(), BOTAN_DEBUG_ASSERT, Botan::copy_mem(), Botan::BigInt::grow_to(), Botan::BigInt::mutable_data(), p(), p_dash(), p_words(), Botan::BigInt::sig_words(), and Botan::BigInt::size().
|
inline |
Definition at line 39 of file monty.h.
References Montgomery_Params().
bool Botan::Montgomery_Params::operator== | ( | const Montgomery_Params & | other | ) | const |
Definition at line 51 of file monty.cpp.
References Montgomery_Params().
|
inline |
Definition at line 41 of file monty.h.
Referenced by Montgomery_Params(), Montgomery_Params(), Botan::monty_precompute(), and mul_by().
|
inline |
|
inline |
|
inline |
Definition at line 43 of file monty.h.
Referenced by Botan::Montgomery_Int::one().
|
inline |
|
inline |
Definition at line 47 of file monty.h.
Referenced by Botan::Montgomery_Int::from_wide_int().
BigInt Botan::Montgomery_Params::redc | ( | const BigInt & | x, |
secure_vector< word > & | ws ) const |
Definition at line 59 of file monty.cpp.
References Botan::bigint_monty_redc_inplace(), Botan::BigInt::grow_to(), Botan::BigInt::mutable_data(), and p_words().
Referenced by Botan::Montgomery_Int::from_wide_int().
void Botan::Montgomery_Params::sqr | ( | BigInt & | z, |
const BigInt & | x, | ||
secure_vector< word > & | ws ) const |
Definition at line 178 of file monty.cpp.
References Botan::BigInt::_data(), Botan::BigInt::size(), and sqr().
void Botan::Montgomery_Params::sqr | ( | BigInt & | z, |
std::span< const word > | x, | ||
secure_vector< word > & | ws ) const |
Definition at line 182 of file monty.cpp.
References Botan::bigint_monty_redc_inplace(), Botan::bigint_sqr(), Botan::BigInt::grow_to(), Botan::BigInt::mutable_data(), p_words(), and Botan::BigInt::size().
BigInt Botan::Montgomery_Params::sqr | ( | const BigInt & | x, |
secure_vector< word > & | ws ) const |
Definition at line 166 of file monty.cpp.
References Botan::BigInt::_data(), BOTAN_DEBUG_ASSERT, Botan::BigInt::sig_words(), Botan::BigInt::size(), and sqr().