8#include <botan/internal/x448_internal.h>
10#include <botan/internal/ct_utils.h>
11#include <botan/internal/curve448_gf.h>
16uint64_t get_bit(
const ScalarX448& scalar,
size_t bit) {
17 return (scalar[bit / 8] >> (bit % 8)) & 1;
56 for(int16_t t = 448 - 1; t >= 0; --t) {
64 const auto A = x_2 + z_2;
66 const auto B = x_2 - z_2;
68 const auto E = AA - BB;
69 const auto C = x_3 + z_3;
70 const auto D = x_3 - z_3;
71 const auto DA = D * A;
72 const auto CB = C * B;
74 z_3 = x_1 *
square(DA - CB);
82 const auto res = x_2 / z_2;
#define BOTAN_ARG_CHECK(expr, msg)
static constexpr Mask< T > expand(T v)
static constexpr Mask< T > cleared()
void ct_cond_swap(CT::Mask< uint64_t > mask, Gf448Elem &other)
Swap this and other if mask is set. Constant time.
decltype(auto) begin() noexcept(noexcept(this->get().begin()))
decltype(auto) end() noexcept(noexcept(this->get().end()))
Gf448Elem mul_a24(const Gf448Elem &a)
Multiply a field element by the Curve448 constant a24 = 39081.
Point448 x448_basepoint(const ScalarX448 &k)
Multiply a scalar with the base group element (5).
BigInt square(const BigInt &x)
Strong< std::array< uint8_t, X448_LEN >, struct Point448_ > Point448
Strong< std::array< uint8_t, X448_LEN >, struct ScalarX448_ > ScalarX448
Point448 decode_point(std::span< const uint8_t > p_bytes)
Decode a point from a byte array. RFC 7748 Section 5 (decodeUCoordinate).
constexpr size_t X448_LEN
secure_vector< uint8_t > encode_point(const Point448 &p)
Encode a point to a 56 byte vector. RFC 7748 Section 5 (encodeUCoordinate).
std::vector< T, secure_allocator< T > > secure_vector
constexpr void typecast_copy(ToR &&out, const FromR &in)
ScalarX448 decode_scalar(std::span< const uint8_t > scalar_bytes)
Decode a scalar from a byte array. RFC 7748 Section 5 (decodeScalar448).
Point448 x448(const ScalarX448 &k, const Point448 &u)
Multiply a scalar k with a point u.