18#ifndef PROTOCORE_CURVE25519_H
19#define PROTOCORE_CURVE25519_H
48void pc_x25519(uint8_t out[32],
const uint8_t scalar[32],
const uint8_t point[32]);
void pc_gf_cswap(pc_gf p, pc_gf q, int b)
constant-time conditional swap of p,q when b==1
void pc_gf_sub(pc_gf out, const pc_gf a, const pc_gf b)
out = a - b (unreduced)
void pc_gf_mul(pc_gf out, const pc_gf a, const pc_gf b)
out = a * b mod p
void pc_gf_unpack(pc_gf out, const uint8_t in[32])
decode 32 bytes (high bit ignored)
int64_t pc_gf[16]
A field element of GF(2^255 - 19): 16 limbs, radix 2^16 (limb i weighs 2^(16i)).
void pc_gf_copy(pc_gf out, const pc_gf in)
out = in
void pc_gf_inv(pc_gf out, const pc_gf a)
out = a^-1 mod p (= a^(p-2))
void pc_x25519(uint8_t out[32], const uint8_t scalar[32], const uint8_t point[32])
X25519 scalar multiplication: out = scalar * point (RFC 7748 §5).
void pc_gf_pack(uint8_t out[32], const pc_gf a)
canonical little-endian 32-byte encoding
void pc_gf_sq(pc_gf out, const pc_gf a)
out = a^2 mod p
void pc_gf_add(pc_gf out, const pc_gf a, const pc_gf b)
out = a + b (unreduced)
void pc_x25519_base(uint8_t out[32], const uint8_t scalar[32])
X25519 with the standard base point u=9: out = scalar * G.