Contents · Forum Home · StreamSec Tools 4.1.5.363 documentation

stEntropySource

ENTROPY_ASSESSMENT and ENTROPY_CALIBRATE are lab/installer build defines and
  must NEVER be defined in a shipping product build: ENTROPY_ASSESSMENT writes
  the raw noise samples to disk, and ENTROPY_CALIBRATE taps the raw noise source
  in memory for install-time calibration. (Deliberately NOT a $MESSAGE WARN
  directive: that would fire on the legitimate lab/installer builds too.)

Feature notes: DRBG and entropy source (SP 800-90) notes

Classes, interfaces and records

classtEntropyContext

inherits from TInterfacedObject

constructor Create; destructor Destroy; override; procedure Die; property Health: tEntropyHealthMonitor read fHealth;
fed and polled on the controller thread only
property Capture: tEntropyRawCapture read fCapture;
written on the controller thread; CopyReduced any time, SaveToFiles (if compiled -- ENTROPY_ASSESSMENT only) once Complete

classtEntropy

inherits from tBaseEntropy

constructor Create; destructor Destroy; override; class function SelfTest: Boolean; override;
Returns the value of GetHasTSC.
function Health: tEntropyHealthMonitor;
SP 800-90B health-test state; diagnostic reads only (the monitor runs on the internal controller thread)
function Capture: tEntropyRawCapture;
Raw-sample recorder; assessment / calibration builds only (see stEntropyHealth). Poll Complete, then CopyReduced (calibration) or SaveToFiles (assessment only).

Types (enumerations, sets, aliases)

typetEntropyEvent

  tEntropyEvent = THandle;

typetEntropyEvent

FPC: PEventState + the System-unit BasicEvent* API. NOT RTLEvent - that is auto-reset and its WaitFor cannot report a timeout, whereas this event is created MANUAL-reset and EvWait must distinguish signalled from timed out. Also avoids fcl-base SyncObjs, which links pthread/libc directly and so cannot be used by the libc-free big-endian targets.

  tEntropyEvent = {$IFDEF FPC}PEventState{$ELSE}TEvent{$ENDIF};

arraytHashMatrix

  tHashMatrix = array [0..cCollectors-1,0..cCollectChains-1] of tSHA256;

arraytTscMatrix

Inner dimension is dynamic (was 0..cCollectIterations-1) so the per-round sample count is settable at construction; sized to fIterations in Create.

  tTscMatrix = array [0..cCollectors-1,0..cCollectChains-1] of array of Int64;