ddn.net.ssh.kex_group14

Diffie-Hellman group14 SHA-256 key-exchange math: SSH group14 parameters, exponent generation, peer-value validation helpers, and the DH exchange-hash transcript (RFC 4253 section 7.2 and 8, RFC 3526 section 3).

All functions are pure computations over supplied values; the message flow that produces the inputs lives in the session's key-exchange phase. Secret-bearing generation and agreement are delegated to ddn.crypto.kex.dh.DH, which blinds the private exponent per call; see generateGroup14Private and the qualification notes there.

Functions 13

fnbool isGroup14Kex(scope const(char)[] name) pure nothrow @safe @nogcWhether a negotiated KEX name selects the group14 SHA-256 method.
fnBigInt group14Prime()The RFC 3526 2048-bit MODP group prime used by SSH group14.
fnBigInt group14Generator()The RFC 3526 group14 generator.
fnBigInt generateGroup14Private(Random rng)Generates a fresh group14 private exponent.
fnubyte[] group14Public(BigInt x, Random rng = new SecureRandom())Computes the group14 public value for a private exponent.
fnbool group14PeerValueValid(scope const(ubyte)[] value)Validates a peer public value per RFC 4253 section 8.
fnDHPrivateKey generateGroup14KeyPair(Random rng)Generates one KEX round's local group14 key pair.
fnDHPublicKey group14PeerKey(scope const(ubyte)[] magnitude)Wraps a peer public value as a group14 key after validation.
fnubyte[32] computeExchangeHashGroup14( scope const SshExchangeTranscript transcript)Computes the exchange hash for diffie-hellman-group14-sha256.
private fnvoid hashString(SHA256Digest hash, scope const(ubyte)[] data)
private fnvoid hashString(SHA256Digest hash, scope const(char)[] text)
private fnvoid hashMpint(SHA256Digest hash, scope const(ubyte)[] magnitude)
private fnSshExchangeTranscript group14ReferenceTranscript( scope const(ubyte)[] sharedSecret)Builds the reference transcript used by the group14 vector tests.

Variables 6

enumvarGROUP14_SHA256_NAME = "diffie-hellman-group14-sha256"

SSH wire name of the group14 SHA-256 key exchange.

private varubyte[256] katE1
private varubyte[256] katF1
private varubyte[256] katK1
private varubyte[32] katHash2
private varubyte[32] katHash3