ddn.crypto.signature.ed25519

Ed25519 Signature Implementation (RFC 8032).

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

private structCurveEd25519
Fields
private Object lock_
private BigInt p_
private bool pInit_
private BigInt d_
private bool dInit_
private BigInt L_
private bool LInit_
private BigInt By_
private bool ByInit_
private BigInt Bx_
private bool BxInit_
private BigInt I_
private bool IInit_
Methods
private BigInt p() static @trusted
private BigInt d() static @trusted
private BigInt L() static @trusted
private BigInt By() static @trusted
private BigInt Bx() static @trusted
private BigInt I() static @trustedsqrt(-1) mod p
private structPoint
Methods
Point infinity() static
Point basePoint() static
Fields
private Ed25519PrivateKey _key
private Appender!(ubyte[]) _buffer
Methods
void init(PrivateKey key)
void update(const(ubyte)[] input)
ubyte[] sign()
Fields
private Ed25519PublicKey _key
private Appender!(ubyte[]) _buffer
Methods
void init(PublicKey key)
void update(const(ubyte)[] input)
bool verify(const(ubyte)[] signature)

Functions 11

private fnPoint pointAdd(Point P, Point Q)
private fnPoint pointDouble(Point P)
private fnPoint pointMul(Point P, BigInt s)Constant-time scalar multiplication using double-and-add-always.
private fnPoint ctSelectPoint(uint condition, Point a, Point b) pure nothrow @safeConstant-time point selection.
private fnubyte[] encodePoint(Point P)
private fnPoint decodePoint(const(ubyte)[] enc)
private fnbool encodedIsNull(const(ubyte)[] enc)
private fnBigInt modInverse(BigInt a, BigInt n)
private fnBigInt bytesToBigIntLE(const(ubyte)[] bytes)
private fnubyte[] bigIntToBytesLE(BigInt n, size_t len)
private fnvoid zeroSecret(ref BigInt v) nothrow @nogc @trusted