9 #include <botan/bigint.h>
10 #include <botan/internal/mp_core.h>
11 #include <botan/internal/bit_ops.h>
23 const size_t reg_size =
std::max(x_sw, y_sw) + 1;
39 else if(relative_size == 0)
44 else if(relative_size > 0)
60 const size_t reg_size =
std::max(x_sw, y_sw) + 1;
72 else if(relative_size == 0)
82 else if(relative_size > 0)
101 if(x_sw == 0 || y_sw == 0)
106 else if(x_sw == 1 && y_sw)
111 else if(y_sw == 1 && x_sw)
134 (*this) >>= (y.
bits() - 1);
136 (*
this) = (*this) / y;
145 return (*
this = (*
this) % mod);
158 word result = (
word_at(0) & (mod - 1));
173 m_reg[0] = mod - remainder;
175 m_reg[0] = remainder;
193 grow_to(words + shift_words + (shift_bits ? 1 : 0));
void bigint_shr1(word x[], size_t x_size, size_t word_shift, size_t bit_shift)
void bigint_sub2_rev(word x[], const word y[], size_t y_size)
word word_at(size_t n) const
BigInt & operator*=(const BigInt &y)
int32_t bigint_cmp(const word x[], size_t x_size, const word y[], size_t y_size)
word bigint_sub2(word x[], size_t x_size, const word y[], size_t y_size)
void bigint_linmul2(word x[], size_t x_size, word y)
Sign reverse_sign() const
word bigint_sub3(word z[], const word x[], size_t x_size, const word y[], size_t y_size)
BigInt & operator<<=(size_t shift)
BigInt & operator>>=(size_t shift)
void bigint_linmul3(word z[], const word x[], size_t x_size, word y)
BigInt & operator%=(const BigInt &y)
std::vector< T, secure_allocator< T >> secure_vector
const word * data() const
BigInt & operator/=(const BigInt &y)
BigInt & operator-=(const BigInt &y)
void bigint_shl1(word x[], size_t x_size, size_t word_shift, size_t bit_shift)
void bigint_add2(word x[], size_t x_size, const word y[], size_t y_size)
void bigint_mul(BigInt &z, const BigInt &x, const BigInt &y, word workspace[])
BigInt & operator+=(const BigInt &y)
word bigint_modop(word n1, word n0, word d)
bool is_power_of_2(T arg)
void zeroise(std::vector< T, Alloc > &vec)
const size_t MP_WORD_BITS