10#include <botan/internal/mp_core.h>
12#include <botan/assert.h>
13#include <botan/exceptn.h>
14#include <botan/mem_ops.h>
15#include <botan/internal/ct_utils.h>
32 BOTAN_ARG_CHECK(z_size >= 2 * p_size && p_size > 0,
"Invalid sizes for bigint_monty_redc_generic");
34 word w2 = 0, w1 = 0, w0 = 0;
46 for(
size_t i = 1; i != p_size; ++i) {
47 for(
size_t j = 0; j < i; ++j) {
62 for(
size_t i = 0; i != p_size - 1; ++i) {
63 for(
size_t j = i + 1; j != p_size; ++j) {
76 word3_add(&w2, &w1, &w0, z[2 * p_size - 1]);
97 word borrow =
bigint_sub3(z, ws, p_size + 1, p, p_size);
#define BOTAN_DEBUG_ASSERT(expr)
#define BOTAN_ARG_CHECK(expr, msg)
Mask< T > conditional_assign_mem(T cnd, T *sink, const T *src, size_t elems)
void word3_muladd(word *w2, word *w1, word *w0, word x, word y)
void word3_add(word *w2, word *w1, word *w0, word x)
BOTAN_FUZZER_API void bigint_monty_redc_generic(word z[], size_t z_size, const word p[], size_t p_size, word p_dash, word ws[])
word bigint_sub3(word z[], const word x[], size_t x_size, const word y[], size_t y_size)
constexpr void clear_mem(T *ptr, size_t n)