Contents · Forum Home · StreamSec Tools 4.1.5.363 documentation

Release notes 4.1.3.357

================================================================================
 CHANGES - StreamSec Tools
 (StreamSec Security Library for Embarcadero Delphi)
================================================================================

Newest first. Entries marked BEHAVIOUR CHANGE alter what existing code does
without any source change on your part - read those before upgrading.

WHAT THIS FILE COVERS. Changes made SINCE release 4.1.3.356, which was
released on 2026-08-30. What that release itself brought is in

    CHANGES_4.1.3.356.txt

and every earlier release is archived beside it the same way, one file per
version. So this file is always short: it is the difference between the zip
you have and the one you are looking at, and nothing else.

--------------------------------------------------------------------------------
2026-09-03  THE LEGACY UNIT FAMILIES ARE NO LONGER IN THE DISTRIBUTION;
            HARDWARE AES ON 64-BIT WINDOWS FAULTED BEFORE IT ENCRYPTED A
            SINGLE BLOCK; HARDWARE AES AND GHASH ON DELPHI LINUX64;
            SLH-DSA SIGNATURES ON CERTIFICATES, CRLS AND CERTIFICATION
            REQUESTS; CMS SIGNATURE VERIFICATION FOR EVERY
            KEY TYPE, NOT ONLY RSA; AN SLH-DSA ROOT THAT CAN BE A TRUST
            ANCHOR; A REVOCATION DATE THAT IS OFF BY WHOLE DAYS;
            COMPOSITE ML-KEM KEYS THAT A KEY MANAGER CAN FIND AND USE
================================================================================

The state of the library as it now stands, relative to release 4.1.3.356.


1. NEW - Certificates, CRLs and PKCS#10 requests can be signed and verified
   with SLH-DSA (FIPS 205)

   StreamSec.DSI.PkixSigned gains SLHDSASign beside the existing MLDSASign,
   EdDSASign and CompositeMLDSASign:

       function SLHDSASign(const aSLHDSAKey: iSLHDSAPrivateKey;
                                 aCACert   : iSigned = nil)
                                           : Boolean;

   The method is available on every iSigned descendant - certificate, CRL
   and PKCS#10 certification request - and signs the raw to-be-signed DER
   with an empty context (the hedged variant), as FIPS 205 prescribes for
   pure SLH-DSA. On the verifying side CheckSignature accepts all twelve
   parameter sets, iSignatureAlgorithmIdentifier gains IsSLHDSASignature,
   SignatureDigestAlgorithm reports haNull for them, and the twelve CSOR
   OIDs (2.16.840.1.101.3.4.3.20 - .31) are recognised in the signature
   AlgorithmIdentifier, with absent parameters.

   Interoperability: certificates signed this way verify in OpenSSL 3.5
   (openssl verify -check_ss_sig), and self-signed certificates produced
   by OpenSSL 3.5 (req -x509 with an SLH-DSA key) verify with
   CheckSignature. Both hash families (SHA2 and SHAKE) were tested.

   SLH-DSA suits long-lived trust anchors: its security rests only on
   hash-function security, and it is stateless, so key backup and restore
   procedures cannot cause the state-reuse failures of stateful hash-based
   schemes. Mind the signature size (29792 bytes for SLH-DSA-256s) and the
   signing cost of the 's' parameter sets when choosing where to use it.


2. BEHAVIOUR CHANGE - the revocation date on a CRL entry was wrong by whole
   days

   RevokeCertificate computed the entry's revocationDate as

       Now - OffsetFromUTC

   OffsetFromUTC is expressed in HOURS while TDateTime arithmetic is in days,
   so the value written was displaced by as many days as the machine is hours
   from UTC. On a machine two hours east of UTC every revocation was dated two
   days in the past; WEST of UTC the sign reverses and the date lands in the
   FUTURE, which a relying party may legitimately read as a revocation that
   has not taken effect yet.

   Both overloads in StreamSec.DSI.PkixCRL, and the same two in the older
   stPkixCRL, now divide by 24 as every other date in the library already did.

   Nothing about the fix changes an API. If you have CRLs in circulation that
   were produced with an affected build, the entries in them carry the wrong
   revocationDate and are worth reissuing - the serial numbers they revoke are
   unaffected, so a fresh CRL over the same set is enough.


3. FIXED - a stored Composite ML-KEM private key could not be matched to its
   certificate, so CMS decryption addressed to it always failed

   GetCertOrSPKIFromKey and GetCertOrMPKeyFromKey (StreamSec.DSI.PkixKeyIndex)
   classify a key by asking which interface it supports, in order. A composite
   key exposes neither the bare ML-KEM nor the bare ML-DSA interfaces, and the
   composite ML-DSA branch was present while the composite ML-KEM one was not.

   The consequence: a Composite ML-KEM private key placed in a key manager got
   no SubjectPublicKeyInfo, so the public-key index could not pair it with the
   certificate carrying the same key, and GetCompositeKEMPrivateKey found
   nothing. TstMPEnvelopedData.Decrypt of a KEMRecipientInfo naming a composite
   algorithm therefore returned False - correctly, but for a reason no caller
   could see.

   Both classifiers now probe the composite ML-KEM interfaces, ahead of the
   bare ML-KEM ones for the same reason the composite ML-DSA branch sits there.

   Encryption was unaffected: ImposeRecipient takes the recipient's
   certificate, which already resolved. Only the decrypting side, which has to
   find its own private key from the certificate, was blocked.


4. NEW - an object identifier for MakeSecureContact relay certificates

   stOIDs gains id_msc_relay_policy (id_msc_policy + '.3'), beside the
   email-validation and extended-validation policies already there. Purely
   additive; nothing else moved.


5. FIXED - TstMPSignedData.VerifySignedData could verify RSA signatures and
   nothing else

   StreamSec.DSI.PkixCms cast the signer's public key to iSignPublicKeyIF -
   the RSA interface, which carries the PSS salt length and MGF hash -
   before testing whether the signature algorithm was RSASSA-PSS. Only an
   RSA key implements that interface, so for every other signer the cast
   raised EIntfCastError: ECDSA, EdDSA, ML-DSA and Composite ML-DSA alike.
   The cast now happens inside the PSS branch, which is the only place its
   result was ever used.

   The symptom was not an error message. TstCustomMPSignedData.LoadSigStruct
   catches whatever the load and certificate extraction raise and returns
   False, so VerifySignedData answered "the signature does not verify" with
   CertificateNotFound and IllegalFormat both clear - a bad signature, as far
   as any caller could tell, on a message that was perfectly well signed.


6. FIXED - a certificate inside a CMS SignedData was read before its
   delayed-load structure had been resolved

   TstCustomCertificateManager.ImportFromCMS walked the certificates in a
   SignedData without expanding them first. Every one of them is parsed in
   full a moment later - IsCA, the issuer walk, the chain check and the
   store all read it - so the delayed load saved nothing and cost the walk
   its footing: a subjectPublicKeyInfo whose CHOICE was still unresolved
   raised "Key type is not yet resolved" as soon as its key was touched.
   Composite ML-DSA is where this shows, that CHOICE not being one the lazy
   path settles on its own.

   ImportFromCMS now expands each certificate before reading it. As in
   entry 5, the failure reached the application as a verification failure
   with no reason attached, because LoadSigStruct calls this through
   ExtractCertificates and swallows the exception.


7. FIXED - GetPKI could not derive a key identifier for a Composite ML-KEM
   or an SLH-DSA key

   GetPKI answers the RFC 5280 method-1 subject key identifier for a key, and
   is how a stored private key is paired with the certificate that carries it
   throughout this library. It knew RSA, DSS/EC, ML-DSA, ML-KEM and Composite
   ML-DSA. For Composite ML-KEM and for SLH-DSA it fell off the end of the
   chain of tests with an empty SubjectPublicKeyInfo and then raised
   eASN1Error, 'Key type is not yet resolved', on reading it.

   The practical effect was that a Composite ML-KEM key could be generated,
   enrolled and stored, and then never matched to its own certificate - so
   nothing could be decrypted to it - and that an SLH-DSA key could not be
   matched to its certificate at all. Both now have a branch of their own.

   InternalGetPKI2, which answers the method-2 identifier, still covers only
   RSA and DSS/EC; it is not used for key-to-certificate matching.


8. FIXED - an SLH-DSA certificate could not be added to a trust store, so an
   SLH-DSA root could not be a TLS trust anchor

   TsmX509TrustedCertificates sizes a certificate's key before accepting it,
   so that the LeastKeyBitSize gate has something to compare. The sizing knew
   EdDSA, ML-DSA and Composite ML-DSA - each answered with a nominal
   RSA-equivalent strength, because none of them is an RSA, FF-DH or EC key
   the classic extraction can measure - but not SLH-DSA. An SLH-DSA
   certificate therefore fell through to those probes, all of which fail, and
   was refused.

   The visible effect was that LoadRootCertsFromFile reported that the file
   "held no usable certificate" and the handshake then died unknown_ca: an
   SLH-DSA root could not be installed as an anchor at all, whatever it had
   signed. SLH-DSA now answers by FIPS 205 security category - 3072 for the
   128 parameter sets, 7680 for 192, 15360 for 256 - as the other post-quantum
   families already did. The signature itself is verified by CheckSignature, as
   before; this is only the gate that decides whether to look.


9. FIXED - AES-NI on 64-bit Windows raised an access violation before it
   encrypted a single block

   THIS AFFECTED RELEASE 4.1.3.356 AND NO OTHER. It is a regression
   introduced in that release: 4.1.2.355 and everything before it are free
   of it. If you build for Win64 on 4.1.3.356, upgrade. If you are on an
   earlier release, nothing in this entry changes anything for you.

   THE SYMPTOM. On a CPU with AES-NI, a Win64 build access-violated on the
   first CBC, OFB or GCM operation - which is to say on the first TLS
   record it tried to protect - reading address FFFFFFFFFFFFFFFF, before
   any ciphertext was produced. ECB escaped it, because its bulk path loads
   the schedule with movdqu.

   THE CAUSE. 4.1.3.356 removed the key-stream generator fields from
   tBlockCipher - iGenerateKeyStream, fKeyStreamGenerator and
   fNextKeyStreams. That took 24 bytes out of the ancestor and moved
   tRijndael_ECB.fRk to 8 modulo 16. stAESNI's Win64 assembler reaches the
   round-key schedules with SSE operands that require 16-byte alignment, so
   fRk and fDrk must each begin on a multiple of 16 or the instruction
   raises #GP.

   Nothing in the language expresses that requirement. The {$ALIGN 16} in
   force is a cap, not a floor: a field is placed on the smaller of its
   type's natural alignment and $A, and a round-key schedule is an array of
   UInt32, so the compiler is entitled to place it on 4 - and does. The
   offset is emergent from the size of the ancestor classes, so any field
   added to or removed from one of them moves it.

   THE FIX. stAES.tRijndael_ECB carries an explicit eight-byte padding
   field under WIN64 which restores both offsets, and stAESNI verifies the
   two offsets when the unit initializes: should a later change to an
   ancestor move them again, it raises eCipherError naming both offsets
   rather than registering an implementation that will fault on first use.

   THE PRE-RELEASE TEST RIG HAS BEEN EXTENDED, because the reason this
   reached a release is that nothing asked the right question. Every AES
   harness in the tree was Win32, and each linked all four implementations
   at once, so none of them ever asked whether ONE implementation works on
   ONE platform. There is now a check that builds and runs with a single
   implementation linked - the portable table code, AES-NI, or the
   constant-time code alone - over both Windows platforms and every
   supported compiler, 84 combinations in all; and the mode sweep now
   asserts that every cipher mode the library registers is actually driven
   by a test rather than merely present. A regression of this shape now
   fails a build before a release instead of a customer's first handshake.

   Win32 was never affected - its offset is already a multiple of 16, and
   its assembler loads the schedule through movdqu in any case. Neither an
   API nor any ciphertext changed: an affected build produced no output for
   anything to be compatible with.


10. BEHAVIOUR CHANGE - Delphi Linux64 builds use hardware AES and GHASH,
    and need one more directory on the compiler command line

    On Linux64 this library ran software AES however capable the silicon
    was. Delphi's Linux64 compiler has no inline assembler, so every
    assembler arm in stAESNI and stGHash was compiled out, GetHasAESNI
    answered False, and the cipher registry resolved AES to stAESCT - the
    constant-time implementation - on hardware that had AES-NI all along.

    The instructions now reach that target through two small objects.
    stAESNIFunc.pas and stGHashFunc.pas carry the same SysV assembler the
    library already contained - unit and object include the same
    AesNiSysV*.inc and GHashSysV*.inc files, so there is exactly one copy
    of each instruction sequence - and Free Pascal assembles them into
    stAESNIFunc.o and stGHashFunc.o, which Delphi links by declaration.
    Both objects ship in the release beside the sources.

    WHAT YOU HAVE TO DO. Add the directory holding those two .o files to
    the project's external object and library directories - DCC_ObjPath in
    a .dproj, -O on a dcclinux64 command line. Without it a Linux64 link
    fails with "cannot open stAESNIFunc.o". If you would rather not carry
    the objects, define ST4_NO_LINUX64_AESNI: the build then keeps the
    software path exactly as before and needs no object at all.

    What it buys, from the library's own AES test on one machine, same
    binary and same harness: AES-128 at 1526 MB/s against 29 MB/s for the
    constant-time code. GHASH moves with it, which is what makes the
    difference reach AES-GCM rather than stopping at the block cipher.

    Nothing about the selection rule changed. stAESNI registers where the
    CPU has AES-NI and stAESCT where it does not, exactly as on Windows;
    on Linux64 "has AES-NI" now also requires that the object was linked,
    and both units ask that one question so the two still partition the
    machines between them. A constant-time build still gets stAESCT.


11. BEHAVIOUR CHANGE - the legacy unit families are no longer in the
    distribution

    The units listed below are REMOVED from the release archive. They are
    not maintained and will not be maintained. If you still need one - to
    build a project that has not been updated yet - fetch it from an earlier
    release: every registered user can download every historical
    StreamSec_Tools zip, and the unit is in the last release that carried it,
    exactly as it was. Nothing in these units will change again, so nothing
    is lost by taking them from there.

    For most projects the update is a matter of changing unit names in uses
    clauses; the successor of each unit is given. Where it is more involved
    than that, the support agreement is the route.

    REMOVED                              USE INSTEAD
    stMPArith, stMPArithComp,            StreamSec.DSI.Arith, .ArithComp,
      stMPCustomKeyFormat,                 .CustomKeyFormat, .DiscreteLog,
      stMPDiscreteLog, stMPECArith         .ECArith
    stMPEC, stMPEC_NISTCurves,           StreamSec.DSI.ECC, .ECC.NISTCurves,
      stMPEC_X9_62Curves                   .ECC.X9_62Curves
    stMPFF, stMPIF, stMPKeyAgreement     StreamSec.DSI.FFC, .IFC
    stMPKeyManager, stMPKeyStorageDB,    StreamSec.DSI.PkixKeyManager,
      stMPKeyStorageFile                   .KeyStorageDB, .KeyStorageFile
    stMPSecretSharing                    StreamSec.DSI.SecretSharing
    stMPYarrow, stYarrow, stGlobalYarrow stDrbgAesCtr (RawRandom itself is
                                         declared in stRandom)
    stSSH* - all 27 - and stSocketSSHReg StreamSec.SSH.* under the same names
    stRijndael, stRijndaelBase,          stAES, with stAESNI / stAESCT
      stRijndaelBG and its Rijndael*.inc
    stPkixCert, stPkixCRL, stPkixSigned  StreamSec.DSI.PkixCert, .PkixCRL,
                                         .PkixSigned
    stPkcs1, stPkcs10, stPkcs1Format     StreamSec.DSI.Pkcs1, .Pkcs10,
                                         .Pkcs1Format
    stCAPIFormat, stNETFormat,           StreamSec.DSI.CAPIFormat, .NETFormat,
      stTextFormat, stX509Format,          .TextFormat, .X509Format, .PKCReg
      stPKCReg
    stCMSAlgorithms                      StreamSec.DSI.CMSAlgorithms
    stJwaWinsock2, stJwaWS2tcpip,        stWinsock2
      stJwaQos
    stThreadSafeQueue                    nothing - it served a feature that
                                         was withdrawn
    stVarMpInt; stASN1Syntax             StreamSec.DSI.Arith; stASN1Base

    The packages for Delphi 5 through XE2 - StrSecIV50 to StrSecIV160 and
    their design-time packages - go with them, and so do the demo folders for
    those same versions. The supported packages remain StrSecIV170 through
    StrSecIV370, and the demos ship for Delphi XE3 through Delphi 13.

    stHelix stays in the distribution, but it is deprecated and is not
    recommended for new work.

    The demos that still used stRijndael, stRijndaelBG or stGlobalYarrow --
    the Hash family, the ECDSA demo, and the Snif and SFTP demos -- now use
    stAES and stDrbgAesCtr.

    The SBOM no longer lists the JEDI Winsock headers or the NexusDB
    lock-free list, since neither source is in the distribution any more.


12. FIXED - StreamSec.DSI.SecretSharing was in one package only

    The Shamir secret-sharing unit - the successor of stMPSecretSharing, and
    what the Secret Sharing demo is built on - was in the contains clause of
    StrSecIV180 (XE4) and no other package, although the unit and the demo
    ship for every supported version. On the other thirteen the demo could
    only build with a source path to the unit. It is now in every runtime
    package, StrSecIV170 through StrSecIV370.