7#ifndef BOTAN_PCURVES_SOLINAS_REDC_HELPER_H_
8#define BOTAN_PCURVES_SOLINAS_REDC_HELPER_H_
10#include <botan/internal/mp_core.h>
39 return static_cast<uint32_t
>(xw[i / 2] >> ((i % 2) * 32));
43template <WordType W,
size_t N>
50 constexpr SolinasAccum(std::array<W, N>& r) : m_r(r), m_S(0), m_idx(0) {}
52 constexpr void accum(int64_t v) {
56 const uint32_t r =
static_cast<uint32_t
>(m_S);
62 m_r[m_idx / 2] |=
static_cast<uint64_t
>(r) << (32 * (m_idx % 2));
71 return static_cast<W
>(m_S);
75 std::array<W, N>& m_r;
#define BOTAN_DEBUG_ASSERT(expr)
constexpr void accum(int64_t v)
static constexpr size_t N32
constexpr W final_carry(int64_t C)
constexpr SolinasAccum(std::array< W, N > &r)
constexpr uint32_t get_uint32(const W xw[], size_t i)