8#ifndef BOTAN_CURVE448_SCALAR_H_
9#define BOTAN_CURVE448_SCALAR_H_
11#include <botan/strong_type.h>
12#include <botan/types.h>
13#include <botan/internal/bit_ops.h>
14#include <botan/internal/loadstor.h>
19 constexpr size_t word_bits =
sizeof(word) * 8;
20 return (x + word_bits - 1) / word_bits;
43 template <
size_t S = BYTES>
47 std::array<uint8_t, S> result = {0};
48 store_le(std::span(result).
template first<BYTES>(), m_scalar_words);
53 bool get_bit(
size_t i)
const;
62 static bool bytes_are_reduced(std::span<const uint8_t> x);
65 Scalar448(std::span<const word, WORDS> scalar_words) {
copy_mem(m_scalar_words, scalar_words); }
67 std::array<word, WORDS> m_scalar_words;
Representation of a scalar for X448.
std::array< uint8_t, S > to_bytes() const
Convert the scalar to bytes in little endian.
BigInt operator*(const BigInt &x, const BigInt &y)
constexpr size_t words_for_bits(size_t x)
OctetString operator+(const OctetString &k1, const OctetString &k2)
constexpr auto store_le(ParamTs &&... params)
constexpr T ceil_tobytes(T bits)
constexpr void copy_mem(T *out, const T *in, size_t n)