ddn.crypto.signature.ed25519

Ed25519 Signature Implementation (RFC 8032).

Secret-bearing operations - signing and public-key derivation from a private seed - run on the fixed-width constant-time implementation in ddn.crypto.internal.ed25519ct. The BigInt point arithmetic below is used only for public data: signature verification multiplies points by hashes and signature scalars that are public.

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 10

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)
fnubyte[] ed25519PublicFromSeed(const(ubyte)[] seed)Derives the 32-byte Ed25519 public key from a private seed.