Ed25519Sign

Cryptography, digital signatures

Description

Produces a PureEdDSA signature on edwards25519 (RFC 8032)

Syntax

Delphi

Function Ed25519Sign(Const Message, Seed: AnsiString; Out Signature: AnsiString): Boolean;

Return values

FalseSeed is not 32 bytes and Signature is set to an empty string
TrueSignature holds the 64-byte R||S encoding

Remarks

The secret is expanded as h = SHA-512(seed); the secret scalar s is the clamped first half of h and the nonce prefix is the second half. The nonce r = SHA-512(prefix||M) is reduced modulo the group order L, R = r*B, the challenge k = SHA-512(R||A||M) is reduced modulo L and S = (r + k*s) mod L, so the signature is R followed by S with 32 bytes each. Verification is available through Ed25519Verify; the hash is SHA-512 with no domain-separation prefix and an empty context

Example

Ed25519Sign(Msg, Seed, Sig);
OK:= Ed25519Verify(Msg, PubKey, Sig);

See also

Ed25519Verify, Ed25519PublicKeyFromSeed, Ed448Sign, SetSignProcessEd25519Identity