All notable changes to this project are documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[Summary]
StormByte Crypto is the cryptography module of the StormByte C++ suite.
It depends on StormByte Base 3.0.0, StormByte Buffer 4.0.0, StormByte-Logger 3.0.0 and StormByte System 3.0.0. Base, Logger and System are declared here: Buffer no longer brings them as submodules. This repository is not Base, Buffer, Config, Database, Logger, Multimedia, Network or System.
Public headers under StormByte/crypto/ cover Hasher, Compressor, Crypter (symmetric and asymmetric), Signer, Secret, KeyPair, X509, Random, Password, Vault and TLS sessions. Crypto++ and OpenSSL remain private backends; installed headers expose neither library's types.
If you landed here from a release link and have not read the tree:
- What this module is, how to build it, and short examples: README.md
- License: GNU Lesser General Public License version 3 or later, LICENSE
3.1.0 - 2026-11-10
Changed
- Require StormByte-Buffer 4.0.0. Crypto's FIFO and Producer/Consumer stream APIs retain their existing signatures; Crypto does not use Buffer's removed scalar IO constructors, virtual policy overrides or changed Hopper/Sink state.
3.0.2 - 2026-11-09
Fixed
- Fix TLS test certificate creation with OpenSSL 4.x by constructing the subject name separately and assigning it with X509_set_subject_name, preserving compatibility with OpenSSL 3.x.
3.0.1 - 2026-11-06
Added
- Add TLS::Session::FailureDetail() for a persistent per-session failure explanation and TLS::DescribeSessionError() for typed error descriptions. Certificate verification reasons and codes, identity mismatch, revocation failures and OpenSSL engine reasons remain available to transport consumers without automatic output, environment switches or public object-layout changes.
Fixed
- Use the bundled TLS roots as the exclusive trust anchors on every platform. Windows and macOS retain native chain and TLS policy validation without additionally requiring the root to be installed or trusted in the system store. This fixes valid public TLS connections failing on Windows with an incomplete system chain, while preserving offline validation, identity checks and public ABI compatibility.
3.0.0 - 2026-11-04
Added
- Install FindStormByteCrypto.cmake so Base 3.0.0 can discover Crypto with its Buffer, Logger and System dependencies. Verify consumers against an installed prefix and an extracted release ZIP.
- Add X.509 APIs to require an explicit code-signing EKU (and digital-signature key usage when present), match a unique subject common name, and verify DER-encoded detached ECDSA/SHA-384 signatures. Callers must still validate the certificate chain and validity separately.
Changed
- Breaking: Require Base, Logger, System and Buffer 3.0.0 and BuildMaster 2.1.5.
- Select dependency archives and publish Linux releases by architecture, libc and C++ standard library.
- Build and test the Linux amd64/arm64, glibc/musl, and GCC/libstdc++ or Clang/libc++ variants.
- Compile the bundled Crypto++ ARMv8 SIMD sources with the per-file ISA flags upstream uses, enabling the CRC32, AES, PMULL and SHA hardware paths on Linux ARM64.
Fixed
- Detect ARM64 CPU features through getauxval() on musl. The bundled Crypto++ only queried it with glibc, so Alpine builds never selected PMULL.
- Work around the GCC/fortify-headers link failure on affected Alpine toolchains without disabling LTO or fortify.
- Use the correct : separator when combining PGO runtime library paths, preserving inherited paths on musl.
- Reconfigure automatically when VERSION changes.
- Preserve compiler optimization defaults in manual Release builds; CPU selection comes from the toolchain and ENABLE_LTO remains independently configurable.
2.3.1 - 2026-11-02
Changed
- Update published StormByte Suite dependencies to Base 2.2.3, Logger 2.0.6, System 2.1.3 and Buffer 2.0.6.
- Rebuild release packages against the refreshed Base, Logger, System and Buffer releases, including their final audit fixes.
Fixed
- TLS clients using TrustSource::Bundled (the default) now load the embedded Mozilla roots into the OpenSSL verification store. Previously the roots were only kept for the post-verification path check, so OpenSSL could never build a chain and every handshake against a public server failed with SessionError::PeerRejected.
2.3.0 - 2026-10-31
Added
- OpenSSL-backed TLS 1.3 client/server sessions via <StormByte/crypto/tls/session.hxx>. WITH_OPENSSL=BUNDLED uses pinned OpenSSL 3.5.9 and its pinned CMake port as private static dependencies; WITH_OPENSSL=SYSTEM uses OpenSSL 3.0+ shared libraries. OpenSSL types remain absent from the public API and bundled symbols are hidden from the shared-library interface. Sessions exchange ciphertext and plaintext exclusively through bounded caller buffers, with trust-source selection, SAN identity verification, TLS 1.3 RSA-PSS, ALPN, optional mTLS, caller-supplied revocation evidence, backpressure and close-notify handling. No socket or other network I/O is performed in Crypto. Dynamic-key in-memory integration tests cover fragmented handshake, policy negotiation, bidirectional data, mTLS, identity/revocation rejection, output backpressure, protocol-alert draining and shutdown.
- Register TLS RSA-PSS/SHA-256 (0x0804) alongside P-256 ECDSA/SHA-256 in the TLS policy profile and OpenSSL adapter. RSA-PSS applies to TLS 1.3 handshake signatures; existing standalone RSA signing formats are unchanged.
- Versioned, SHA-256-verified Mozilla-derived TLS server-root data with MPL-2.0 redistribution notice, pinned provenance and complete trust/distrust selection manifest. X509::ValidateBundledTLSPath is explicitly path-only: Linux uses no distro/environment/system CA files and retains the ordered constrained verifier; Windows/macOS intersect exclusive bundled-anchor admission with independent native TLS/system trust policy and the same terminal root. Separate custom-CA mode cannot widen production trust. Offline public PayPal RSA chains pass Linux bundled path validation; native isolated tests are prepared for CI. X509::RevocationVerifier verifies caller-supplied bounded DER CRL/OCSP evidence offline; VerifyPaymentPeer requires fresh signed Good evidence for each non-anchor certificate and fails closed on missing, stale, unsupported, mismatched, unauthorized, unknown or revoked evidence. OpenSSL-generated disposable-key fixtures cover direct and delegated OCSP responders and CRL/OCSP status handling without a runtime OpenSSL or network dependency. Unsupported CRL scope/extensions and OCSP response/per-certificate extensions (including nonce) are deliberately rejected; a network caller must not request a nonce unless nonce binding is implemented. TLS RSA-PSS and proof of key possession remain outside this path-and-revocation API, so it is not complete TLS peer authentication. Trust updates require future published versions, not automatic network retrieval.
- Additive offline X509::TLSPeerVerifier::Verify composition: explicit ordered chain, caller-selected anchor/time, mandatory server DNS/binary-IP identity or optional client identity, leaf signing KU and chainwide role EKU, strict issuer CA/pathLen/KU, and bounded SHA-2 RSA/ECDSA certificate algorithms/keys. Indexed Safe-owned failures preserve purpose and identity details. Unprocessed critical extensions and unsupported name/policy/proxy/TLS Feature restrictions fail closed; noncritical benign hints and unrequested policy assertions are not blanket-rejected. Anchor certificate restrictions are documented local policy, not self-signature trust. Independent disposable public CA/leaf fixtures and a new test target cover positive and negative chains, identity, constraints, exact time boundaries and lifecycle. Existing certificate parsing, VerifyChain, tests and license semantics are unchanged. Not full RFC 5280, revocation, a TLS handshake or public HTTPS-ready authentication.
- Narrowly scoped X509::Certificate::VerifyTLSPurpose(X509::TLSRole) with typed PurposeError results: missing EKU/KU is unrestricted; present EKU requires explicit serverAuth/clientAuth for the role (anyExtendedKeyUsage alone is insufficient under RFC 5280's permitted explicit-purpose policy); present KU requires digitalSignature for both TLS 1.3 roles. The complete EKU sequence and all OIDs, and strict KU named-bit-string DER, are validated before success. Unknown well-formed purpose OIDs are allowed but do not grant a role. Independent EC/RSA disposable public fixtures and purpose tests cover usage, malformed encodings, duplicates and Safe lifecycle. Existing parsing, HasKeyUsage, chain and SAN behavior is unchanged; purpose validation alone is not trust, leaf classification or peer authentication.
- Strict X.509 subjectAltName extraction and expected-identity verification on X509::Certificate: SubjectAltNames() returns dNSName and iPAddress entries, VerifyDNSName() and VerifyIPAddress() compare caller-supplied identities, with typed X509::IdentityError results. The whole extension is validated (malformed entries fail even if another matches), the common name is never a fallback, DNS matching is ASCII case-insensitive with one trailing dot normalized and wildcards limited to a complete leftmost label over one non-empty label, IDN names must be supplied as ASCII A-labels, and IP matching is exact over 4 or 16 binary bytes. This only compares names: it is not chain, EKU or TLS peer authentication, and existing parsing and VerifyChain behavior is unchanged.
- Configurable TLS 1.3 policy via <StormByte/crypto/tls/policy.hxx>: registered AES-GCM/SHA-256 or SHA-384 suites, X25519/P-256 groups and P-256 ECDSA/SHA-256 or RSA-PSS/SHA-256 signature schemes, fixed suite-to-primitive definitions, ordered Safe preference lists, typed validation and immutable Base-owned policy snapshots. The TLS session engine applies the validated preferences without legacy-version fallback.
- Raw-key one-shot AES-128-GCM and AES-256-GCM via <StormByte/crypto/aead.hxx>: explicit 12-byte nonce and binary AAD, detached Safe::Binary ciphertext and full 16-byte tag, typed validation/authentication/backend errors, and independently owned wiped Safe::SecureBinary plaintext returned only after complete authentication. No password derivation, envelope or nonce management; existing crypters are unchanged.
- One-shot binary HMAC-SHA-256 and HMAC-SHA-384 via <StormByte/crypto/hmac.hxx>. Keys use wiped Secure::Password storage, results are full-length Safe::Binary tags, and verification compares tag bytes in constant time while rejecting truncated or oversized tags.
- RFC 5869 HKDF-Extract and HKDF-Expand for SHA-256 and SHA-384 via <StormByte/crypto/hkdf.hxx>. Input key material, PRKs and derived keys use wiped Secure::Password storage; binary salt and info are accepted as borrowed spans. Empty salt follows RFC 5869's HashLen-zero-byte rule, empty IKM/info and zero-length output are valid, short PRKs and outputs over 255*HashLen return typed errors.
- Add WITH_OPENSSL=BUNDLED|SYSTEM backend selection. Bundled mode is the default and uses the pinned static backend; System mode requires OpenSSL 3.0+ and links its shared libraries. Windows forces Bundled, and CI/release configure it explicitly.
Changed
- Reorganize existing stream-error regression tests into the relevant SHA, symmetric-cipher, RSA and ECC test executables, removing the standalone StreamErrorTests target.
Fixed
- Avoid installing a separate TLS trust-data directory: roots are embedded in the library, and the required Mozilla MPL notice installs directly in the prefix.
- Propagate upstream consumer errors in streaming encryption, decryption and hashing instead of treating them as clean EOF and finalizing successfully. Add regression coverage for all six symmetric ciphers, RSA/ECC Native and Hybrid streams, and all six hash algorithms in Copy/Move modes, including initial and delayed errors and clean controls.
2.2.1 - 2026-10-28
Changed
- Bundled builds use Base 2.2.2, Buffer 2.0.5, Logger 2.0.5 and System 2.1.2. Require BuildMaster 2.1.3 and pin its bundled submodule to the published release.
2.2.0 - 2026-10-26
Added
- X509::Certificate (StormByte/crypto/x509/certificate.hxx): strict DER/PEM parsing via X509::Load/LoadAll and Certificate::Parse, PEM/DER Save, field accessors (version, serial, subject/issuer common names, validity, basicConstraints, keyUsage, PublicKey() as a public-only KeyPair), IsIssuedBy and VerifyChain up to a trusted anchor. Verifies ecdsa-with-SHA256/384/512 and sha256/384/512WithRSAEncryption, validity periods, CA flag, keyCertSign, path length constraints and unknown critical extensions. Revocation and name constraints are not processed.
- In-memory key persistence: KeyPair::Generic::SavePublic(format) and SavePrivate(format[, password]) return the encoded key as a StormByte::Safe::SecureBinary, and KeyPair::Load gains const SecureBinary& overloads for a single key, a public/private pair (an empty buffer means absent) and their password variants. Keys can come from a database, a network message or #embed without touching the filesystem.
Changed
- The file Save/SavePublic/SavePrivate/Load overloads now delegate to the in-memory ones, so a file holds exactly the bytes the memory API returns. Their observable behavior is unchanged.
2.1.1 - 2026-10-24
Changed
- Bundled third-party StormByte dependencies now require the matching patch releases (Base 2.2.1, Buffer 2.0.4, Logger 2.0.4, System 2.1.1 where applicable) so a bundled build picks up the /arch:AVX change.
Changed
- Windows Release optimizations use /arch:AVX instead of /arch:AVX2. The previous baseline required a Haswell-or-newer CPU (AVX2). /arch:AVX runs on Sandy Bridge and Ivy Bridge (including the i7-3770K) and later.
2.1.0 - 2026-10-23
Added
- Public StormByte::Crypto::Random::Bytes(ByteSize) and Random::Text(Size) in <StormByte/crypto/random.hxx>. They return independently owned Safe::SecureBinary and Safe::String, using the existing per-thread cryptographic RNG. Bytes use auto-wiped storage with best-effort memory locking; text is not automatically wiped or locked. Text uniformly samples ASCII 33-126 (no spaces). Zero sizes and provider failures throw Random::Exception under StormByte.Crypto.Random; failures never return partial results, and temporary provider storage is wiped. Allocation errors propagate unchanged.
- Random API tests cover exact lengths, ASCII bounds, independent storage, zero-size errors, exception paths and value semantics, and random-password regression. An isolated test executable substitutes the provider without production hooks to verify every output byte, text rejection sampling and endpoints, and initialization/generation failures without exposing partial output.
Changed
- Each bundled StormByte component declares its own dependency linkage in its component directory, following Buffer's layout. The parent file only selects/discovers components and links Crypto to them.
- Updated suite dependencies to Base 2.2.1, Buffer 2.0.4, Logger 2.0.4 and System 2.1.1. All binary dependencies now target Base 2.2.1; rebuilding Crypto and its consumers is required because Base changed the Safe::Binary ABI.
- Renamed the private RNG header to rng.hxx and updated every provider include to avoid a public/private random.hxx collision. Crypto's random passwords, salts, IVs and hybrid session keys now reuse the public byte API through a private secure-buffer adapter. The legacy RandomPassword contract, including noexcept and empty passwords at length zero, is unchanged. No other suite component was modified.
2.0.2 - 2026-10-19
Added
- ENABLE_PGO and ENABLE_LTO. Profile-guided optimization trains in pgo-instr and installs this build. Link-time optimization follows ENABLE_LTO (default ON) for every build type. Both apply to Crypto. Base, Buffer, Logger and System are not rebuilt. Windows stays MSVC because Crypto++ does not build with clang-cl.
- Release archives include THIRD-PARTY (not THIRDPARTY: on Windows and macOS that name is the same path as the thirdparty/ directory, so the file never landed in those zips), COPYING.CryptoPP and COPYING.bzip2. Crypto++ 8.9.0 (843d74c7) and libbzip2 1.0.8 (6a8690fc) are compiled into the shared library. The notices are the upstream texts of those commits. Base, Buffer, Logger and System stay separate shared libraries.
Changed
- CI builds with ENABLE_LTO=ON, ENABLE_PGO=OFF and ENABLE_TEST=ON, then runs ctest. Profile-guided optimization stays on the release workflow.
- cmake/optimizations.cmake is the same file as Base. On Release, and only when that language was not set from the outside, it appends OPTIMIZATION_FLAGS_LINUX, OPTIMIZATION_FLAGS_MAC or OPTIMIZATION_FLAGS_WINDOWS. Linux is -O2 -march=x86-64-v3, Apple is -O2 -mcpu=apple-m1, Windows is /O2 /arch:AVX2. There is no /fp:fast and no /EHsc. cmake/pgo.cmake is the same file as Base, so a forwarded list keeps its semicolons. MSVC PGO links with /LTCG:PGINSTRUMENT and /LTCG:PGOPTIMIZE. /GENPROFILE alone fails with LNK1220 because the current link.exe requires an /LTCG specification, and CMake's own /LTCG stays off so it does not replace the profile mode. The profile mode is add_link_options on this project, not CMAKE_EXE_LINKER_FLAGS. A nested project() inherits the cache and its compiler test links cmTC_*.exe, which was never instrumented, so /LTCG:PGOPTIMIZE aborted with LNK1266 (cmTC_*.pgd missing). The cache keeps a bare /LTCG so those /GL objects still link. A static dependency stays LTCG and is optimized by the link that owns the .pgd.
- Requires StormByte-BuildMaster >= 2.1.0. An older install is not used; the buildmaster submodule supplies 2.1.0.
- Requires StormByte Base 2.1.0, StormByte Buffer 2.0.2, StormByte-Logger 2.0.2 and StormByte System 2.0.2. Each is a release archive (stormbyte_component_url) linked with BACKEND=binary. Base, Logger and System are declared here because Buffer no longer vendors them. The archive matches this OS and C++ runtime: libstdc++ or libc++ on Linux and macOS, no runtime suffix on Windows. Doxygen include path is ${BUILDMASTER_INSTALL_INCLUDEDIR}.
- Breaking: Crypto exceptions no longer format with std::format. A message with arguments replaces literal {} through Safe::String::ReplaceToken, the same rule as Base 2.1.0. what() stays StormByte.Crypto: message, and a child segment is only the part under Crypto (StormByte.Crypto.Hasher, StormByte.Crypto.Secure.Vault).
- Bumped project version to 2.0.2.
- Symmetric key derivation is always PBKDF2-HMAC-SHA256 with 600000 iterations. STORMBYTE_CRYPTO_INSECURE_PBKDF2_ITERATIONS_FOR_CI is gone, and CI no longer compiles with it.
- Part of the port: the DLL does not return a std:: object. The Windows fault in Bzip2Tests (i < big.size()) was a null write in StormByte.dll!operator<=>, not Crypto++. clang-cl returns std::strong_ordering through a hidden pointer and MSVC does not pass one. The port requires the rebuilt Base 2.1.0, where that operator is STORMBYTE_FORCE_INLINE and is not an extern template. A signature that must return std:: is STORMBYTE_FORCE_INLINE in the header too. The tests must be recompiled against that archive. An old object file still imports the DLL symbol.
Fixed
- -stdlib=libc++ and -stdlib=libstdc++ do not count as custom C++ flags. If either is the only extra flag, Release still gets -O2 and the CPU baseline.
- Clang PGO drops .profraw files left by compiler probes before ctest, and llvm-profdata merge uses -failure-mode=all. A probe writes a few hundred bytes for main, with a padded empty symbol name. The default failure mode is any, so that one file aborted the merge even after the instrumented tests had passed.
2.0.1 - 2026-10-13
Changed
- Updated dependency pins (BuildMaster and StormByte Buffer).
- Bumped project version to 2.0.1.
2.0.0 - 2026-10-10
Changed
- Breaking: Port public APIs to StormByte Base, Buffer and System 2.0.0.
- Public octet payloads use StormByte::Safe::Binary instead of Buffer DataType / raw vectors. Binary storage is Safe::Vector<std::byte> on Base's heap, not an STL alias; lengths and indices use StormByte::ByteSize. Explicit STL imports and force-inlined exports copy between heaps rather than adopting the source allocation. Abstract counts use StormByte::Size; Password::Size() is ByteSize.
- Polymorphic ownership uses StormByte::Safe::Clonable, MakePointer and Safe::Shared instead of std::shared_ptr. Factories and keypair / signer / crypter / secret constructors take KeyPair::Generic::PointerType; Generate / Load return that pointer type. Public-only views use Safe::Clonable::MakePointer.
- Buffer 2.0 block I/O uses std::span<const std::byte> into Buffer::WriteOnly. Pipelines take Buffer::Consumer and return a consumer; FIFO::Data() is Safe::Binary.
- Borrowed text uses std::string_view for KeyPair leaf constructors, Vault names (Store / Get / Contains / Remove), KeyPair::Generic::Save baseName, and Signer::Verify / DoVerify signatures; owned copies are made inside Crypto where needed. Secret::Generic::Share and its ECDH/X25519 overrides instead borrow const StormByte::Safe::String&, as does the peer-key argument of static X25519::DeriveSharedSecret. Owned public text (PublicKey()) is const StormByte::Safe::String&. Safe and STL strings convert to string_view; conversion back to std::string is explicit (std::string{std::string_view{...}}). Construct a Safe string explicitly when supplying a peer key from a view.
- Breaking: Complete conditional DLL-boundary ownership and provider lifecycle contracts. Binary consumers must rebuild.
- Every public class, including algorithm bases, leaves and exceptions, has an exact STORMBYTE_DECLARE_MAYBE_SAFE declaration. These declarations assert provider responsibility, not certification by Base or registration of consumer-derived types. Clone/Move allocation callbacks stay in Crypto; compatible compiler ABIs and loaded provider modules remain required. Safe components retain their own value requirements, including copyability and default construction where required.
- Public leaf classes are final. Public destructors are declared in headers and defined out of line in .cxx (= default) so vtables and typeinfo stay inside Crypto. KeyPair material construction and value operations also run out of line.
- KeyPair private material and Secret results use Safe::Optional<Password> instead of STL optional layout; private-key byte views retain password snapshots. Secret's Share / DeriveSharedSecret no longer promise noexcept, because constructing a Safe optional result can fail to allocate; invalid keys still return an empty result.
- Persistence exports native-character PathView arguments and keeps std::filesystem::path access in force-inlined caller adapters, preserving native Unicode paths on Windows, Linux and macOS.
- The SecureContent forward declaration matches its class definition, avoiding struct/class ABI mismatches under MSVC and clang-cl.
- Breaking: Rework secure password ingestion, storage and namespaces.
- Password and Vault move to StormByte::Crypto::Secure (StormByte/crypto/secure/{password,vault,exception}.{hxx,cxx}). Crypto::VaultException becomes Crypto::Secure::VaultException (what() is StormByte.Crypto.Secure.Vault: message); Secure::Exception is StormByte.Crypto.Secure. ExpectedPassword lives next to Vault. The old StormByte/crypto/password.hxx and StormByte/crypto/vault.hxx headers are gone.
- Password uses Safe::Shared for its private secure-buffer owner; the last owner wipes the bytes. Empty default construction allocates no storage, compares equal to other empty passwords and supports Safe::Vector, Safe::Optional and Safe::Queue.
- Password accepts borrowed std::string_view and ceded mutable Safe::String&, not a dedicated std::string& or by-value STL string. Both copy the full length, including embedded NUL bytes, into wiped storage without adopting source allocations. The Safe overload overwrites and clears its source using Base-owned text storage; the view overload leaves its source untouched and the caller remains responsible for wiping it.
- Literals use explicit Password(const char*), stop at the terminator and are not wiped. Raw bytes (const void* + ByteSize) are copied and not wiped.
- Vault directly contains Safe::Map<Safe::String, Password> with Base-owned storage, not an STL store or a Safe::Unique PIMPL. Construction, movement, assignment and destruction are exported by Crypto; moved-from vaults remain empty and reusable. Named operations construct Safe keys from borrowed views and no longer promise noexcept; Clear, Size and Empty remain noexcept, with Size returning StormByte::Size. Returned passwords retain shared ownership after removal or clearing. Vault remains move-only and is not a SafeValue collection element.
- Port private engine ownership, temporary storage and workers to Safe components.
- Crypter operations, compressor stream operations, signer/verification boxes and Crypto++ filters use Safe::Unique; hasher operations and deserialized keys use Safe::Shared. Private text uses Safe::String, binary buffers use Safe::Binary / Safe::Vector, and SecureContent keeps explicitly wiped Safe::Vector<unsigned char> storage. Safe allocation by itself does not wipe secrets.
- Streaming workers use Safe::Thread; hasher, crypter and signer callbacks use Safe::Function<void()> instead of owning STL functions. Contexts allocate through Safe::Heap and bind real Crypto-owned invocation, clone and release callbacks; cloning creates a separate context, and release destroys it in Crypto before freeing Base storage. Safe shared owners retain move-only engine state where copyable callbacks require it. Provider modules must remain loaded until workers and callback copies finish; Crypto++ native types remain private and retain their own internal allocation rules.
- Crypto input-wait loops use Safe::this_thread::yield(). Channel synchronization stays in Buffer's sink/ring/pumper implementations, which use Safe::Mutex, Safe::UniqueLock, Safe::ConditionVariable and Safe atomic state; these are not new locking members or public APIs in Crypto.
- Breaking: Update exception paths and backend naming.
- Exceptions no longer use StormByte::Component. Crypto::Exception forwards Path{"Crypto"} to StormByte::Exception. Per-office exceptions (Compressor::Exception, Crypter::Exception, Hasher::Exception, KeyPair::Exception, Secret::Exception, Signer::Exception) live in their own namespace and add only their own segment; Crypto concatenates before forwarding. what() is StormByte.Crypto or StormByte.Crypto.<Child>: message.
- Exception message constructors accept std::string_view; exception copy/move special members are defined out of line in their owning Crypto DLLs.
- Private backend namespace Implementation becomes Engine (StormByte::Crypto::Engine). Public headers do not mention it.
- Update test coverage to the suite's 2.0.0 contracts.
- Tests use section headers, snake_case functions and accumulating main. Hasher, compressor, crypter, signer, secret, password, vault and keypair coverage (save/load and OpenSSL fixtures) follows the new pins.
- Password regressions cover long mutable Safe text, borrowed full and partial views, embedded NUL bytes, shared-owner lifetime and Safe collection compatibility. Ceded Safe strings become empty; views preserve their source and produce an independent password copy. The Safe-string regression includes leading, internal and trailing NUL bytes; ordinary test inputs do not append terminators. Binary equality compares equal-length inputs with an internal NUL.
- KeyPair and Secret regressions check private-key copies and shared-secret snapshots retained after resetting their optional owner. Vault tests cover moved-from reuse and retained passwords after clearing the store.
- Hybrid encrypt/decrypt tests compare Safe plaintext using ASSERT_EQUAL; both the inputs and the deserialization helpers use Safe::String, not std::string. Comparisons use the Safe text equality path rather than raw C-string comparison, which previously false-failed prefix+4096 payloads on Ubuntu clang while the bytes already matched.
- Align build configuration and API documentation.
- Shared vs static follows root CMake BUILD_SHARED_LIBS (default ON), not a STORMBYTE_CRYPTO_SHARED CMake option. Shared builds still define STORMBYTE_CRYPTO_SHARED so visibility.h distinguishes dllexport / dllimport / static. CI passes -DBUILD_SHARED_LIBS=ON. Vendored Crypto++ and BZip2 remain static BM components; their archives are closed onto consumers by the static sidecar.
- Doxygen (ENABLE_DOC) resolves Buffer, Logger, System and Base headers via INCLUDE_PATH and skips thirdparty. Dependency tag downloads and cross-module links use verified HTTPS endpoints; Safe registration and force-inline macros are preprocessed explicitly. Warnings remain non-fatal in normal builds; warnings-as-errors is reserved for internal validation. Generation verified without warnings with Doxygen 1.16.1.
- CONTRIBUTING.md and CODING_STYLE.md follow Logger's conventions. README and coding guidelines use Safe::String / Safe::WString instead of removed CString / WCString; Password documentation describes length-preserving binary ingestion.
- README block examples retain Safe::Binary snapshots and pass span() instead of treating ByteSize as a standard span length. Each example defines its own input; asymmetric encryption and decryption use separate buffers. Persistence examples use explicit caller-owned filesystem paths and document native Windows wide-character views and source lifetimes.
- Factory examples include the symmetric/asymmetric factory headers. Asymmetric strategies are selected per Encrypt call (Native is the default), not in the constructor. Ed25519/X25519 generation examples supply the required size argument, which their fixed-size implementations currently ignore.
- Update repository references and licensing.
- Repository links use the StormByte-Suite organization; documentation for the retired standalone dependency is removed.
- Sources and LICENSE are dual-licensed: LGPL-3.0-or-later or commercial. Neither covers Crypto++, bundled libbzip2, or vendored StormByte trees under thirdparty/.
Notes
1.1.0 - 2026-09-13
Changed
- Exception hierarchy ported to StormByte::Component: Crypto::Exception names itself "Crypto", and each per-component exception (CompressorException, CrypterException, HasherException, KeyPairException, SecretException, SignerException, VaultException) combines its own name with the parent's through its constructor instead of manual string concatenation. Removed the now-unneeded workaround for MSVC constructor-inheritance ambiguity.
- Bumped the StormByte Buffer dependency to 1.1.0.
Added
- VaultException: Vault::Get on a missing entry now returns a dedicated exception instead of the generic Exception.
- Header-only StormByte::Type::ByteInputRange overloads for block hashing, compression, encryption, signing and signature verification. They accept byte-convertible input ranges such as std::string_view, std::vector<uint8_t> and std::span, then delegate to the existing byte-span APIs without changing their ABI.
Fixed
- Security hardening of KeyPair private-key handling, found and closed during a full pre-release audit:
- Private-key material (PKCS#8 DER, PBES2 plaintext/ciphertext) was never actually wiped from memory. The wipe helper constructed a new CryptoPP::SecByteBlock copy from the buffer's pointer and zeroed that copy instead of the original — CryptoPP::SecBlock's (pointer, length) constructor always allocates and copies, it never wraps existing storage. Added a direct SecureWipe overload for std::vector<unsigned char> and wipe the original buffers (and std::string plaintext buffers) in place.
- The shared CryptoPP::AutoSeededRandomPool used for salt/IV/key generation was a single process-wide instance accessed without synchronization. AutoSeededRandomPool is not safe for concurrent use, and the streaming encrypt/decrypt paths each spawn their own detached worker thread, so two concurrent streaming operations raced on the RNG's internal state. Made it thread_local instead — confirmed race-free with ThreadSanitizer (fully-instrumented WITH_CRYPTOPP=BUNDLED build; the SYSTEM build previously produced ABI-boundary false positives).
- Private key files (KeyPair::Save/SavePrivate, encrypted or not, PEM or DER) were created with the OS-default file permissions, potentially group/world-readable depending on umask. They are now restricted to owner read/write (0600) right after writing. Public key files are unaffected. Best-effort on filesystems/platforms without POSIX permission bits.
- WriteFileBytes (used by every KeyPair::Save/SavePublic/SavePrivate path) refuses to write through a pre-existing symlink at the destination path, closing a local TOCTOU attack where a symlink planted at the target filename would redirect the write to an arbitrary file.
- CMake: promote the system BZip2 imported target to global scope so WITH_BZIP2=SYSTEM resolves from the top-level directory.
- Tests: silence -Werror=unused-variable under GCC in the AES/Camellia/Serpent/Twofish symmetric crypter tests, where the decrypt result is intentionally unchecked (CBC either fails padding or succeeds with garbage).
Notes
1.0.0 - 2026-09-04
Initial public release of StormByte Crypto.
Added
- Hasher: SHA-256, SHA-512, SHA3-256, SHA3-512, BLAKE2b, BLAKE2s (block and stream, hex digest)
- Compressor: Zlib, Gzip, BZip2 with configurable level (block and stream)
- Symmetric crypter: AES CBC, AES-GCM, ChaCha20-Poly1305, Camellia, Serpent, Twofish
- Password-based keys via PBKDF2-HMAC-SHA256 (600 000 iterations)
- Asymmetric crypter: RSA OAEP-SHA, ECC ECIES
- Strategy::Native and Strategy::Hybrid (AES-256-GCM session key wrapped with the public key); decrypt auto-detects
- Signer: DSA, RSA PKCS#1 v1.5 + SHA-256, ECDSA, Ed25519 (block and stream)
- Secret: ECDH (secp256r1 / secp384r1 / secp521r1) and X25519; result is a Password
- KeyPair generate: DSA, RSA, ECC, ECDH, ECDSA, Ed25519, X25519
- KeyPair Save / Load: PEM and DER; public Base64; private Password; optional PKCS#8 (PBES2 + AES-256-CBC)
- Password — shared wiped secret; last owner zeros the bytes
- Vault — named Password store; movable, not copyable
- Factories: Create on Hasher, Compressor, Crypter, Signer, Secret, KeyPair
- StormByte Buffer pipelines (Consumer / Producer) on every transform
- Exception hierarchy with component prefixes
- Project version read from the VERSION file
- CMake 3.28 floor
Notes
- Installed headers do not include Crypto++. Static Crypto++ means consumers do not install it.
- Authenticated modes and wrapped private keys fail closed on a bad password or a bad tag.
- Needs a C++26 compiler, StormByte Base ≥ 1.1.0, StormByte Buffer ≥ 1.1.0, and Crypto++ at build time.