Botan 3.6.1
Crypto and TLS for C&
|
#include <monty.h>
|
inline |
Create a zero-initialized Montgomery_Int
Definition at line 28 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 225 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 238 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 250 of file monty.cpp.
References BOTAN_ASSERT_NOMSG, and Botan::BigInt::set_words().
|
inline |
Definition at line 117 of file monty.h.
|
inline |
Definition at line 119 of file monty.h.
Montgomery_Int & Botan::Montgomery_Int::add | ( | const Montgomery_Int & | other, |
secure_vector< word > & | ws ) |
Definition at line 318 of file monty.cpp.
References Botan::BigInt::mod_add().
Referenced by operator+=().
Montgomery_Int Botan::Montgomery_Int::additive_inverse | ( | ) | const |
Definition at line 388 of file monty.cpp.
References Montgomery_Int().
Montgomery_Int Botan::Montgomery_Int::cube | ( | secure_vector< word > & | ws | ) | const |
Definition at line 378 of file monty.cpp.
References Montgomery_Int().
void Botan::Montgomery_Int::fix_size | ( | ) |
Definition at line 264 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 338 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 342 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 392 of file monty.cpp.
References Botan::BigInt::mod_mul().
Montgomery_Int & Botan::Montgomery_Int::mul_by_3 | ( | secure_vector< word > & | ws | ) |
Definition at line 397 of file monty.cpp.
References Botan::BigInt::mod_mul().
Montgomery_Int & Botan::Montgomery_Int::mul_by_4 | ( | secure_vector< word > & | ws | ) |
Definition at line 402 of file monty.cpp.
References Botan::BigInt::mod_mul().
Montgomery_Int & Botan::Montgomery_Int::mul_by_8 | ( | secure_vector< word > & | ws | ) |
Definition at line 407 of file monty.cpp.
References Botan::BigInt::mod_mul().
Montgomery_Int Botan::Montgomery_Int::multiplicative_inverse | ( | ) | const |
Definition at line 382 of file monty.cpp.
References Montgomery_Int().
|
inline |
Montgomery_Int Botan::Montgomery_Int::operator* | ( | const Montgomery_Int & | other | ) | const |
Definition at line 333 of file monty.cpp.
References Montgomery_Int().
Montgomery_Int & Botan::Montgomery_Int::operator*= | ( | const Montgomery_Int & | other | ) |
Definition at line 352 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 299 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 313 of file monty.cpp.
References add().
Montgomery_Int Botan::Montgomery_Int::operator- | ( | const Montgomery_Int & | other | ) | const |
Definition at line 306 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 323 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 278 of file monty.cpp.
References Botan::BigInt::serialize(), and value().
size_t Botan::Montgomery_Int::size | ( | ) | const |
Montgomery_Int Botan::Montgomery_Int::square | ( | secure_vector< word > & | ws | ) | const |
Definition at line 374 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 369 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 328 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 294 of file monty.cpp.
Referenced by Botan::monty_multi_exp(), and serialize().