Ed25519Verify

Cryptography, digital signatures

Description

Verifies a PureEdDSA edwards25519 signature (RFC 8032)

Syntax

Delphi

Function Ed25519Verify(Const Message, PublicKey, Signature: AnsiString): Boolean;

Return values

FalsePublicKey is not 32 bytes, Signature is not 64 bytes, S is not below the group order, the public key or R is not a canonical point encoding, either point has small order, or the verification equation fails
TrueThe signature matches the message and public key

Remarks

The challenge scalar is recomputed as k = SHA-512(R||A||M) reduced modulo the group order and the signature is accepted when R equals [S]B - [k]A. S values greater than or equal to the group order are rejected, and non-canonical point encodings and points whose octuple is the neutral element are rejected for both the public key and R. Signing is available through Ed25519Sign; the hash is SHA-512 with no domain-separation prefix and an empty context

Example

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

See also

Ed25519Sign, Ed25519PublicKeyFromSeed, Ed448Verify, SetSignProcessEd25519Identity