deriveKey

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.

K1 = HASH(K || H || letter || session_id) and Kn = HASH(K || H || K1 || ... || Kn-1) until length bytes exist; sharedSecretEncoded supplies the wire-encoded shared secret (raw bytes in a length-prefixed string, matching the deployed curve25519 behaviour).

Parameters

sharedSecretMpintThe wire-encoded shared secret K.
exchangeHashThe exchange hash H.
sessionIdThe session identifier.
letterOneKDF selector byte, 'A' through 'F'.
lengthNumber of bytes required.

Returns

The derived key material.