Botan
2.1.0
Crypto and TLS for C++11
|
#include <bigint.h>
Classes | |
struct | DivideByZero |
Public Types | |
enum | Base { Decimal = 10, Hexadecimal = 16, Binary = 256 } |
enum | Sign { Negative = 0, Positive = 1 } |
Public Member Functions | |
BigInt | abs () const |
BigInt ()=default | |
BigInt (uint64_t n) | |
BigInt (const BigInt &other) | |
BigInt (const std::string &str) | |
BigInt (const uint8_t buf[], size_t length, Base base=Binary) | |
BigInt (RandomNumberGenerator &rng, size_t bits, bool set_high_bit=true) | |
Create a random BigInt of the specified size. More... | |
BigInt (Sign sign, size_t n) | |
BigInt (BigInt &&other) | |
void | binary_decode (const uint8_t buf[], size_t length) |
void | binary_decode (const secure_vector< uint8_t > &buf) |
void | binary_encode (uint8_t buf[]) const |
size_t | bits () const |
uint8_t | byte_at (size_t n) const |
size_t | bytes () const |
void | clear () |
void | clear_bit (size_t n) |
int32_t | cmp (const BigInt &n, bool check_signs=true) const |
const word * | data () const |
size_t | encoded_size (Base base=Binary) const |
void | flip_sign () |
bool | get_bit (size_t n) const |
uint32_t | get_substring (size_t offset, size_t length) const |
secure_vector< word > & | get_word_vector () |
const secure_vector< word > & | get_word_vector () const |
void | grow_to (size_t n) |
bool | is_even () const |
bool | is_negative () const |
bool | is_nonzero () const |
bool | is_odd () const |
bool | is_positive () const |
bool | is_zero () const |
void | mask_bits (size_t n) |
word * | mutable_data () |
bool | operator! () const |
BigInt & | operator%= (const BigInt &y) |
word | operator%= (word y) |
BigInt & | operator*= (const BigInt &y) |
BigInt & | operator++ () |
BigInt | operator++ (int) |
BigInt & | operator+= (const BigInt &y) |
BigInt | operator- () const |
BigInt & | operator-- () |
BigInt | operator-- (int) |
BigInt & | operator-= (const BigInt &y) |
BigInt & | operator/= (const BigInt &y) |
BigInt & | operator<<= (size_t shift) |
BigInt & | operator= (BigInt &&other) |
BigInt & | operator= (const BigInt &)=default |
BigInt & | operator>>= (size_t shift) |
void | randomize (RandomNumberGenerator &rng, size_t bitsize, bool set_high_bit=true) |
Sign | reverse_sign () const |
void | set_bit (size_t n) |
void | set_sign (Sign sign) |
void | set_word_at (size_t i, word w) |
size_t | sig_words () const |
Sign | sign () const |
size_t | size () const |
void | swap (BigInt &other) |
void | swap_reg (secure_vector< word > ®) |
uint32_t | to_u32bit () const |
word | word_at (size_t n) const |
Static Public Member Functions | |
static BigInt | decode (const uint8_t buf[], size_t length, Base base=Binary) |
static BigInt | decode (const secure_vector< uint8_t > &buf, Base base=Binary) |
static BigInt | decode (const std::vector< uint8_t > &buf, Base base=Binary) |
static std::vector< uint8_t > | encode (const BigInt &n, Base base=Binary) |
static void | encode (uint8_t buf[], const BigInt &n, Base base=Binary) |
static secure_vector< uint8_t > | encode_1363 (const BigInt &n, size_t bytes) |
static void | encode_1363 (uint8_t out[], size_t bytes, const BigInt &n) |
static secure_vector< uint8_t > | encode_fixed_length_int_pair (const BigInt &n1, const BigInt &n2, size_t bytes) |
static secure_vector< uint8_t > | encode_locked (const BigInt &n, Base base=Binary) |
static BigInt | power_of_2 (size_t n) |
static BigInt | random_integer (RandomNumberGenerator &rng, const BigInt &min, const BigInt &max) |
enum Botan::BigInt::Base |
Base enumerator for encoding and decoding
Enumerator | |
---|---|
Decimal | |
Hexadecimal | |
Binary |
enum Botan::BigInt::Sign |
Sign symbol definitions for positive and negative numbers
Enumerator | |
---|---|
Negative | |
Positive |
Definition at line 34 of file bigint.h.
|
default |
Create empty BigInt
Referenced by operator*=().
Botan::BigInt::BigInt | ( | uint64_t | n | ) |
Create BigInt from 64 bit integer
n | initial value of this BigInt |
Definition at line 20 of file bigint.cpp.
References Botan::MP_WORD_BITS, and Botan::MP_WORD_MASK.
Botan::BigInt::BigInt | ( | const BigInt & | other | ) |
Botan::BigInt::BigInt | ( | const std::string & | str | ) |
Create BigInt from a string. If the string starts with 0x the rest of the string will be interpreted as hexadecimal digits. Otherwise, it will be interpreted as a decimal number.
str | the string to parse for an integer value |
Definition at line 53 of file bigint.cpp.
References Decimal, decode(), Hexadecimal, Negative, Positive, and set_sign().
Create a BigInt from an integer in a byte array
buf | the byte array holding the value |
length | size of buf |
base | is the number base of the integer in buf |
Definition at line 82 of file bigint.cpp.
References decode().
Botan::BigInt::BigInt | ( | RandomNumberGenerator & | rng, |
size_t | bits, | ||
bool | set_high_bit = true |
||
) |
Create a random BigInt of the specified size.
rng | random number generator |
bits | size in bits |
set_high_bit | if true, the highest bit is always set |
Definition at line 90 of file bigint.cpp.
References randomize().
Botan::BigInt::BigInt | ( | Sign | sign, |
size_t | n | ||
) |
Create BigInt of specified size, all zeros
sign | the sign |
n | size of the internal register in words |
Definition at line 35 of file bigint.cpp.
References Botan::round_up().
|
inline |
BigInt Botan::BigInt::abs | ( | ) | const |
Definition at line 254 of file bigint.cpp.
References Positive, and set_sign().
Referenced by Botan::abs().
void Botan::BigInt::binary_decode | ( | const uint8_t | buf[], |
size_t | length | ||
) |
Read integer value from a byte array with given size
buf | byte array buffer containing the integer |
length | size of buf |
Definition at line 280 of file bigint.cpp.
References clear(), and Botan::round_up().
Referenced by botan_mp_from_bin(), decode(), Botan::generate_dsa_primes(), Botan::RFC6979_Nonce_Generator::nonce_for(), and randomize().
|
inline |
Read integer value from a byte array (secure_vector<uint8_t>)
buf | the array to load from |
Definition at line 466 of file bigint.h.
void Botan::BigInt::binary_encode | ( | uint8_t | buf[] | ) | const |
Store BigInt-value in a given byte array
buf | destination byte array for the integer value |
Definition at line 270 of file bigint.cpp.
References byte_at(), and bytes().
Referenced by botan_mp_to_bin(), encode(), and Botan::GOST_3410_PublicKey::public_key_bits().
size_t Botan::BigInt::bits | ( | ) | const |
Get the bit length of the integer
Definition at line 184 of file bigint.cpp.
References Botan::high_bit(), Botan::MP_WORD_BITS, sig_words(), and word_at().
Referenced by Botan::Blinded_Point_Multiply::blinded_multiply(), botan_mp_num_bits(), bytes(), Botan::ct_inverse_mod_odd_modulus(), Botan::BER_Decoder::decode(), Botan::BER_Decoder::decode_constrained_integer(), Botan::DH_PrivateKey::DH_PrivateKey(), Botan::DL_Group::DL_Group(), Botan::DER_Encoder::encode(), encoded_size(), Botan::Fixed_Window_Exponentiator::execute(), Botan::generate_dsa_primes(), Botan::is_prime(), Botan::RSA_PublicKey::key_length(), Botan::DL_Scheme_PublicKey::key_length(), Botan::EC_PublicKey::key_length(), Botan::TPM_PrivateKey::key_length(), Botan::multi_exponentiate(), Botan::operator*(), operator/=(), Botan::operator>>(), random_integer(), Botan::random_prime(), Botan::RSA_PrivateKey::RSA_PrivateKey(), Botan::Fixed_Window_Exponentiator::set_base(), Botan::Montgomery_Exponentiator::set_base(), Botan::Montgomery_Exponentiator::set_exponent(), Botan::srp6_group_identifier(), and to_u32bit().
|
inline |
n | the offset to get a byte from |
Definition at line 324 of file bigint.h.
References Botan::get_byte().
Referenced by binary_encode(), Botan::BER_Decoder::decode(), Botan::BER_Decoder::decode_constrained_integer(), get_substring(), and to_u32bit().
size_t Botan::BigInt::bytes | ( | ) | const |
Give byte length of the integer
Definition at line 176 of file bigint.cpp.
References bits(), and Botan::round_up().
Referenced by binary_encode(), botan_mp_num_bytes(), Botan::EC_Group::DER_encode(), Botan::ECIES_KA_Operation::derive_secret(), Botan::EC2OSP(), Botan::DER_Encoder::encode(), encode_1363(), encode_fixed_length_int_pair(), encoded_size(), Botan::EC_PrivateKey::private_key_bits(), Botan::GOST_3410_PublicKey::public_key_bits(), Botan::srp6_client_agree(), and Botan::SRP6_Server_Session::step1().
|
inline |
Zeroize the BigInt. The size of the underlying register is not modified.
Definition at line 217 of file bigint.h.
References Botan::zeroise().
Referenced by binary_decode(), botan_mp_clear(), operator%=(), operator*=(), operator-=(), and randomize().
void Botan::BigInt::clear_bit | ( | size_t | n | ) |
Clear bit at specified position
n | bit position to clear |
Definition at line 168 of file bigint.cpp.
References Botan::MP_WORD_BITS, and size().
Referenced by botan_mp_clear_bit().
int32_t Botan::BigInt::cmp | ( | const BigInt & | n, |
bool | check_signs = true |
||
) | const |
Compare this to another BigInt
n | the BigInt value to compare with |
check_signs | include sign in comparison? |
Definition at line 98 of file bigint.cpp.
References Botan::bigint_cmp(), data(), is_negative(), is_positive(), and sig_words().
Referenced by botan_mp_cmp(), Botan::divide(), Botan::operator!=(), Botan::operator<(), Botan::operator<=(), Botan::operator==(), Botan::operator>(), Botan::operator>=(), and Botan::Modular_Reducer::reduce().
|
inline |
Return a const pointer to the register
Definition at line 425 of file bigint.h.
Referenced by Botan::bigint_monty_sqr(), Botan::bigint_mul(), cmp(), Botan::ct_inverse_mod_odd_modulus(), Botan::Montgomery_Exponentiator::execute(), Botan::mul_add(), Botan::operator*(), operator*=(), Botan::operator+(), operator+=(), Botan::operator-(), operator-=(), Botan::operator<<(), Botan::operator>>(), Botan::redc_p521(), Botan::Montgomery_Exponentiator::set_base(), and Botan::square().
Create a BigInt from an integer in a byte array
buf | the binary value to load |
length | size of buf |
base | number-base of the integer in buf |
Definition at line 114 of file big_code.cpp.
References Binary, binary_decode(), Botan::Charset::char2digit(), Decimal, Botan::hex_decode_locked(), Hexadecimal, Botan::Charset::is_digit(), and Botan::Charset::is_space().
Referenced by BigInt(), botan_mp_set_from_radix_str(), Botan::TLS::Client_Key_Exchange::Client_Key_Exchange(), decode(), Botan::BER_Decoder::decode_octet_string_bigint(), Botan::CRL_Entry::encode_into(), Botan::OCSP::CertID::is_id_for(), and Botan::OS2ECP().
|
inlinestatic |
Create a BigInt from an integer in a byte array
buf | the binary value to load |
base | number-base of the integer in buf |
Definition at line 541 of file bigint.h.
References decode().
|
inlinestatic |
Create a BigInt from an integer in a byte array
buf | the binary value to load |
base | number-base of the integer in buf |
Definition at line 553 of file bigint.h.
References decode().
Encode the integer value from a BigInt to a std::vector of bytes
n | the BigInt to use as integer source |
base | number-base of resulting byte array representation |
Definition at line 54 of file big_code.cpp.
References Binary, and encoded_size().
Referenced by botan_mp_to_hex(), botan_mp_to_str(), Botan::TLS::Client_Key_Exchange::Client_Key_Exchange(), Botan::CRL_Entry::decode_from(), Botan::DER_Encoder::encode(), encode_1363(), encode_locked(), Botan::operator<<(), and Botan::TLS::Server_Key_Exchange::Server_Key_Exchange().
Encode the integer value from a BigInt to a byte array
buf | destination byte array for the encoded integer value with given base |
n | the BigInt to use as integer source |
base | number-base of resulting byte array representation |
Definition at line 18 of file big_code.cpp.
References Binary, binary_encode(), Decimal, Botan::Charset::digit2char(), Botan::divide(), encoded_size(), Botan::hex_encode(), Hexadecimal, is_zero(), Positive, set_sign(), and word_at().
|
static |
Encode a BigInt to a byte array according to IEEE 1363
n | the BigInt to encode |
bytes | the length of the resulting secure_vector<uint8_t> |
Definition at line 82 of file big_code.cpp.
Referenced by Botan::PK_Verifier::check_signature(), Botan::EC_Group::DER_encode(), Botan::EC2OSP(), encode_fixed_length_int_pair(), Botan::RFC6979_Nonce_Generator::nonce_for(), Botan::EC_PrivateKey::private_key_bits(), Botan::DH_PublicKey::public_value(), Botan::RFC6979_Nonce_Generator::RFC6979_Nonce_Generator(), Botan::srp6_client_agree(), and Botan::SRP6_Server_Session::step2().
|
static |
Definition at line 90 of file big_code.cpp.
References Binary, bytes(), and encode().
|
static |
Encode two BigInt to a byte array according to IEEE 1363
n1 | the first BigInt to encode |
n2 | the second BigInt to encode |
bytes | the length of the encoding of each single BigInt |
Definition at line 103 of file big_code.cpp.
References bytes(), and encode_1363().
|
static |
Encode the integer value from a BigInt to a secure_vector of bytes
n | the BigInt to use as integer source |
base | number-base of resulting byte array representation |
Definition at line 68 of file big_code.cpp.
References Binary, encode(), and encoded_size().
base | the base to measure the size for |
Definition at line 198 of file bigint.cpp.
References Binary, bits(), bytes(), Decimal, and Hexadecimal.
Referenced by encode(), and encode_locked().
void Botan::BigInt::flip_sign | ( | ) |
Flip the sign of this BigInt
Definition at line 226 of file bigint.cpp.
References reverse_sign(), and set_sign().
Referenced by botan_mp_flip_sign(), Botan::BER_Decoder::decode(), and operator-().
|
inline |
Return bit value at specified position
n | the bit offset to test |
Definition at line 299 of file bigint.h.
Referenced by Botan::Blinded_Point_Multiply::blinded_multiply(), Botan::EC2OSP(), Botan::multi_exponentiate(), and Botan::operator*().
uint32_t Botan::BigInt::get_substring | ( | size_t | offset, |
size_t | length | ||
) | const |
Return (a maximum of) 32 bits of the complete value
offset | the offset to start extracting |
length | amount of bits to extract (starting at offset) |
Definition at line 120 of file bigint.cpp.
References byte_at().
Referenced by Botan::Fixed_Window_Exponentiator::execute(), and Botan::Montgomery_Exponentiator::execute().
|
inline |
Definition at line 427 of file bigint.h.
Referenced by Botan::ct_inverse_mod_odd_modulus().
|
inline |
void Botan::BigInt::grow_to | ( | size_t | n | ) |
Increase internal register buffer to at least n words
n | new size of register |
Definition at line 261 of file bigint.cpp.
References Botan::round_up(), and size().
Referenced by Botan::ct_inverse_mod_odd_modulus(), Botan::divide(), Botan::Montgomery_Exponentiator::execute(), operator%=(), operator*=(), operator+=(), operator-=(), operator<<=(), and set_bit().
|
inline |
Test if the integer has an even value
Definition at line 232 of file bigint.h.
Referenced by Botan::almost_montgomery_inverse(), botan_mp_is_even(), Botan::RSA_PublicKey::check_key(), Botan::RSA_PrivateKey::check_key(), Botan::ct_inverse_mod_odd_modulus(), Botan::inverse_mod(), Botan::is_prime(), Botan::jacobi(), Botan::Montgomery_Exponentiator::Montgomery_Exponentiator(), and Botan::ressol().
|
inline |
Tests if the sign of the integer is negative
Definition at line 348 of file bigint.h.
Referenced by Botan::Blinded_Point_Multiply::blinded_multiply(), botan_mp_is_negative(), cmp(), Botan::ct_inverse_mod_odd_modulus(), Botan::divide(), Botan::inverse_mod(), Botan::jacobi(), Botan::mul_add(), Botan::mul_sub(), Botan::multi_exponentiate(), Botan::operator%(), Botan::operator*(), Botan::Modular_Reducer::reduce(), Botan::Power_Mod::set_base(), Botan::Power_Mod::set_exponent(), Botan::sub_mul(), and to_u32bit().
|
inline |
Test if the integer is not zero
Definition at line 244 of file bigint.h.
References Botan::CT::is_zero().
Referenced by Botan::gcd(), Botan::inverse_mod(), and Botan::low_zero_bits().
|
inline |
Test if the integer has an odd value
Definition at line 238 of file bigint.h.
Referenced by botan_mp_is_odd(), Botan::inverse_mod(), Botan::normalized_montgomery_inverse(), and Botan::Power_Mod::set_modulus().
|
inline |
Tests if the sign of the integer is positive
Definition at line 354 of file bigint.h.
Referenced by botan_mp_is_positive(), cmp(), Botan::low_zero_bits(), Botan::Montgomery_Exponentiator::Montgomery_Exponentiator(), Botan::operator%(), and Botan::Modular_Reducer::reduce().
|
inline |
Test if the integer is zero
Definition at line 250 of file bigint.h.
Referenced by botan_mp_is_zero(), Botan::ct_inverse_mod_odd_modulus(), Botan::divide(), encode(), Botan::gcd(), Botan::inverse_mod(), Botan::jacobi(), Botan::mul_add(), Botan::mul_sub(), Botan::operator%(), operator>>=(), Botan::PointGFp::randomize_repr(), Botan::Power_Mod::set_base(), and set_sign().
|
inline |
Clear all but the lowest n bits
n | amount of bits to keep |
Definition at line 276 of file bigint.h.
References Botan::clear_mem().
Referenced by Botan::redc_p521(), and Botan::Modular_Reducer::reduce().
|
inline |
Return a mutable pointer to the register
Definition at line 419 of file bigint.h.
Referenced by Botan::bigint_monty_mul(), Botan::bigint_monty_sqr(), Botan::bigint_mul(), Botan::divide(), Botan::Montgomery_Exponentiator::execute(), Botan::mul_add(), operator*=(), operator+=(), operator-=(), Botan::operator<<(), operator<<=(), operator>>=(), Botan::redc_p521(), and Botan::square().
|
inline |
Modulo operator
y | the modulus to reduce this by |
Definition at line 143 of file big_ops2.cpp.
word Botan::BigInt::operator%= | ( | word | y | ) |
Modulo operator
y | the modulus (word) to reduce this by |
Definition at line 151 of file big_ops2.cpp.
References Botan::bigint_modop(), clear(), grow_to(), Botan::is_power_of_2(), Negative, Positive, set_sign(), sig_words(), sign(), and word_at().
*= operator
y | the BigInt to multiply with this |
Definition at line 96 of file big_ops2.cpp.
References BigInt(), Botan::bigint_linmul2(), Botan::bigint_linmul3(), Botan::bigint_mul(), clear(), data(), grow_to(), mutable_data(), Negative, Positive, set_sign(), sig_words(), sign(), size(), and word_at().
|
inline |
|
inline |
+= operator
y | the BigInt to add to this |
Definition at line 19 of file big_ops2.cpp.
References Botan::bigint_add2(), Botan::bigint_cmp(), Botan::bigint_sub2(), Botan::bigint_sub3(), data(), grow_to(), Botan::CT::max(), mutable_data(), Positive, set_sign(), sig_words(), sign(), and Botan::zeroise().
BigInt Botan::BigInt::operator- | ( | ) | const |
Unary negation operator
Definition at line 244 of file bigint.cpp.
References flip_sign().
|
inline |
|
inline |
-= operator
y | the BigInt to subtract from this |
Definition at line 54 of file big_ops2.cpp.
References Botan::bigint_add2(), Botan::bigint_cmp(), Botan::bigint_shl1(), Botan::bigint_sub2(), Botan::bigint_sub2_rev(), clear(), data(), grow_to(), Botan::CT::max(), mutable_data(), Positive, reverse_sign(), set_sign(), sig_words(), and sign().
/= operator
y | the BigInt to divide this by |
Definition at line 131 of file big_ops2.cpp.
References bits(), Botan::is_power_of_2(), sig_words(), and word_at().
BigInt & Botan::BigInt::operator<<= | ( | size_t | shift | ) |
Left shift operator
shift | the number of bits to shift this left by |
Definition at line 185 of file big_ops2.cpp.
References Botan::bigint_shl1(), grow_to(), Botan::MP_WORD_BITS, mutable_data(), and sig_words().
BigInt & Botan::BigInt::operator>>= | ( | size_t | shift | ) |
Right shift operator
shift | the number of bits to shift this right by |
Definition at line 203 of file big_ops2.cpp.
References Botan::bigint_shr1(), is_zero(), Botan::MP_WORD_BITS, mutable_data(), Positive, set_sign(), and sig_words().
|
inlinestatic |
Create a power of two
n | the power of two to create |
Definition at line 492 of file bigint.h.
References set_bit().
Referenced by Botan::Modular_Reducer::Modular_Reducer(), Botan::Montgomery_Exponentiator::Montgomery_Exponentiator(), Botan::Modular_Reducer::reduce(), and Botan::ressol().
|
static |
rng | a random number generator |
min | the minimum value |
max | the maximum value |
Definition at line 45 of file big_rand.cpp.
References bits(), and randomize().
Referenced by botan_mp_rand_range(), Botan::DSA_PrivateKey::DSA_PrivateKey(), Botan::EC_PrivateKey::EC_PrivateKey(), and Botan::is_prime().
void Botan::BigInt::randomize | ( | RandomNumberGenerator & | rng, |
size_t | bitsize, | ||
bool | set_high_bit = true |
||
) |
Fill BigInt with a random number with size of bitsize
If set_high_bit
is true, the highest bit will be set, which causes the entropy to be bits-1. Otherwise the highest bit is randomly chosen by the rng, causing the entropy to be bits.
rng | the random number generator to use |
bitsize | number of bits the created random value should have |
set_high_bit | if true, the highest bit is always set |
Definition at line 17 of file big_rand.cpp.
References binary_decode(), clear(), Positive, Botan::RandomNumberGenerator::random_vec(), Botan::round_up(), and set_sign().
Referenced by BigInt(), Botan::DH_PrivateKey::DH_PrivateKey(), Botan::DL_Group::DL_Group(), Botan::ElGamal_PrivateKey::ElGamal_PrivateKey(), random_integer(), and Botan::PointGFp::randomize_repr().
BigInt::Sign Botan::BigInt::reverse_sign | ( | ) | const |
Definition at line 234 of file bigint.cpp.
References Negative, Positive, and sign().
Referenced by flip_sign(), Botan::operator-(), and operator-=().
void Botan::BigInt::set_bit | ( | size_t | n | ) |
Set bit at specified position
n | bit position to set |
Definition at line 157 of file bigint.cpp.
References grow_to(), Botan::MP_WORD_BITS, and size().
Referenced by botan_mp_set_bit(), Botan::generate_dsa_primes(), power_of_2(), and Botan::random_prime().
void Botan::BigInt::set_sign | ( | Sign | sign | ) |
Set sign of the integer
sign | new Sign to set |
Definition at line 215 of file bigint.cpp.
References is_zero(), and Positive.
Referenced by abs(), BigInt(), Botan::divide(), encode(), flip_sign(), Botan::gcd(), operator%=(), operator*=(), operator+=(), operator-=(), operator>>=(), randomize(), and Botan::Modular_Reducer::reduce().
|
inline |
|
inline |
Return how many words we need to hold this value
Definition at line 393 of file bigint.h.
Referenced by Botan::bigint_monty_sqr(), Botan::bigint_mul(), bits(), cmp(), Botan::ct_inverse_mod_odd_modulus(), Botan::divide(), Botan::Modular_Reducer::Modular_Reducer(), Botan::mul_add(), Botan::operator%(), operator%=(), Botan::operator*(), operator*=(), Botan::operator+(), operator+=(), Botan::operator-(), operator-=(), operator/=(), Botan::operator<<(), operator<<=(), Botan::operator>>(), operator>>=(), Botan::redc_p521(), and Botan::square().
|
inline |
Return the sign of the integer
Definition at line 360 of file bigint.h.
Referenced by Botan::mul_add(), Botan::operator%(), operator%=(), Botan::operator*(), operator*=(), Botan::operator+(), operator+=(), Botan::operator-(), operator-=(), Botan::operator<<(), Botan::operator>>(), and reverse_sign().
|
inline |
Give size of internal register
Definition at line 387 of file bigint.h.
Referenced by Botan::bigint_monty_sqr(), Botan::bigint_mul(), clear_bit(), Botan::Montgomery_Exponentiator::execute(), grow_to(), Botan::low_zero_bits(), Botan::mul_add(), Botan::operator*(), operator*=(), Botan::Montgomery_Exponentiator::set_base(), set_bit(), and Botan::square().
|
inline |
Swap this value with another
other | BigInt to swap values with |
Definition at line 122 of file bigint.h.
Referenced by botan_mp_swap(), and Botan::PointGFp::swap().
|
inline |
uint32_t Botan::BigInt::to_u32bit | ( | ) | const |
Convert this value into a uint32_t, if it is in the range [0 ... 2**32-1], or otherwise throw an exception.
Definition at line 141 of file bigint.cpp.
References bits(), byte_at(), and is_negative().
Referenced by botan_mp_to_uint32().
|
inline |
Return the word at a specified position of the internal register
n | position in the register |
Definition at line 335 of file bigint.h.
Referenced by bits(), Botan::divide(), encode(), Botan::is_prime(), Botan::low_zero_bits(), Botan::Montgomery_Exponentiator::Montgomery_Exponentiator(), Botan::operator%(), operator%=(), Botan::operator*(), operator*=(), and operator/=().