ddn.crypto.kex.ecdh
ECDH key agreement over NIST P-256 (secp256r1).
Implements Elliptic Curve Diffie-Hellman using the P-256 curve for TLS 1.3 key exchange. The shared secret is the x-coordinate of the resulting point, per SEC 1.
Types 1
structEcdhP256
ECDH key pair for P-256.
Holds the private scalar and public point. Use sharedSecret() to compute the ECDH shared secret with a peer's public key.
Methods
EcdhP256 generate(SecureRandom rng)Generate a new random ECDH P-256 key pair.ubyte[] sharedSecret(const(ubyte)[] peerX, const(ubyte)[] peerY)Compute the ECDH shared secret with a peer's public key.