aes-gcm 0.11: key and nonce generation move to the Generate trait - #23
Closed
stoatworks-labs wants to merge 3 commits into
Closed
aes-gcm 0.11: key and nonce generation move to the Generate trait#23stoatworks-labs wants to merge 3 commits into
stoatworks-labs wants to merge 3 commits into
Conversation
Bumps [aes-gcm](https://github.com/RustCrypto/AEADs) from 0.10.3 to 0.11.0. - [Commits](RustCrypto/AEADs@aes-gcm-v0.10.3...aes-gcm-v0.11.0) --- updated-dependencies: - dependency-name: aes-gcm dependency-version: 0.11.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
aes-gcm 0.11 removes aead::OsRng and the generate_key / generate_nonce associated functions; RustCrypto moved both onto a Generate trait backed by the system's ambient CSPRNG. The nonce type is now derived from AeadCore::NonceSize rather than written as a literal, so it stays 12 bytes and the existing NONCE_LEN check on the decrypt path still holds. Verified: cargo build --all-targets clean, crypto tests passing. Left for review rather than self-merged: this is key and nonce generation, and a green test suite is weak evidence for crypto.
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
flock | 56c5ecf | Commit Preview URL Branch Preview URL |
Aug 27 2026, 03:19 PM |
Owner
Author
|
Closing in favour of a branch cut from current main — this one conflicted on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Supersedes #15, which cannot compile: aes-gcm 0.11 removes
aead::OsRngand thegenerate_key/generate_nonceassociated functions.RustCrypto moved key and nonce generation onto a
Generatetrait (crypto-common0.2), so the calls become:Aes256Gcm::generate_key(OsRng)Key::<Aes256Gcm>::generate()Aes256Gcm::generate_nonce(OsRng)Nonce::<<Aes256Gcm as AeadCore>::NonceSize>::generate()Why this should be equivalent, and where to check me.
Generate::generate()draws from the system's ambient CSPRNG (SysRng→getrandom), which is whatOsRngwas. The nonce type is derived fromAeadCore::NonceSizerather than written as a literal, so it stays 12 bytes — the existingNONCE_LENassertion on the decrypt path still passes. Key size is unchanged at 256 bits.One behavioural note:
generate()panics if the OS RNG fails, where the oldOsRngpath did the same.try_generate()exists if aResultis preferred.Verified:
cargo build --all-targetsclean, and the crypto tests pass — round-trip, key-file persistence across reload, and the legacy-plaintext passthrough.