generateGroup14Private

fnBigInt generateGroup14Private(Random rng)

Generates a fresh group14 private exponent.

The exponent is 256 bits with the top bit set, satisfying the RFC 4253 minimum of twice the security parameter for SHA-256.

Qualification: the exponent must come from a cryptographic RNG and must be erased (via DHPrivateKey.wipe) once the shared secret exists. Blinded agreement in ddn.crypto.kex.dh.DH randomizes each exponentiation but remains variable-time; that does not establish constant-time behavior for every DH operation on the path.

Parameters

rngCryptographic random source.

Returns

A private exponent x with 255 <= bit length <= 256

and 2 <= x <= p - 2.