Botan 3.3.0
Crypto and TLS for C&
|
#include <monty.h>
|
inline |
Create a zero-initialized Montgomery_Int
Definition at line 33 of file monty.h.
Referenced by additive_inverse(), cube(), mul(), multiplicative_inverse(), operator*(), operator+(), operator-(), and square().
Botan::Montgomery_Int::Montgomery_Int | ( | const std::shared_ptr< const Montgomery_Params > & | params, |
const BigInt & | v, | ||
bool | redc_needed = true ) |
Create a Montgomery_Int
Definition at line 253 of file monty.cpp.
References BOTAN_ASSERT_NOMSG.
Botan::Montgomery_Int::Montgomery_Int | ( | const std::shared_ptr< const Montgomery_Params > & | params, |
const uint8_t | bits[], | ||
size_t | len, | ||
bool | redc_needed = true ) |
Create a Montgomery_Int
Definition at line 266 of file monty.cpp.
References BOTAN_ASSERT_NOMSG.
Botan::Montgomery_Int::Montgomery_Int | ( | std::shared_ptr< const Montgomery_Params > | params, |
const word | words[], | ||
size_t | len, | ||
bool | redc_needed = true ) |
Create a Montgomery_Int
Definition at line 278 of file monty.cpp.
References BOTAN_ASSERT_NOMSG, and Botan::BigInt::set_words().
Montgomery_Int & Botan::Montgomery_Int::add | ( | const Montgomery_Int & | other, |
secure_vector< word > & | ws ) |
Definition at line 348 of file monty.cpp.
References Botan::BigInt::mod_add().
Referenced by operator+=().
Montgomery_Int Botan::Montgomery_Int::additive_inverse | ( | ) | const |
Definition at line 418 of file monty.cpp.
References Montgomery_Int().
|
inline |
Definition at line 122 of file monty.h.
|
inline |
Montgomery_Int Botan::Montgomery_Int::cube | ( | secure_vector< word > & | ws | ) | const |
Definition at line 408 of file monty.cpp.
References Montgomery_Int().
void Botan::Montgomery_Int::fix_size | ( | ) |
Definition at line 292 of file monty.cpp.
References Botan::BigInt::grow_to(), and Botan::BigInt::sig_words().
bool Botan::Montgomery_Int::is_one | ( | ) | const |
bool Botan::Montgomery_Int::is_zero | ( | ) | const |
Montgomery_Int Botan::Montgomery_Int::mul | ( | const Montgomery_Int & | other, |
secure_vector< word > & | ws ) const |
Definition at line 368 of file monty.cpp.
References Montgomery_Int().
Referenced by Botan::monty_multi_exp().
Montgomery_Int & Botan::Montgomery_Int::mul_by | ( | const Montgomery_Int & | other, |
secure_vector< word > & | ws ) |
Definition at line 372 of file monty.cpp.
Referenced by Botan::monty_multi_exp(), operator*=(), and operator*=().
Montgomery_Int & Botan::Montgomery_Int::mul_by | ( | const secure_vector< word > & | other, |
secure_vector< word > & | ws ) |
Montgomery_Int & Botan::Montgomery_Int::mul_by_2 | ( | secure_vector< word > & | ws | ) |
Definition at line 422 of file monty.cpp.
References Botan::BigInt::mod_mul().
Montgomery_Int & Botan::Montgomery_Int::mul_by_3 | ( | secure_vector< word > & | ws | ) |
Definition at line 427 of file monty.cpp.
References Botan::BigInt::mod_mul().
Montgomery_Int & Botan::Montgomery_Int::mul_by_4 | ( | secure_vector< word > & | ws | ) |
Definition at line 432 of file monty.cpp.
References Botan::BigInt::mod_mul().
Montgomery_Int & Botan::Montgomery_Int::mul_by_8 | ( | secure_vector< word > & | ws | ) |
Definition at line 437 of file monty.cpp.
References Botan::BigInt::mod_mul().
Montgomery_Int Botan::Montgomery_Int::multiplicative_inverse | ( | ) | const |
Definition at line 412 of file monty.cpp.
References Montgomery_Int().
|
inline |
Montgomery_Int Botan::Montgomery_Int::operator* | ( | const Montgomery_Int & | other | ) | const |
Definition at line 363 of file monty.cpp.
References Montgomery_Int().
Montgomery_Int & Botan::Montgomery_Int::operator*= | ( | const Montgomery_Int & | other | ) |
Definition at line 382 of file monty.cpp.
References mul_by().
Montgomery_Int & Botan::Montgomery_Int::operator*= | ( | const secure_vector< word > & | other | ) |
Montgomery_Int Botan::Montgomery_Int::operator+ | ( | const Montgomery_Int & | other | ) | const |
Definition at line 329 of file monty.cpp.
References Botan::BigInt::mod_add(), and Montgomery_Int().
Montgomery_Int & Botan::Montgomery_Int::operator+= | ( | const Montgomery_Int & | other | ) |
Definition at line 343 of file monty.cpp.
References add().
Montgomery_Int Botan::Montgomery_Int::operator- | ( | const Montgomery_Int & | other | ) | const |
Definition at line 336 of file monty.cpp.
References Botan::BigInt::mod_sub(), and Montgomery_Int().
Montgomery_Int & Botan::Montgomery_Int::operator-= | ( | const Montgomery_Int & | other | ) |
Definition at line 353 of file monty.cpp.
References sub().
bool Botan::Montgomery_Int::operator== | ( | const Montgomery_Int & | other | ) | const |
|
inline |
std::vector< uint8_t > Botan::Montgomery_Int::serialize | ( | ) | const |
Definition at line 306 of file monty.cpp.
References Botan::BigInt::encode_1363(), size(), and value().
size_t Botan::Montgomery_Int::size | ( | ) | const |
Definition at line 312 of file monty.cpp.
Referenced by serialize().
Montgomery_Int Botan::Montgomery_Int::square | ( | secure_vector< word > & | ws | ) | const |
Definition at line 404 of file monty.cpp.
References Montgomery_Int().
Referenced by Botan::monty_multi_exp().
Montgomery_Int & Botan::Montgomery_Int::square_this | ( | secure_vector< word > & | ws | ) |
Definition at line 399 of file monty.cpp.
Referenced by Botan::monty_multi_exp().
Montgomery_Int & Botan::Montgomery_Int::square_this_n_times | ( | secure_vector< word > & | ws, |
size_t | n ) |
Montgomery_Int & Botan::Montgomery_Int::sub | ( | const Montgomery_Int & | other, |
secure_vector< word > & | ws ) |
Definition at line 358 of file monty.cpp.
References Botan::BigInt::mod_sub().
Referenced by operator-=().
BigInt Botan::Montgomery_Int::value | ( | ) | const |
Return the value to normal mod-p space
Definition at line 324 of file monty.cpp.
Referenced by Botan::monty_multi_exp(), and serialize().