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");
40 for(
size_t i = 1; i != p_size; ++i) {
41 for(
size_t j = 0; j < i; ++j) {
42 accum.
mul(ws[j], p[i - j]);
49 for(
size_t i = 0; i != p_size - 1; ++i) {
50 for(
size_t j = i + 1; j != p_size; ++j) {
51 accum.
mul(ws[j], p[p_size + i - j]);
54 accum.
add(z[p_size + i]);
58 accum.
add(z[2 * p_size - 1]);
60 ws[p_size - 1] = accum.
extract();
62 const word w1 = accum.
extract();
#define BOTAN_ARG_CHECK(expr, msg)
constexpr W monty_step(W p0, W p_dash)
constexpr void mul(W x, W y)
constexpr void bigint_monty_maybe_sub(size_t N, W z[], W x0, const W x[], const W p[])
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[])
constexpr void clear_mem(T *ptr, size_t n)