Contents · Forum Home · StreamSec Tools 4.1.5.363 documentation

stAESNI

DELPHI LINUX64: THE INSTRUCTIONS ARRIVE IN A LINKED OBJECT, NOT INLINE.

  dcclinux64 cannot assemble (E1025) and ver.inc forces PUREPASCAL there, so
  every arm above is compiled out and this unit would answer "no AES-NI" on
  silicon that has it - about 197x on the raw block rate. stAESNIFunc.pas
  carries the SAME SysV bodies (the identical AesNiSysV*.inc files this unit
  includes), FPC assembles them into stAESNIFunc.o, and the routines below
  are reached by an external declaration. See the LINUX64 block above the
  unit clause for the build recipe and why $L and $LINK cannot be used.

  CONSEQUENCE FOR A LINUX64 BUILD: stAESNIFunc.o must be on the object path
  (-O, or DCC_ObjPath in a .dproj) or the link fails. It ships in Beta.xml
  beside the sources. Define ST4_NO_LINUX64_AESNI to opt out and keep the
  software path, which needs no object.

  These bodies load every round key with movdqu, because FPC guarantees no
  field alignment - which is what every other arm does too, so no arm of
  this unit needs the schedule aligned.

Feature notes: TLS implementation notes (RFC map) · SSH implementation notes

Classes, interfaces and records

classtRijndael_ECB

inherits from stAES.tRijndael_ECB

procedure SetUp(const aKey; aCount: Integer); override; class function ConstantTime: Boolean; override;
Always True. AESE/AESD and their x86 equivalents take fixed time and touch no secret-indexed memory, and this class refuses to run at all where they are unavailable - see the implementation.

classtRijndael_CBC

inherits from tRijndael_ECB

class function Mode: tCipherMode; override;
Returns cmCBC, see tCipherMode.
class function BlockVectorSize: Integer; override;
Always returns 1.

classtRijndael_CFB

inherits from tRijndael_ECB

class function Mode: tCipherMode; override;
Returns cmCFB, see tCipherMode.
class function BlockVectorSize: Integer; override;
Always returns 1.
property ModeRatio;

classtRijndael_OFB

inherits from tRijndael_CFB

class function Mode: tCipherMode; override;
Returns cmOFB, see tCipherMode.
class function BlockVectorSize: Integer; override;
Always returns 1.

classtRijndael_CTR

inherits from tRijndael_CFB

class function Mode: tCipherMode; override;
Returns cmCTR, see tCipherMode.
class function BlockVectorSize: Integer; override;
Always returns 1.

classtAES_Wrap

inherits from tRijndael_ECB

implements iKeyWrap

class function Mode: tCipherMode; override;
Returns the value of cmAESWrap.
class function BlockSize: Integer; override;
Always returns 8.
function Decrypt(var Buf; var Count: Integer): Boolean; override; function Encrypt(var Buf; var Count: Integer): Boolean; override;

classtRijndael_CCM

class function BlockVectorSize: Integer; override;
Always returns 2.
class function Mode: tCipherMode; override;
Returns cmCCM, see tCipherMode.

classtRijndael_EAX

class function BlockVectorSize: Integer; override;
Always returns 3.
class function Mode: tCipherMode; override;
Returns cmEAX, see tCipherMode.

classtRijndael_GCM

class function BlockVectorSize: Integer; override;
Always returns 2.
class function Mode: tCipherMode; override;
Returns cmGCM, see tCipherMode.
procedure SetUp(const aKey; aCount: Integer); override;

classtRijndael_SSH

class function BlockVectorSize: Integer; override;
Always returns 1.
class function Mode: tCipherMode; override;
Returns cmSSH, see tCipherMode.

classtRijndael_SSHCTR

class function BlockVectorSize: Integer; override;
Always returns 1.
class function Mode: tCipherMode; override;
Returns cmSSHCTR, see tCipherMode.

classtRijndael_SSHGCM

class function BlockVectorSize: Integer; override;
Always returns 2.
class function IVLength: Integer; override;
Always returns 12.
class function Mode: tCipherMode; override;
Returns cmSSHGCM, see tCipherMode.