Botan
1.10.9
|
#include <bigint.h>
Classes | |
struct | DivideByZero |
Public Types | |
enum | Base { Octal = 8, Decimal = 10, Hexadecimal = 16, Binary = 256 } |
enum | NumberType { Power2 } |
enum | Sign { Negative = 0, Positive = 1 } |
Public Member Functions | |
BigInt | abs () const |
void | assign (const word x[], size_t length) |
BigInt () | |
BigInt (u64bit n) | |
BigInt (const BigInt &other) | |
BigInt (const std::string &str) | |
BigInt (const byte buf[], size_t length, Base base=Binary) | |
BigInt (RandomNumberGenerator &rng, size_t bits) | |
BigInt (Sign sign, size_t n) | |
BigInt (NumberType type, size_t n) | |
void | binary_decode (const byte buf[], size_t length) |
void | binary_decode (const MemoryRegion< byte > &buf) |
void | binary_encode (byte buf[]) const |
size_t | bits () const |
byte | byte_at (size_t n) const |
size_t | bytes () const |
void | clear () |
void | clear_bit (size_t n) |
s32bit | 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 |
SecureVector< word > & | get_reg () |
const SecureVector< word > & | get_reg () const |
u32bit | get_substring (size_t offset, size_t length) const |
void | grow_reg (size_t n) |
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) |
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>>= (size_t shift) |
word & | operator[] (size_t i) |
const word & | operator[] (size_t i) const |
void | randomize (RandomNumberGenerator &rng, size_t bitsize=0) |
Sign | reverse_sign () const |
void | set_bit (size_t n) |
void | set_sign (Sign sign) |
size_t | sig_words () const |
Sign | sign () const |
size_t | size () const |
void | swap (BigInt &other) |
u32bit | to_u32bit () const |
word | word_at (size_t n) const |
Static Public Member Functions | |
static BigInt | decode (const byte buf[], size_t length, Base base=Binary) |
static BigInt | decode (const MemoryRegion< byte > &buf, Base base=Binary) |
static SecureVector< byte > | encode (const BigInt &n, Base base=Binary) |
static void | encode (byte buf[], const BigInt &n, Base base=Binary) |
static SecureVector< byte > | encode_1363 (const BigInt &n, size_t bytes) |
static BigInt | random_integer (RandomNumberGenerator &rng, const BigInt &min, const BigInt &max) |
enum Botan::BigInt::Base |
Base enumerator for encoding and decoding
Enumerator | |
---|---|
Octal | |
Decimal | |
Hexadecimal | |
Binary |
Number types (currently only power-of-2 supported)
Enumerator | |
---|---|
Power2 |
Definition at line 38 of file bigint.h.
enum Botan::BigInt::Sign |
Sign symbol definitions for positive and negative numbers
Enumerator | |
---|---|
Negative | |
Positive |
Definition at line 33 of file bigint.h.
|
inline |
Create empty BigInt
Definition at line 446 of file bigint.h.
Referenced by random_integer().
Botan::BigInt::BigInt | ( | u64bit | n | ) |
Create BigInt from 64 bit integer
n | initial value of this BigInt |
Definition at line 19 of file bigint.cpp.
References Botan::MP_WORD_BITS, Botan::MP_WORD_MASK, Positive, Botan::MemoryRegion< T >::resize(), and set_sign().
Botan::BigInt::BigInt | ( | const BigInt & | other | ) |
Copy Constructor
other | the BigInt to copy |
Definition at line 45 of file bigint.cpp.
References Botan::MemoryRegion< T >::copy(), data(), Positive, Botan::MemoryRegion< T >::resize(), set_sign(), sig_words(), and sign().
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. If the string starts with 0 and the second character is NOT an 'x' the string will be interpreted as octal digits. If the string starts with non-zero digit, it will be interpreted as a decimal number.
str | the string to parse for an integer value |
Definition at line 65 of file bigint.cpp.
References base, Decimal, decode(), Hexadecimal, Negative, Octal, 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 88 of file bigint.cpp.
References decode(), Positive, and set_sign().
Botan::BigInt::BigInt | ( | RandomNumberGenerator & | rng, |
size_t | bits | ||
) |
Create a random BigInt of the specified size
rng | random number generator |
bits | size in bits |
Definition at line 97 of file bigint.cpp.
References Positive, randomize(), and set_sign().
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 36 of file bigint.cpp.
References Botan::MemoryRegion< T >::resize(), and s.
Botan::BigInt::BigInt | ( | NumberType | type, |
size_t | n | ||
) |
Create a number of the specified type and size
type | the type of number to create. For Power2, will create the integer 2^n |
n | a size/length parameter, interpretation depends upon the value of type |
Definition at line 16 of file big_rand.cpp.
References Positive, Power2, set_bit(), and set_sign().
BigInt Botan::BigInt::abs | ( | ) | const |
Definition at line 330 of file bigint.cpp.
References Positive, and set_sign().
Referenced by Botan::abs(), and Botan::operator*().
|
inline |
Assign using a plain word array
Definition at line 337 of file bigint.h.
References Botan::copy_mem().
Referenced by Botan::Montgomery_Exponentiator::execute().
void Botan::BigInt::binary_decode | ( | const byte | 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 350 of file bigint.cpp.
References clear(), and Botan::MemoryRegion< T >::resize().
Referenced by binary_decode(), decode(), Botan::generate_dsa_primes(), and randomize().
void Botan::BigInt::binary_decode | ( | const MemoryRegion< byte > & | buf | ) |
Read integer value from a byte array (MemoryRegion<byte>)
buf | the array to load from |
Definition at line 371 of file bigint.cpp.
References binary_decode(), and Botan::MemoryRegion< T >::size().
void Botan::BigInt::binary_encode | ( | byte | buf[] | ) | const |
Store BigInt-value in a given byte array
buf | destination byte array for the integer value |
Definition at line 340 of file bigint.cpp.
References byte_at(), and bytes().
Referenced by encode(), Botan::ElGamal_Encryption_Operation::encrypt(), Botan::NR_Signature_Operation::sign(), Botan::DSA_Signature_Operation::sign(), Botan::ECDSA_Signature_Operation::sign(), Botan::GOST_3410_Signature_Operation::sign(), and Botan::GOST_3410_PublicKey::x509_subject_public_key().
size_t Botan::BigInt::bits | ( | ) | const |
Get the bit length of the integer
Definition at line 253 of file bigint.cpp.
References Botan::MP_WORD_BITS, Botan::MP_WORD_TOP_BIT, sig_words(), and word_at().
Referenced by bytes(), Botan::BER_Decoder::decode(), Botan::DH_KA_Operation::DH_KA_Operation(), Botan::DH_PrivateKey::DH_PrivateKey(), Botan::DL_Group::DL_Group(), Botan::ElGamal_Decryption_Operation::ElGamal_Decryption_Operation(), Botan::DER_Encoder::encode(), encoded_size(), Botan::ElGamal_Encryption_Operation::encrypt(), Botan::Fixed_Window_Exponentiator::execute(), Botan::generate_dsa_primes(), mask_bits(), Botan::multi_exponentiate(), Botan::operator*(), operator/=(), Botan::operator>>(), Botan::primality_test(), random_integer(), Botan::random_prime(), Botan::RSA_Private_Operation::RSA_Private_Operation(), Botan::RSA_PrivateKey::RSA_PrivateKey(), Botan::RW_PrivateKey::RW_PrivateKey(), Botan::Fixed_Window_Exponentiator::set_base(), Botan::Montgomery_Exponentiator::set_base(), Botan::Montgomery_Exponentiator::set_exponent(), Botan::NR_Signature_Operation::sign(), Botan::DSA_Signature_Operation::sign(), Botan::RW_Signature_Operation::sign(), Botan::ECDSA_Signature_Operation::sign(), Botan::GOST_3410_Signature_Operation::sign(), Botan::srp6_group_identifier(), and to_u32bit().
byte Botan::BigInt::byte_at | ( | size_t | n | ) | const |
n | the offset to get a byte from |
Definition at line 147 of file bigint.cpp.
References Botan::get_byte(), and size().
Referenced by binary_encode(), Botan::BER_Decoder::decode(), get_substring(), Botan::operator*(), and to_u32bit().
size_t Botan::BigInt::bytes | ( | ) | const |
Give byte length of the integer
Definition at line 245 of file bigint.cpp.
References bits().
Referenced by Botan::DH_KA_Operation::agree(), Botan::ECDH_KA_Operation::agree(), binary_encode(), Botan::ElGamal_Decryption_Operation::decrypt(), Botan::EC_Group::DER_encode(), Botan::EC2OSP(), Botan::DER_Encoder::encode(), encode_1363(), encoded_size(), Botan::ElGamal_Encryption_Operation::encrypt(), Botan::ECDSA_Signature::get_concatenation(), Botan::EC_PrivateKey::pkcs8_private_key(), Botan::NR_Signature_Operation::sign(), Botan::DSA_Signature_Operation::sign(), Botan::RW_Signature_Operation::sign(), Botan::RSA_Private_Operation::sign(), Botan::ECDSA_Signature_Operation::sign(), Botan::GOST_3410_Signature_Operation::sign(), Botan::srp6_client_agree(), Botan::SRP6_Server_Session::step1(), Botan::DSA_Verification_Operation::verify(), Botan::ECDSA_Verification_Operation::verify(), Botan::GOST_3410_Verification_Operation::verify(), Botan::NR_Verification_Operation::verify_mr(), and Botan::GOST_3410_PublicKey::x509_subject_public_key().
|
inline |
Zeroize the BigInt
Definition at line 143 of file bigint.h.
References Botan::zeroise().
Referenced by binary_decode(), mask_bits(), 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 216 of file bigint.cpp.
References Botan::MP_WORD_BITS, and size().
Compare this to another BigInt
n | the BigInt value to compare with |
check_signs | include sign in comparison? |
Definition at line 132 of file bigint.cpp.
References Botan::bigint_cmp(), data(), is_negative(), is_positive(), and sig_words().
Referenced by Botan::divide(), Botan::operator!=(), Botan::operator<(), Botan::operator<=(), Botan::operator==(), Botan::operator>(), Botan::operator>=(), and Botan::Modular_Reducer::reduce().
|
inline |
Return a pointer to the big integer word register
Definition at line 317 of file bigint.h.
Referenced by BigInt(), cmp(), Botan::Montgomery_Exponentiator::execute(), Botan::GMP_MPZ::GMP_MPZ(), Botan::mul_add(), Botan::operator*(), operator*=(), Botan::operator+(), operator+=(), Botan::operator-(), operator-=(), Botan::operator<<(), Botan::operator>>(), 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 102 of file big_code.cpp.
References Binary, binary_decode(), Botan::Charset::char2digit(), Decimal, Botan::hex_decode(), Hexadecimal, Botan::Charset::is_digit(), Botan::Charset::is_space(), Octal, r, and Botan::MemoryRegion< T >::size().
Referenced by Botan::DH_KA_Operation::agree(), BigInt(), decode(), Botan::decode_concatenation(), Botan::BER_Decoder::decode_octet_string_bigint(), Botan::CRL_Entry::encode_into(), Botan::OS2ECP(), Botan::Server_Key_Exchange::Server_Key_Exchange(), and Botan::OSSL_BN::to_bigint().
|
static |
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 94 of file big_code.cpp.
References base, decode(), and Botan::MemoryRegion< T >::size().
|
static |
Encode the integer value from a BigInt to a SecureVector of bytes
n | the BigInt to use as integer source |
base | number-base of resulting byte array representation |
Definition at line 64 of file big_code.cpp.
References Binary, and encoded_size().
Referenced by Botan::CRL_Entry::decode_from(), Botan::ElGamal_Decryption_Operation::decrypt(), Botan::RSA_Private_Operation::decrypt(), Botan::DER_Encoder::encode(), encode_1363(), Botan::operator<<(), Botan::OSSL_BN::OSSL_BN(), Botan::OSSL_BN::to_bytes(), Botan::GMP_MPZ::to_bytes(), Botan::NR_Verification_Operation::verify_mr(), Botan::RW_Verification_Operation::verify_mr(), and Botan::RSA_Public_Operation::verify_mr().
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(), n, Octal, 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 SecureVector<byte> |
Definition at line 78 of file big_code.cpp.
References Binary, bytes(), and encode().
Referenced by Botan::DH_KA_Operation::agree(), Botan::ECDH_KA_Operation::agree(), Botan::PK_Verifier::check_signature(), Botan::EC_Group::DER_encode(), Botan::EC2OSP(), Botan::RSA_Public_Operation::encrypt(), Botan::ECDSA_Signature::get_concatenation(), Botan::EC_PrivateKey::pkcs8_private_key(), Botan::DH_PublicKey::public_value(), Botan::RW_Signature_Operation::sign(), Botan::RSA_Private_Operation::sign(), Botan::srp6_client_agree(), and Botan::SRP6_Server_Session::step2().
base | the base to measure the size for |
Definition at line 272 of file bigint.cpp.
References Binary, bits(), bytes(), Decimal, Hexadecimal, and Octal.
Referenced by encode().
void Botan::BigInt::flip_sign | ( | ) |
Flip the sign of this BigInt
Definition at line 302 of file bigint.cpp.
References reverse_sign(), and set_sign().
Referenced by Botan::BER_Decoder::decode(), operator-(), and Botan::GMP_MPZ::to_bigint().
bool Botan::BigInt::get_bit | ( | size_t | n | ) | const |
Return bit value at specified position
n | the bit offset to test |
Definition at line 160 of file bigint.cpp.
References Botan::MP_WORD_BITS, and word_at().
Referenced by Botan::EC2OSP(), Botan::multi_exponentiate(), and Botan::operator*().
|
inline |
return a reference to the internal register containing the value
Definition at line 325 of file bigint.h.
Referenced by Botan::divide(), Botan::Montgomery_Exponentiator::execute(), Botan::mul_add(), operator%=(), operator*=(), operator+=(), operator-=(), Botan::operator<<(), operator<<=(), operator>>=(), Botan::square(), and Botan::GMP_MPZ::to_bigint().
|
inline |
return a const reference to the internal register containing the value
u32bit 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 168 of file bigint.cpp.
References byte_at().
Referenced by Botan::Fixed_Window_Exponentiator::execute(), Botan::Montgomery_Exponentiator::execute(), and Botan::operator*().
void Botan::BigInt::grow_reg | ( | size_t | n | ) |
Increase internal register buffer by n words
n | increase by n words |
Definition at line 115 of file bigint.cpp.
References Botan::MemoryRegion< T >::resize(), and size().
void Botan::BigInt::grow_to | ( | size_t | n | ) |
Definition at line 123 of file bigint.cpp.
References Botan::MemoryRegion< T >::resize(), and size().
Referenced by operator%=(), operator*=(), operator+=(), operator-=(), operator<<=(), and set_bit().
|
inline |
Test if the integer has an even value
Definition at line 158 of file bigint.h.
Referenced by Botan::IF_Scheme_PublicKey::check_key(), Botan::IF_Scheme_PrivateKey::check_key(), Botan::IF_Scheme_PrivateKey::IF_Scheme_PrivateKey(), Botan::inverse_mod(), Botan::jacobi(), Botan::Montgomery_Exponentiator::Montgomery_Exponentiator(), and Botan::primality_test().
|
inline |
Tests if the sign of the integer is negative
Definition at line 245 of file bigint.h.
Referenced by cmp(), Botan::divide(), Botan::inverse_mod(), Botan::jacobi(), Botan::mul_add(), Botan::multi_exponentiate(), Botan::operator%(), Botan::operator*(), Botan::Modular_Reducer::reduce(), Botan::Power_Mod::set_base(), Botan::Power_Mod::set_exponent(), Botan::sub_mul(), to_u32bit(), and Botan::RW_Verification_Operation::verify_mr().
|
inline |
Test if the integer is not zero
Definition at line 170 of file bigint.h.
Referenced by Botan::gcd(), Botan::IF_Scheme_PrivateKey::IF_Scheme_PrivateKey(), and Botan::low_zero_bits().
|
inline |
Test if the integer has an odd value
Definition at line 164 of file bigint.h.
Referenced by Botan::inverse_mod(), and Botan::Core_Engine::mod_exp().
|
inline |
Tests if the sign of the integer is positive
Definition at line 251 of file bigint.h.
Referenced by 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 176 of file bigint.h.
Referenced by Botan::divide(), encode(), Botan::gcd(), Botan::inverse_mod(), Botan::jacobi(), Botan::mul_add(), Botan::operator%(), Botan::operator*(), operator>>=(), Botan::Power_Mod::set_base(), and set_sign().
void Botan::BigInt::mask_bits | ( | size_t | n | ) |
Clear all but the lowest n bits
n | amount of bits to keep |
Definition at line 227 of file bigint.cpp.
References bits(), clear(), Botan::MP_WORD_BITS, and size().
Referenced by Botan::Modular_Reducer::reduce().
|
inline |
Modulo operator
y | the modulus to reduce this by |
Definition at line 145 of file big_ops2.cpp.
word Botan::BigInt::operator%= | ( | word | y | ) |
Modulo operator
y | the modulus (word) to reduce this by |
Definition at line 153 of file big_ops2.cpp.
References Botan::bigint_modop(), clear(), get_reg(), grow_to(), Negative, Positive, Botan::power_of_2(), set_sign(), sig_words(), sign(), and word_at().
*= operator
y | the BigInt to multiply with this |
Definition at line 95 of file big_ops2.cpp.
References Botan::bigint_linmul2(), Botan::bigint_linmul3(), Botan::bigint_mul(), clear(), data(), get_reg(), grow_to(), Negative, Positive, set_sign(), sig_words(), sign(), Botan::MemoryRegion< T >::size(), size(), and word_at().
|
inline |
|
inline |
+= operator
y | the BigInt to add to this |
Definition at line 18 of file big_ops2.cpp.
References Botan::bigint_add2(), Botan::bigint_cmp(), Botan::bigint_sub2(), Botan::bigint_sub3(), Botan::copy_mem(), data(), get_reg(), grow_to(), Positive, set_sign(), sig_words(), sign(), Botan::MemoryRegion< T >::size(), and Botan::zeroise().
BigInt Botan::BigInt::operator- | ( | ) | const |
Unary negation operator
Definition at line 320 of file bigint.cpp.
References flip_sign().
|
inline |
|
inline |
-= operator
y | the BigInt to subtract from this |
Definition at line 53 of file big_ops2.cpp.
References Botan::bigint_add2(), Botan::bigint_cmp(), Botan::bigint_shl1(), Botan::bigint_sub2(), Botan::bigint_sub2_rev(), clear(), data(), get_reg(), grow_to(), Positive, reverse_sign(), set_sign(), sig_words(), and sign().
/= operator
y | the BigInt to divide this by |
Definition at line 133 of file big_ops2.cpp.
References bits(), Botan::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 186 of file big_ops2.cpp.
References Botan::bigint_shl1(), get_reg(), grow_to(), Botan::MP_WORD_BITS, 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 204 of file big_ops2.cpp.
References Botan::bigint_shr1(), get_reg(), is_zero(), Botan::MP_WORD_BITS, Positive, set_sign(), and sig_words().
|
inline |
|
inline |
|
static |
rng | a random number generator |
min | the minimum value |
max | the maximum value |
Definition at line 50 of file big_rand.cpp.
References BigInt(), and bits().
Referenced by Botan::DSA_PrivateKey::DSA_PrivateKey(), Botan::EC_PrivateKey::EC_PrivateKey(), and Botan::NR_PrivateKey::NR_PrivateKey().
void Botan::BigInt::randomize | ( | RandomNumberGenerator & | rng, |
size_t | bitsize = 0 |
||
) |
Fill BigInt with a random number with size of bitsize
rng | the random number generator to use |
bitsize | number of bits the created random value should have |
Definition at line 29 of file big_rand.cpp.
References binary_decode(), clear(), Positive, Botan::RandomNumberGenerator::random_vec(), set_sign(), and Botan::MemoryRegion< T >::size().
Referenced by BigInt(), Botan::DH_PrivateKey::DH_PrivateKey(), Botan::DL_Group::DL_Group(), Botan::ElGamal_PrivateKey::ElGamal_PrivateKey(), Botan::primality_test(), Botan::NR_Signature_Operation::sign(), Botan::DSA_Signature_Operation::sign(), Botan::ECDSA_Signature_Operation::sign(), and Botan::GOST_3410_Signature_Operation::sign().
BigInt::Sign Botan::BigInt::reverse_sign | ( | ) | const |
Definition at line 310 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 205 of file bigint.cpp.
References grow_to(), Botan::MP_WORD_BITS, and size().
Referenced by BigInt(), Botan::generate_dsa_primes(), and Botan::random_prime().
void Botan::BigInt::set_sign | ( | Sign | sign | ) |
Set sign of the integer
sign | new Sign to set |
Definition at line 291 of file bigint.cpp.
References is_zero(), Positive, and s.
Referenced by abs(), BigInt(), Botan::divide(), encode(), flip_sign(), Botan::gcd(), operator%=(), operator*=(), operator+=(), operator-=(), operator>>=(), randomize(), and Botan::Modular_Reducer::reduce().
|
inline |
Return how many words we need to hold this value
Definition at line 290 of file bigint.h.
Referenced by BigInt(), bits(), cmp(), Botan::divide(), Botan::Montgomery_Exponentiator::execute(), Botan::GMP_MPZ::GMP_MPZ(), Botan::Modular_Reducer::Modular_Reducer(), Botan::Montgomery_Exponentiator::Montgomery_Exponentiator(), Botan::mul_add(), Botan::operator%(), operator%=(), Botan::operator*(), operator*=(), Botan::operator+(), operator+=(), Botan::operator-(), operator-=(), operator/=(), Botan::operator<<(), operator<<=(), Botan::operator>>(), operator>>=(), Botan::Montgomery_Exponentiator::set_base(), and Botan::square().
|
inline |
Return the sign of the integer
Definition at line 257 of file bigint.h.
Referenced by BigInt(), 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 284 of file bigint.h.
Referenced by byte_at(), clear_bit(), Botan::Montgomery_Exponentiator::execute(), grow_reg(), grow_to(), Botan::low_zero_bits(), mask_bits(), Botan::mul_add(), Botan::operator*(), operator*=(), Botan::Montgomery_Exponentiator::set_base(), set_bit(), and Botan::square().
void Botan::BigInt::swap | ( | BigInt & | other | ) |
Swap this value with another
other | BigInt to swap values with |
Definition at line 106 of file bigint.cpp.
References Botan::MemoryRegion< T >::swap(), and std::swap().
Referenced by Botan::PointGFp::swap(), and std::swap().
u32bit Botan::BigInt::to_u32bit | ( | ) | const |
Convert this value into a u32bit, if it is in the range [0 ... 2**32-1], or otherwise throw an exception.
Definition at line 189 of file bigint.cpp.
References bits(), byte_at(), and is_negative().
|
inline |
Return the word at a specified position of the internal register
n | position in the register |
Definition at line 238 of file bigint.h.
Referenced by bits(), Botan::divide(), encode(), get_bit(), Botan::operator%(), operator%=(), Botan::operator*(), operator*=(), operator/=(), and Botan::primality_test().