wired
libc-free QUIC/HTTP3 SDK in C for x86_64-linux
Loading...
Searching...
No Matches
x25519.h File Reference

RFC 7748 X25519: scalar multiplication on Curve25519 for ECDHE. More...

Go to the source code of this file.

Macros

#define X25519_LEN   32
 X25519 scalar / u-coordinate length in bytes.

Functions

int wired_x25519 (u8 out[X25519_LEN], const u8 scalar[X25519_LEN], const u8 point[X25519_LEN])
 out = scalar * point on Curve25519.
int wired_x25519_base (u8 out[X25519_LEN], const u8 scalar[X25519_LEN])
 out = scalar * base point (9).

Detailed Description

RFC 7748 X25519: scalar multiplication on Curve25519 for ECDHE.

Function Documentation

◆ wired_x25519()

int wired_x25519 ( u8 out[X25519_LEN],
const u8 scalar[X25519_LEN],
const u8 point[X25519_LEN] )

out = scalar * point on Curve25519.

scalar and point are 32-byte little-endian; out is the 32-byte little-endian u-coordinate.

Parameters
outreceives the u-coordinate of the product
scalarthe 32-byte little-endian scalar
pointthe 32-byte little-endian u-coordinate to multiply
Returns
RFC 7748 6.1: 0 if the result is all-zero (low-order point), 1 otherwise. Callers MUST reject a 0 return (contributory behaviour).

◆ wired_x25519_base()

int wired_x25519_base ( u8 out[X25519_LEN],
const u8 scalar[X25519_LEN] )

out = scalar * base point (9).

Produces an X25519 public key.

Parameters
outreceives the public key
scalarthe 32-byte little-endian scalar
Returns
1 (a public key is never all-zero); typed int for a uniform API.