Contents · Forum Home · StreamSec Tools 4.1.5.363 documentation

StreamSec.DSI.EdDSA

The EdDSA pool and the seed-based EdDSA keys.

  tDSIEdDSA implements iDSIED and carries the ONLY real implementation of the
  EdDSA signature/verification schemes, as overrides of the protected virtual
  SignaturePrimitive_EdDSA/VerificationPrimitive_EdDSA methods of tDSIDLArith
  (which raise in every other pool). The pool is registered with PKTypes in
  this unit's initialization; obtain it via GetDSIED.

  The key classes (iEdDSAPrivateKey/iEdDSAPublicKey, declared in
  StreamSec.DSI.PKTypes) form a class of their own: their SignScheme is
  pinned to dlssaEdDSA and cannot be changed, and the EdDSA dispatch in
  StreamSec.DSI.DiscreteLog only accepts keys implementing the EdDSA key
  interfaces - so EdDSA and every other scheme are mutually exclusive by
  construction. The private key is the RFC 8032 seed (32 bytes for Ed25519,
  57 for Ed448); the secret scalar and prefix are derived per operation.

  The curve arithmetic (field elements, the branchless Edwards ladder, the
  point codec and the curve classes) lives in StreamSec.DSI.CurveEdArith;
  hashing is accessed through stSecUtils (SHA-512 via the hash class
  registry, SHAKE256 via stSHA3).

Classes, interfaces and records

classtEdDSAPrivateKey

inherits from tDLPrivateKey

implements iEdDSAPrivateKey

constructor Create(const aPool: iDSIDLArith; const aParams: iDiscreteLogField); destructor Destroy; override; function NewKeys(const aParams: iDiscreteLogField): iGroupElement; overload; override;
generates a fresh random seed for the curve in aParams
function PublicKey: iGroupElement; overload; override;
RFC 8032 public key derivation from the seed
function Validate(const aPubl: iDLPublicKey): Boolean; overload; override; property Seed: tBytes read GetSeed write SetSeed;

classtEdDSAPublicKey

inherits from tDLPublicKey

implements iEdDSAPublicKey

constructor Create(const aPool: iDSIDLArith; const aParams: iDiscreteLogField);

classtDSIEdDSA

inherits from tDSIDLArith

implements iDSIED

class function CreatePrivateKey(const aPool: iDSIDLArith; const aParams : iDiscreteLogField): iDLPrivateKey; override;
Delegates to tEdDSAPrivateKey.Create, forwarding aPool and aParams, and returns its result.
class function CreatePublicKey(const aPool: iDSIDLArith; const aParams : iDiscreteLogField): iDLPublicKey; override;
Delegates to tEdDSAPublicKey.Create, forwarding aPool and aParams, and returns its result.
function IsNonTrivialFieldElement(const aElement: iGroupElement; const aParams : iDiscreteLogField) : Boolean; override; function IsGroupElement(const aElement: iGroupElement; const aParams : iDiscreteLogField) : Boolean; override; function FieldElementToBytes(const aElement : iGroupElement; const aParams : iDiscreteLogField; const aDst : tBytes; aDstOffset: Integer; var aDstCount : Integer) : Boolean; override;
Delegates to aParams.FieldElementToBytes, forwarding aElement, aDst, aDstOffset and aDstCount, and returns its result.
function BytesToFieldElement(const aSrc : tBytes; aSrcOffset, aSrcCount : Integer; const aParams : iDiscreteLogField) : iGroupElement; override;
Delegates to aParams.BytesToFieldElement, forwarding aSrc, aSrcOffset and aSrcCount, and returns its result.