Feature notes: Asynchronous QUIC server and HTTP/3 component
Cipher: tQuicPacketCipher;
Hash: tHashClass;
Secret, NextSecret, HeaderKey: TBytes;
Current, Next: tQuicPacketProtection;
One externally serialized instance serves both 1-RTT directions. It owns independent secrets and a bounded current/next/previous receive-key set. The original header keys survive packet-key updates. Input arrays are shared read-only; successful output arrays are independent.
Times are monotone microseconds. SetContext precedes packet operations. PacketSent is only for successful UDP transmission. AcknowledgmentReceived requires ACK ranges already checked against the complete sent history. The first local update also requires a current-phase ACK. Subsequent local updates wait three PTO after confirmation and previous read-key expiry. Failed authentication never derives keys or promotes a key phase.
Optional limits may only reduce RFC 9001 limits. Zero selects the standard bound; a nonzero bound of at least two leaves one encryption for closing. No TLS KeyUpdate handshake message is generated or consumed here.
constructor Create(aVersion: Cardinal; aConfidentialityLimit: UInt64 = 0; aIntegrityLimit: UInt64 = 0);
destructor Destroy; override;
procedure Clear;
procedure Install(aIncoming: Boolean; aCipher: tQuicPacketCipher; aHash: tHashClass; const aSecret: TBytes);
function HasKeys(aIncoming: Boolean): Boolean;
procedure SetContext(aNowMicros, aPtoMicros: UInt64; aHandshakeConfirmed: Boolean);
procedure Tick(aNowMicros: UInt64);
function NextDeadline(out aDeadline: UInt64): Boolean;
function Initiate: Boolean;
function Seal(const aHeader, aPayload: TBytes; aPacketNumber: UInt64; aPacketNumberOffset: Integer): TBytes;
function SealMayUpdate: Boolean;
function Open(const aPacket: TBytes; aPacketNumberOffset: Integer; aExpectedPacketNumber: UInt64; out aHeader, aPayload: TBytes; out aPacketNumber: UInt64): Boolean;
procedure PacketSent(aPacketNumber: UInt64; const aPayload: TBytes; aNowMicros: UInt64);
procedure AcknowledgmentReceived(const aFrame: tQuicFrame);
procedure FailedAuthentication;
property ReadGeneration: UInt64 read fReadGeneration;
property WriteGeneration: UInt64 read fWriteGeneration;
property AuthenticationFailures: UInt64 read fAuthenticationFailures;
property PreviousKeysRetained: Boolean read fHasPreviousDeadline;
property IntegrityExhausted: Boolean read fIntegrityExhausted;