9#include <botan/bigint.h>
10#include <botan/internal/divide.h>
11#include <botan/internal/mp_core.h>
12#include <botan/internal/bit_ops.h>
24 if(x.
sign() == y_sign)
36 else if(relative_size == 0)
51 const size_t y_sw =
y.sig_words();
57 else if(y_sw == 1 && x_sw)
65 y.data(),
y.size(), y_sw,
66 workspace.data(), workspace.size());
97 if(
y.sig_words() == 1)
99 return x /
y.word_at(0);
158 remainder = (n.
word_at(0) & (mod - 1));
163 for(
size_t i = sw; i > 0; --i)
170 return mod - remainder;
186 y.set_sign(x.
sign());
199 if(shift_words >= x_sw)
208 y.set_sign(x.
sign());
static BigInt add2(const BigInt &x, const word y[], size_t y_words, Sign y_sign)
const word * data() const
word word_at(size_t n) const
void cond_flip_sign(bool predicate)
static BigInt from_word(word n)
static BigInt with_capacity(size_t n)
#define BOTAN_MP_WORD_BITS
void vartime_divide(const BigInt &x, const BigInt &y_arg, BigInt &q_out, BigInt &r_out)
void bigint_linmul3(word z[], const word x[], size_t x_size, word y)
constexpr bool is_power_of_2(T arg)
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)
CT::Mask< word > bigint_sub_abs(word z[], const word x[], const word y[], size_t N, word ws[])
void bigint_mul(word z[], size_t z_size, const word x[], size_t x_size, size_t x_sw, const word y[], size_t y_size, size_t y_sw, word workspace[], size_t ws_size)
std::ostream & operator<<(std::ostream &out, const OID &oid)
BigInt operator/(const BigInt &x, const BigInt &y)
BigInt operator%(const BigInt &n, const BigInt &mod)
void bigint_shl2(word y[], const word x[], size_t x_size, size_t word_shift, size_t bit_shift)
void ct_divide_word(const BigInt &x, word y, BigInt &q_out, word &r_out)
int operator>>(int fd, Pipe &pipe)
void bigint_shr2(word y[], const word x[], size_t x_size, size_t word_shift, size_t bit_shift)
word bigint_modop(word n1, word n0, word d)
std::vector< T, secure_allocator< T > > secure_vector