# Changelog
All notable changes to the **`rivide`** Rust crate will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [1.1.5] - 2026-08-18
### Fixed
- **ML-DSA NIST FIPS 204 Zero-Length Message Support**:
- Enabled signing and verification of empty (0-byte) message slices (`&[]` or `b""`) in `MlDsa65` and `MlDsa87`.
- **Underlying C Core Hardening**:
- Leveraged updated C99 core engine with improved stack secret zeroization on rejection loop limits and optimized x86 CPUID feature probing.
## [1.1.4] - 2026-08-17
### Fixed
- **AES-GCM In-Flight Release of Unverified Plaintext (RUP) Prevention**:
- Reordered authentication tag verification prior to CTR mode keystream generation and plaintext release in `AesGcm` decryption methods, preventing in-flight unverified plaintext leaks.
- **AES Key Material Lifecycle & RAII Zeroization**:
- Bound explicit `rivide_aes_key_cleanse` round key zeroization across `AesGcm::encrypt_128`, `AesGcm::decrypt_128`, `AesGcm::encrypt_256`, and `AesGcm::decrypt_256` routines to securely wipe key schedules upon function exit.
- Exported `rivide_aes_key_cleanse` FFI binding symbol in `sys.rs`.
- **NIST FIPS 203 Section 7.3 Decapsulation Type Check**:
- Enforced canonical coefficient range verification ($\hat{s} < 3329$) during ML-KEM decapsulation, returning `RivideError::InvalidParameter` on corrupted secret keys.
## [1.1.3] - 2026-08-17
### Fixed
- **Table-Free Constant-Time Algebraic AES S-Box**:
- Replaced secret-dependent table lookups in AES with constant-time algebraic GF(2^8) inversion and affine transforms (`aes_sbox_ct`).
- **NIST SP 800-38D Length Bounds & Buffer Overlap Validation**:
- Enforced overflow-safe length limits and buffer overlap protection across AES-GCM primitives.
## [1.1.2] - 2026-08-16
### Fixed
- **Constant-Time Branchless GHASH Multiplication**:
- Replaced conditional branches in GHASH bitwise multiplication with constant-time bitmask arithmetic to prevent side-channel timing and branch predictor leakage.
- **Input Validation for AAD in AES-GCM**:
- Added strict null pointer validation when `aad_len > 0` in authenticated encryption/decryption routines.
- **NIST FIPS 203 Section 7.2 Type Check in ML-KEM**:
- Validated encapsulation key coefficients (< 3329) to reject malformed public keys.
- **Resilient CSPRNG Entropy Reads**:
- Added `EINTR`/`EAGAIN` retry handling for Linux `getrandom(2)`.
- **Complete Secret Stack Zeroization**:
- Zeroized intermediate polynomials and hash buffers across ML-KEM and ML-DSA.
## [1.1.1] - 2026-08-16
### Fixed
- **Thread-Safe Atomic RNG Callback Registration**:
- Implemented atomic synchronization for custom entropy callbacks using release-acquire memory ordering, guaranteeing zero data races when invoked across multi-threaded Rayon workers or Tokio task pools.
### Added
- **Constant-Time Statistical Timing Verification**:
- Formally verified constant-time decapsulation and memory comparisons (`ct_memcmp`) using the Dudect Welch's t-test methodology ($|t| < 4.5$).
- Added dedicated Makefile targets `make timing` and `make rust-publish`.
### Security
- **Concurrency & Timing Attack Hardening**:
- Validated statistical timing leakage boundaries across safe Rust wrapper abstractions.
- Documented formal concurrency guarantees and thread-safety invariants.
### Documentation
- **API & Benchmark Guides**:
- Updated Rust crate documentation, doctests, and examples to version `1.1.1`.
- Added publishing instructions for crates.io and sandbox package verification guides.
## [1.1.0] - 2026-08-15
### Added
- **Initial Release of Official Rust Native Bindings (`rivide`)**:
- Direct, zero-dependency C99 compilation via `build.rs` and `cc` crate.
- **NIST Post-Quantum Cryptography Modules**:
- `MlKem768`: ML-KEM-768 keypair generation (`keypair`), encapsulation (`encapsulate`), and constant-time decapsulation (`decapsulate`).
- `MlKem1024`: ML-KEM-1024 keypair generation (`keypair`), encapsulation (`encapsulate`), and constant-time decapsulation (`decapsulate`).
- `MlDsa65`: ML-DSA-65 keypair generation (`keypair`), signing (`sign`), and strict signature verification (`verify`).
- `MlDsa87`: ML-DSA-87 keypair generation (`keypair`), signing (`sign`), and strict signature verification (`verify`).
- **Symmetric Cryptography & Utility Modules**:
- `Sha3`: SHA3-256, SHA3-512, SHAKE-128, and SHAKE-256 extendable-output hashing.
- `AesGcm`: AES-128-GCM and AES-256-GCM authenticated encryption and decryption.
- `utils`: Secure memory zeroization (`cleanse`), OS CSPRNG entropy generation (`randombytes`), constant-time memory comparison (`ct_memcmp`), and runtime hardware CPU feature detection (`get_cpu_features`).
- **Developer Ergonomics & Memory Safety**:
- Automated RAII memory cleansing (`Drop` trait implementation invoking `rivide_cleanse` for all secret keys).
- Fixed-size stack-allocated arrays (`[u8; N]`) for zero heap allocation overhead.
- Dedicated unit and integration tests (`tests/`), standalone executable examples (`examples/`), and high-precision performance benchmark harness (`benches/bench_pqc.rs`).