ddn.crypto.kex.x25519
ECDH / X25519 Implementation (RFC 7748).
Side-Channel Status: The scalar multiplication runs on the fixed-width field arithmetic of ddn.crypto.internal.fe25519: control flow independent of the secret scalar, mask-based conditional swaps end to end, no heap allocation inside the ladder, and every ladder state element wiped after use. The private-key holder and this agreement object additionally wipe their scalar copies on destruction.
class X25519
Types 1
classX25519 : KeyAgreement
X25519 Key Agreement (ECDH over Curve25519).
Fields
private ubyte[32] _secretprivate bool _initializedMethods
void initialize(PrivateKey privateKey)void init(PrivateKey privateKey)ubyte[] calculateSecret(PublicKey publicKey)ubyte[] x25519(const(ubyte)[] k, const(ubyte)[] u) staticCalculates X25519(k, u) with the RFC 7748 Montgomery ladder over fixed-width constant-time field arithmetic.Destructors