Ed25519PublicKeyFromSeed

Cryptography, digital signatures

Description

Derives the 32-byte Ed25519 public key from a 32-byte seed

Syntax

Delphi

Function Ed25519PublicKeyFromSeed(Const Seed: AnsiString; Out PublicKey: AnsiString): Boolean;

Return values

FalseSeed is not 32 bytes and PublicKey is set to an empty string
TruePublicKey holds the 32-byte encoded edwards25519 point

Remarks

Hashing is SHA-512(seed); the first 32 digest bytes are clamped by clearing the three lowest bits of byte zero, clearing bit 255 and setting bit 254 of byte 31, and multiplied by the edwards25519 base point. The key packs the result as the 32-byte little-endian y coordinate with the sign bit of x stored in bit 255. RFC 8032 Ed25519 PureEdDSA uses SHA-512 with no domain-separation prefix and an empty context; the matching signer is Ed25519Sign and the matching verifier is Ed25519Verify

Example

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

See also

Ed25519Sign, Ed25519Verify, Ed448PublicKeyFromSeed, SetSignProcessEd25519Identity