9#include <botan/bigint.h>
10#include <botan/divide.h>
11#include <botan/internal/mp_core.h>
12#include <botan/internal/bit_ops.h>
22 BigInt z(x.
sign(), std::max(x_sw, y_words) + 1);
24 if(x.
sign() == y_sign)
35 else if(relative_size == 0)
54 else if(y_sw == 1 && x_sw)
63 workspace.data(), workspace.size());
165 remainder = (n.
word_at(0) & (mod - 1));
170 for(
size_t i = sw; i > 0; --i)
177 return mod - remainder;
186 const size_t shift_words = shift / BOTAN_MP_WORD_BITS,
187 shift_bits = shift % BOTAN_MP_WORD_BITS;
191 BigInt y(x.
sign(), x_sw + shift_words + (shift_bits ? 1 : 0));
201 const size_t shift_words = shift / BOTAN_MP_WORD_BITS;
202 const size_t shift_bits = shift % BOTAN_MP_WORD_BITS;
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)
void bigint_linmul3(word z[], const word x[], size_t x_size, word y)
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)
void ct_divide_u8(const BigInt &x, uint8_t y, BigInt &q_out, uint8_t &r_out)
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)
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)
int operator>>(int fd, Pipe &pipe)
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)
void vartime_divide(const BigInt &x, const BigInt &y_arg, BigInt &q_out, BigInt &r_out)
std::vector< T, secure_allocator< T > > secure_vector
constexpr bool is_power_of_2(T arg)