8#ifndef BOTAN_CURVE_448_GF_H_
9#define BOTAN_CURVE_448_GF_H_
11#include <botan/mem_ops.h>
12#include <botan/types.h>
13#include <botan/internal/bit_ops.h>
14#include <botan/internal/ct_utils.h>
42 explicit Gf448Elem(std::span<const uint8_t, BYTES_448> x);
54 explicit Gf448Elem(uint64_t least_sig_word);
72 void to_bytes(std::span<uint8_t, BYTES_448> out)
const;
78 std::array<uint8_t, BYTES_448>
to_bytes()
const;
120 std::span<uint64_t, WORDS_448>
words() {
return m_x; }
128 std::span<const uint64_t, WORDS_448>
words()
const {
return m_x; }
137 std::array<uint64_t, WORDS_448> m_x;
143Gf448Elem
mul_a24(
const Gf448Elem& a);
148Gf448Elem
square(
const Gf448Elem& elem);
158Gf448Elem
root(
const Gf448Elem& elem);
std::span< const uint64_t, WORDS_448 > words() const
Constant accessor to the internal words of the GF element.
void ct_cond_swap(CT::Mask< uint64_t > mask, Gf448Elem &other)
Swap this and other if mask is set. Constant time.
Gf448Elem operator*(const Gf448Elem &other) const
Gf448Elem operator-() const
static bool bytes_are_canonical_representation(std::span< const uint8_t, BYTES_448 > x)
Given 56 bytes, checks that the (little endian) number from this bytes is a valid GF element,...
std::array< uint8_t, BYTES_448 > to_bytes() const
Return the canonical representation of the GF element as 56 bytes in little-endian order.
Gf448Elem operator/(const Gf448Elem &other) const
bool operator!=(const Gf448Elem &other) const =default
bool is_odd() const
Return true iff this element is odd. Constant time.
Gf448Elem(std::span< const uint64_t, WORDS_448 > data)
Construct a GF element from a 448-bit integer gives as 7 uint64_t words x in little-endian order.
Gf448Elem operator+(const Gf448Elem &other) const
bool operator==(const Gf448Elem &other) const
std::span< uint64_t, WORDS_448 > words()
Accessor to the internal words of the GF element.
Gf448Elem(std::span< const uint8_t, BYTES_448 > x)
Construct a GF element from a 448-bit integer gives as 56 bytes x in little-endian order.
void ct_cond_assign(CT::Mask< uint64_t > mask, const Gf448Elem &other)
Set this to other if mask is true. Constant time.
bool is_zero() const
Return true iff this element is zero. Constant time.
Gf448Elem mul_a24(const Gf448Elem &a)
Multiply a field element by the Curve448 constant a24 = 39081.
Gf448Elem root(const Gf448Elem &elem)
Compute the root of elem in the field.
constexpr void copy_mem(T *out, const T *in, size_t n)
BigInt square(const BigInt &x)
BOTAN_FORCE_INLINE constexpr T ceil_tobytes(T bits)
constexpr size_t WORDS_448
constexpr size_t BYTES_448