ddn.net.ssh.kex_curve

Curve25519 key exchange math: the exchange hash and the SSH key derivation function (RFC 4253 section 7.2, RFC 8731).

All functions are pure computations over supplied values; the message flow that produces the inputs lives in the session's key-exchange phase.

Types 1

Inputs to the exchange-hash transcript.

Fields
const(char)[] clientIdentification
const(char)[] serverIdentification
const(ubyte)[] clientKexInit
const(ubyte)[] serverKexInit
const(ubyte)[] hostKeyBlob
const(ubyte)[] clientPublic
const(ubyte)[] serverPublic
const(ubyte)[] sharedSecret

Functions 3

fnubyte[32] computeExchangeHash(scope const SshExchangeTranscript transcript)Computes the exchange hash for curve25519-sha256.
fnubyte[] deriveKey(const(ubyte)[] sharedSecretMpint, in ubyte[32] exchangeHash, in ubyte[32] sessionId, char letterOne, size_t length)Derives directional key material with the SSH KDF.
fnubyte[] sharedSecretEncoded(scope const(ubyte)[] sharedSecretRaw)Encodes the shared secret for hashing exactly as deployed implementations do: canonical mpint encoding of the raw output bytes unchanged (see computeExchangeHash for the RFC 8731 note).