9 #include <botan/bigint.h>
10 #include <botan/divide.h>
11 #include <botan/internal/mp_core.h>
12 #include <botan/internal/bit_ops.h>
37 else if(relative_size == 0)
39 else if(relative_size > 0)
65 else if(relative_size == 0)
70 else if(relative_size > 0)
92 else if(y_sw == 1 && x_sw)
100 if(x_sw && y_sw && x.
sign() != y.
sign())
141 return (n.
word_at(0) & (mod - 1));
145 for(
size_t j = n.
sig_words(); j > 0; --j)
149 return mod - remainder;
166 BigInt y(x.
sign(), x_sw + shift_words + (shift_bits ? 1 : 0));
178 if(x.
bits() <= shift)
186 bigint_shr2(y.mutable_data(), x.
data(), x_sw, shift_words, shift_bits);
word word_at(size_t n) const
void divide(const BigInt &x, const BigInt &y_arg, BigInt &q, BigInt &r)
void bigint_shr2(word y[], const word x[], size_t x_size, size_t word_shift, size_t bit_shift)
std::istream & operator>>(std::istream &in, X509_DN &dn)
int32_t bigint_cmp(const word x[], size_t x_size, const word y[], size_t y_size)
std::ostream & operator<<(std::ostream &out, const X509_DN &dn)
Sign reverse_sign() const
word bigint_sub3(word z[], const word x[], size_t x_size, const word y[], size_t y_size)
OID operator+(const OID &oid, uint32_t component)
BigInt operator%(const BigInt &n, const BigInt &mod)
void bigint_linmul3(word z[], const word x[], size_t x_size, word y)
std::vector< T, secure_allocator< T >> secure_vector
const word * data() const
BigInt operator*(const BigInt &x, const BigInt &y)
void bigint_shl2(word y[], const word x[], size_t x_size, size_t word_shift, size_t bit_shift)
void bigint_mul(BigInt &z, const BigInt &x, const BigInt &y, word workspace[])
BigInt operator-(const BigInt &x, const BigInt &y)
void bigint_add3(word z[], const word x[], size_t x_size, const word y[], size_t y_size)
BigInt operator/(const BigInt &x, const BigInt &y)
word bigint_modop(word n1, word n0, word d)
bool is_power_of_2(T arg)
const size_t MP_WORD_BITS