ddn.crypto.kex.dh

Diffie-Hellman Key Exchange Implementation (PKCS#3 / RFC 2631).

class DH

Types 1

Diffie-Hellman Key Agreement.

The shared-secret exponentiation blinds the private exponent with a fresh random multiple of p-1 before the (variable-time) powmod, so each call evaluates an unpredictable exponent and timing measurements cannot be averaged into the secret. This assumes the standard DH setting of a prime p.

Fields
private DHPrivateKey _key
private Random _random
Methods
void initialize(PrivateKey privateKey)
void init(PrivateKey privateKey)
ubyte[] calculateSecret(PublicKey publicKey)
private size_t byteLength(BigInt n)
private ubyte[] i2osp(BigInt x, size_t xLen)
Constructors
this(Random random = null)Constructs a DH key agreement.