Botan 3.14.1
Crypto and TLS for C&
x25519_internal.h
Go to the documentation of this file.
1/*
2* (C) 2026 Jack Lloyd
3*
4* Botan is released under the Simplified BSD License (see license.txt)
5*/
6
7#ifndef BOTAN_X25519_INTERNAL_H_
8#define BOTAN_X25519_INTERNAL_H_
9
10#include <botan/types.h>
11#include <span>
12
13namespace Botan {
14
15/**
16* X25519 scalar multiplication (RFC 7748 Section 5)
17*
18* Clamps the scalar and writes the u-coordinate of [k]P to out, where P is
19* the point with u-coordinate u. The output is all zero if P has low order;
20* callers that want to reject such points must check for this themselves.
21*/
22void x25519_scalarmult(std::span<uint8_t, 32> out, std::span<const uint8_t, 32> scalar, std::span<const uint8_t, 32> u);
23
24/**
25* X25519 public key derivation
26*
27* Clamps the scalar and writes the u-coordinate of [k]B to out, where B is the
28* X25519 base point with u = 9.
29*/
30void x25519_basepoint(std::span<uint8_t, 32> out, std::span<const uint8_t, 32> scalar);
31
32} // namespace Botan
33
34#endif
void x25519_scalarmult(std::span< uint8_t, 32 > out, std::span< const uint8_t, 32 > scalar, std::span< const uint8_t, 32 > u)
void x25519_basepoint(std::span< uint8_t, 32 > out, std::span< const uint8_t, 32 > scalar)