ogar-encryption: own the Argon2id KDF + envelope on argon2 0.6 (password-hashes fork) - #308
Merged
Merged
Conversation
…ord-hashes fork) The KDF and the zero-knowledge envelope move out of the ndarray `encryption` re-export and into this crate, running on argon2 0.6 from the AdaWorldAPI/password-hashes fork with `ndarray-simd` (block compression on `ndarray::simd::U64x8`). kdf.rs / envelope.rs are ndarray master's modules with one import changed (`encryption::aead` instead of `crate::aead`) plus rustfmt; the public API is unchanged, so a2ui-rs / MedCare-rs callers need no edits. AEAD, Ed25519 and SHA-384 stay re-exported from `encryption`. ogar-auth keeps its own argon2 pin (password hashing, not encryption) and moves it to the same fork's 0.6: `hash_password_with_salt` takes the raw 16-byte getrandom salt, so the SaltString step goes away. Not done here: the `wasm` feature still forwards encryption's own bindings (argon2 0.5); argon2 0.5 stays in the tree until ndarray's `encryption` crate drops its kdf/envelope. Verified: ogar-encryption 18 passed / 1 ignored, ogar-auth 19 passed; clippy -D warnings clean; fmt clean; wasm32 check with and without simd128; cargo check --workspace --all-targets clean. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019HnekoM1EidTwQLS3oFVFm
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Essentials Run ID: 📒 Files selected for processing (6)
✨ Finishing Touches📝 Generate docstrings
Comment |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_9e894098-cd19-426a-9671-371f49d8d0ea) |
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.
What
ogar-encryptionnow implements the Argon2 part of the crypto suite itself instead of passing ndarray's through.kdfandenvelopemove out of the ndarrayencryptionre-export and into this crate. They run on argon2 0.6 fromAdaWorldAPI/password-hashes, with thendarray-simdfeature. That feature runs Argon2's block compression onndarray::simd::U64x8, selected at compile time, with nounsafe.kdf.rsandenvelope.rsare ndarray master's modules with one changed import (encryption::aeadinstead ofcrate::aead), plus rustfmt. The public API is unchanged:kdf::*,envelope::*, and the root-levelseal,open,KdfParamsandEnvelopeError. Consumers need no edits; a2ui-rs usesKdfParams,kdfandaead, MedCare-rs usesseal,open,signandhash.encryption.ogar-authkeeps its own argon2 pin, because password hashing is not encryption, and moves it to the same fork's 0.6. The 0.6hash_password_with_salttakes the raw 16-byte salt fromgetrandom, so theSaltStringstep is gone.Depends on
ndarray-simdbackend). This PR pins that PR's branch until it merges.simd: U64x8::mul_lo32 — widening lo32×lo32→u64 on every backend (argon2 BlaMka) ndarray#331merged; the fork's ndarray dependency now tracksmaster.Verified
ogar-encryption: 18 passed, 1 ignored.ogar-auth: 19 passed.clippy -D warningsclean on both crates;cargo fmt --checkclean.cargo check -p ogar-encryption --target wasm32-unknown-unknown --features wasmpasses with and without+simd128.cargo check --workspace --all-targetsclean.ndarrayin the dependency graph.Not done here
wasmfeature still forwardsencryption's own browser bindings, which run on argon2 0.5.encryptioncrate drops itskdfandenvelope.🤖 Generated with Claude Code
https://claude.ai/code/session_019HnekoM1EidTwQLS3oFVFm
Generated by Claude Code
Generated by Claude Code