API Reference
stGHash
GHash Unit
DELPHI LINUX64: PCLMULQDQ ARRIVES IN A LINKED OBJECT. The companion to
stAESNI's AESNI_EXTOBJ gate - hardware AES without hardware GHASH would
spend the win on the authenticator. stGHashFunc.o must be on the object
path (-O / DCC_ObjPath); ST4_NO_LINUX64_AESNI opts both out together, since
they are one decision. See the LINUX64 block at the top of stAESNI.pas.
Classes, interfaces and records
classtGhash
class function New(const aKey: iBlockEncryptor): tGHash;
Hardware GHASH when the CPU has PCLMULQDQ, else the constant-time software implementation - or, under ST4_NO_GHASH_CT, the table one.
class function NewConstantTime(const aKey: iBlockEncryptor): tGHash;
Forces the constant-time software implementation (tests, policy). Under ST4_NO_GHASH_CT there is no such implementation, so this returns the hardware one where the CPU has it and NIL where it does not - never the table. CHECK THE RESULT if you build with that define.
class function NewTable(const aKey: iBlockEncryptor): tGHash;
The historical table implementation. Its lookups are indexed by SECRET bytes (cache-timing variable) - reference/testing only.
destructor Destroy; override;
procedure SetBlockKey(const aKey); virtual; abstract;
procedure Init;
procedure CalcA(const aBuf; aLength: Integer);
procedure FinalA;
procedure CalcD(const aBuf; aLength: Integer);
procedure FinalD(out aHash);
procedure GetState(out aState);
Types (enumerations, sets, aliases)
arraytBlock
tBlock = array [0..cBlockLength-1] of Byte;