Module
x25519
Functions
The X25519 function: scalar-multiply point_hex (a u-coordinate) by scalar_hex.
For Diffie-Hellman: shared = x25519(my_secret, their_public).
Parameters
scalar_hex | 64-char hex (32-byte scalar; clamped per RFC 7748). |
point_hex | 64-char hex (32-byte u-coordinate). |
Returns
the 32-byte result as 64-char hex, or "" on malformed input or an all-zero result (a contributory-behaviour check: a zero shared secret is REJECTED).
Complexity
O(1) — 255 constant-time ladder steps.
Allocation
the returned string.
Unit test
CheatahX25519.Rfc7748Vector1System test
TlsSys.HandshakeAgainstOpensslThe base-point form: derive the public key for scalar_hex (u = 9).
Parameters
scalar_hex | 64-char hex secret key. |
Returns
the public key as 64-char hex, or "" on malformed input.
Complexity
O(1) — one ladder.
Allocation
the returned string.
Unit test
CheatahX25519.DiffieHellmanSystem test
TlsSys.HandshakeAgainstOpenssl