11#ifndef BOTAN_ED25519_INT_H_
12#define BOTAN_ED25519_INT_H_
14#include <botan/internal/ed25519_fe.h>
15#include <botan/internal/loadstor.h>
19inline uint64_t
load_3(
const uint8_t in[3]) {
20 return static_cast<uint64_t
>(in[0]) | (
static_cast<uint64_t
>(in[1]) << 8) | (
static_cast<uint64_t
>(in[2]) << 16);
23inline uint64_t
load_4(
const uint8_t* in) {
27template <
size_t S,
int64_t MUL = 1>
28inline void carry(int64_t& h0, int64_t& h1)
29 requires(S > 0 && S < 64)
31 const int64_t X1 = (
static_cast<int64_t
>(1) << S);
32 const int64_t X2 = (
static_cast<int64_t
>(1) << (S - 1));
33 int64_t c = (h0 + X2) >> S;
39inline void carry0(int64_t& h0, int64_t& h1)
40 requires(S > 0 && S < 64)
42 const int64_t X1 = (
static_cast<int64_t
>(1) << S);
49inline void carry0(int32_t& h0, int32_t& h1)
50 requires(S > 0 && S < 32)
52 const int32_t X1 = (
static_cast<int64_t
>(1) << S);
58inline void redc_mul(int64_t& s1, int64_t& s2, int64_t& s3, int64_t& s4, int64_t& s5, int64_t& s6, int64_t&
X) {
97void sc_muladd(uint8_t*,
const uint8_t*,
const uint8_t*,
const uint8_t*);
void redc_mul(int64_t &s1, int64_t &s2, int64_t &s3, int64_t &s4, int64_t &s5, int64_t &s6, int64_t &X)
uint64_t load_4(const uint8_t *in)
void carry0(int64_t &h0, int64_t &h1)
int ge_frombytes_negate_vartime(ge_p3 *v, const uint8_t *)
void ge_scalarmult_base(uint8_t out[32], const uint8_t in[32])
void carry(int64_t &h0, int64_t &h1)
constexpr auto load_le(ParamTs &&... params)
void sc_reduce(uint8_t *)
uint64_t load_3(const uint8_t in[3])
void ge_double_scalarmult_vartime(uint8_t out[32], const uint8_t a[], const ge_p3 *A, const uint8_t b[])
void sc_muladd(uint8_t *, const uint8_t *, const uint8_t *, const uint8_t *)