ddn.crypto.signature.ecdsa

ECDSA (Elliptic Curve Digital Signature Algorithm) Implementation (FIPS 186-4).

Constant-Time Implementation: This module uses constant-time scalar multiplication to prevent timing side-channel attacks. The point multiplication executes in constant time regardless of the scalar value.

Types 4

structJPoint
Fields
bool atInfinity
Methods
JPoint infinity() static
Methods
void init(PrivateKey key)
void update(const(ubyte)[] input)
ubyte[] sign()
Constructors
this(HashFactory hashFactory, Random rng)
Methods
void init(PublicKey key)
void update(const(ubyte)[] input)
bool verify(const(ubyte)[] signature)
Constructors
this(HashFactory hashFactory)

Deterministic ECDSA signer using RFC 6979 nonce generation.

This signer produces reproducible signatures without requiring a random number generator. The nonce k is derived deterministically from the private key and the message hash using HMAC-DRBG as specified in RFC 6979.

This is useful for:

  • Test reproducibility and known-answer verification
  • Environments where RNG quality is uncertain
  • Avoiding catastrophic nonce-reuse failures

Methods
void init(PrivateKey key)
void update(const(ubyte)[] input)
ubyte[] sign()Signs the accumulated message using RFC 6979 deterministic nonce.
Constructors
this(HashFactory hashFactory)Constructs a deterministic ECDSA signer.

Functions 8

fnPoint pointMul(Point P, BigInt k, BigInt mod, BigInt a)Constant-time scalar multiplication using double-and-add-always.
fnJPoint ctSelectJPoint(uint condition, JPoint a, JPoint b) pure nothrow @safeConstant-time Jacobian point selection.
fnECDSAPublicKey ecdsaPublicFromPrivate(ECDSAPrivateKey key)Derives the ECDSA public key from a private scalar.