Repository navigation
v0.11.0
-
Add
Argon2idPassword::verify_password_with_memory,Argon2idPassword::verify_password_with_context_and_memory, andScryptPassword::verify_password_with_memory. They verify PHC records in a reusable block slice that the caller owns, from any allocator, with the same record limits, opaque failures, and workspace cleanup. -
Add pseudorandom-key import and multi-part
infoexpansion toHkdfSha256andHkdfSha384.from_prkbuilds the expansion state from an existing hash-length PRK, such as a TLS 1.3 secret, without repeating HKDF-Extract.expand_vectoredexpands overinfogiven as several slices, such as a TLS 1.3HkdfLabel, without concatenating them, and keeps theHkdfOutputLengthErrorbound ofexpand.extractnow clears its working copy of the PRK once the state holds it. -
Add RFC 9881 PKCS #8 import and export for ML-DSA private keys.
SecretKey::from_pkcs8_derandfrom_pkcs8_der_inaccept the seed, expanded, and both forms in a version 1 container or a version 2 container with a public key, check that redundant fields agree, and reject attributes as the newMlDsaKeyError::UnsupportedEncoding. The newMlDsa44Seed,MlDsa65Seed, andMlDsa87Seedowners keep the recommended seed form:generate,keypair,keypair_in,from_pkcs8_der, andto_pkcs8_der_into.SecretKey::to_pkcs8_der_intowrites the expanded form. Exports write into caller-owned fixed-size buffers, and nothing allocates except the_inconstructors. -
Add RFC 9881 SubjectPublicKeyInfo import and export for ML-DSA public keys:
from_spki_der,to_spki_der, andSPKI_DER_LENGTH. Import accepts only the unique DER encoding and reportsMlDsaKeyError::MalformedDer,UnsupportedAlgorithm, orInvalidPublicKey. Neither direction allocates. -
Add RFC 9935 key encodings for ML-KEM.
EncapsulationKey::from_spki_derandto_spki_derhandle SubjectPublicKeyInfo with the FIPS 203 modulus check.DecapsulationKey::from_pkcs8_derandfrom_pkcs8_der_inaccept the seed, expanded, and both forms in a version 1 container or a version 2 container with a public key; an expanded key also passes a deterministic pairwise consistency check, which rejects a secret vector that FIPS 203's hash check accepts. Rawtry_from_slicekeeps exactly the FIPS 203 checks. The newMlKem512Seed,MlKem768Seed, andMlKem1024Seedowners keep the recommendedd || zseed form, andDecapsulationKey::to_pkcs8_der_intowrites the expanded form. Import failures use the newMlKemKeyError; KEM operations keepMlKemError. Nothing allocates except the_inconstructors. -
Add SLH-DSA (FIPS 205) behind the new
slh-dsaleaf feature, also enabled bysignatures. All 12 parameter sets ship, each as a pure profile such asSlhDsaSha2_128sand an RFC 9909 HashSLH-DSA profile such asHashSlhDsaSha2_128sWithSha256, whose keys are distinct types that never sign or verify for the other profile. Signing is hedged with caller randomness or deterministic, takes a context of up to 255 bytes, and writes into a caller-provided buffer; a failed call zero-fills it. Verification takes the signature as a byte slice. Secret-key import regenerates the public root, and keys have RFC 9909 SubjectPublicKeyInfo and PKCS #8 import and export. Nothing allocates. Failures use the newSlhDsaErrorandSlhDsaKeyError. -
Add standard key encodings for ECDSA and Ed25519.
EcdsaP256SecretKeyandEcdsaP384SecretKeygainfrom_pkcs8_der(RFC 5958 with an RFC 5915 ECPrivateKey),from_sec1_der, andto_pkcs8_der_into, which writes the OpenSSL form with the public key. Every public key an encoding carries must match the key derived from the scalar.EcdsaP256PublicKeyandEcdsaP384PublicKeygainto_spki_der, andEcdsaP256SignatureandEcdsaP384Signaturegainto_der_intofor DER signatures.Ed25519SecretKeygains RFC 8410from_pkcs8_derandto_pkcs8_der_into, andEd25519PublicKeygainsfrom_spki_derandto_spki_der, with the newEd25519KeyError. PKCS #8 import accepts a version 1 container, or a version 2 container with a matching public key, and rejects attributes as the newEcdsaError::UnsupportedEncodingorEd25519KeyError::UnsupportedEncoding. Exports write into caller-owned fixed-size buffers, and nothing allocates. -
Avoid repeated public-key decoding during Ed25519 verification on Linux
and macOS AArch64 without enlarging key types. -
Add a bounded Bao combined-stream decoder under
hashes::expert::baowith
std. Verify each chunk before returning it and reject corrupt or truncated
encodings against an independently trusted BLAKE3 root. -
Add
Blake3::keyed_digest_batchandBlake3DeriveContext::derive_key_batch. They hash independent inputs into caller-provided outputs, in order, without allocation, through the existing one-shot tree paths. -
Allow
Blake3::digest_constto hash inputs longer than one chunk using portable compression and a fixed tree stack, without allocation. -
Add allocation-free
Blake3Tree::merge_levelfor batched non-root parent merges
in every BLAKE3 mode. Validate all child pairs before changing output and clear
the bounded child and parent scratch on return or unwind. -
Speed up BLAKE3 streaming updates that end inside a chunk after complete chunks, at
chunk counters divisible by 16. One SIMD pass now hashes those chunks and the leading
blocks of the partial chunk, and their chaining values reduce together; a later update or
finalization resumes the partial chunk. NEON covers 3, 7, 11 or 15 complete chunks;
AVX-512 covers 3 or 15. Digest bytes and public APIs are unchanged, and keyed and
derive-key scratch is cleared. -
Add
Blake3::update_readerandBlake3Subtree::update_readerunderstd:
buffered BLAKE3 input reading, with bounded readers for caller-scheduled subtrees. Preserve successfully read input on I/O errors and
clear the owned input buffer before deallocation.With
parallel, plain readers on little-endian Linux AArch64 can hash complete
aligned buffers through the current Rayon pool. -
Clear decoded block words and compression-output scratch after keyed and derive-key
BLAKE3 root output in the shared fallback. Digest bytes and public APIs are unchanged. -
Speed up BLAKE3 on WebAssembly builds that enable
simd128at compile time.
Chunk hashing, parent reduction, and equal-lengthdigest_batchruns use four
SIMD128 lanes. Builds withoutsimd128, andportable-onlybuilds, keep the
portable path. Digests and keyed and derive-key cleanup are unchanged. -
Breaking: ML-DSA prepared keys no longer borrow their source key and are generic over their storage.
MlDsa{44,65,87}PreparedSecretKey<S>andMlDsa{44,65,87}PreparedPublicKey<S>replace the borrowed<'a>handles:prepare(&mut storage)call sites are unchanged and return a prepared key in&mutstorage (&for public keys), while the newSecretKey::prepare_inandPublicKey::prepare_inallocate the storage from a caller-selectedAllocator, prepare it in place, and return a prepared key that owns the box and can be kept and shared across threads after the source key is dropped. Secret storage now also holds the key's rho, K, and tr (28,800, 48,256, or 81,024 bytes) and clears K with the transformed secrets. A borrowed prepared public key staysCopy; itsDebugoutput no longer prints the public key. Code that namesMlDsa65PreparedSecretKey<'a>orMlDsa65PreparedPublicKey<'a>must nameMlDsa65PreparedSecretKey<&'a mut MlDsa65PreparedSecretKeyStorage>orMlDsa65PreparedPublicKey<&'a MlDsa65PreparedPublicKeyStorage>; ML-DSA-44 and ML-DSA-87 follow the same pattern. -
Breaking: ML-DSA public- and secret-key imports (
try_from_slice,try_from_slice_in) return the newMlDsaKeyError, which separates import failures, including matrix-expansionRejectionLimit, from generation, preparation, and signing failures.MlDsaError::InvalidPublicKeyis removed;MlDsaError::InvalidSecretKeynow reports only an invalid stored key found during signing or preparation. -
Remove 32-bit x86 support, including i586/i686 detection and
platform::Arch::X86. The laterArchvariants' implicit numeric discriminants decrease by one. These targets now fail compilation with an explicit diagnostic. Use an x86-64 target for x86 deployments. -
Build
portable-onlyon POWER, IBM Z, RV64, and RV32 with the declared MSRV by excluding nightly-only backends. Preserve portable fallbacks and check these target and feature combinations in the compatibility lane. -
Precompute the AVX2 and IFMA fixed-base tables used by the Rust Ed25519 and X25519 backends, trading 160 KiB of read-only data for faster signing and public-key derivation. Keep both table selectors in separate AVX2 functions for binary constant-time verification.
-
Reduce field arithmetic in P-384 ECDH mixed addition, accelerating agreement and public-key derivation without new assembly or allocation.
-
Report well-formed SubjectPublicKeyInfo keys of other algorithms, such as RSA or Ed25519, as
EcdsaError::UnsupportedAlgorithminstead ofEcdsaError::MalformedDer. -
Keep RSA modular restoration masked through optimization to prevent the observed secret-dependent branches in CRT reduction on x86-64 Linux.
-
Standalone Poly1305 and ChaCha20-Poly1305 now share one bounded, checked arithmetic core, and each feature still builds alone. Bulk throughput is unchanged on Graviton4; 15-byte standalone Poly1305 authentication is about 9% slower there.
-
Speed up ECDSA P-256 and P-384 signature verification by taking the
generator term from the existing fixed-base signing table, with unchanged
keys and results.