Skip to content

ogar-encryption: own the wasm bindings on the argon2-0.6 envelope - #310

Merged
AdaWorldAPI merged 3 commits into
mainfrom
claude/llvm-codegen-polyfill-gni3cw
Sep 25, 2026
Merged

AdaWorldAPI merged 3 commits into
mainfrom
claude/llvm-codegen-polyfill-gni3cw

Conversation

@AdaWorldAPI

@AdaWorldAPI AdaWorldAPI commented Sep 25, 2026 •

Copy link
Copy Markdown
Owner

What

  • src/wasm.rs (new, feature wasm). Browser bindings owned by this crate, exporting the same seven functions as ndarray encryption's wasm module:

    • seal_envelope, open_envelope
    • generate_signing_seed, public_key_of, sign_message, verify_signature
    • sha384

    seal_envelope and open_envelope now run this crate's own envelope, which uses argon2 0.6 from the password-hashes fork. Before this change the wasm feature re-exported encryption::wasm, whose seal/open ran argon2 0.5.

  • Features. wasm = ["dep:wasm-bindgen"] replaces wasm = ["encryption/wasm-bindings"].

  • ndarray dependency. encryption is now default-features = false. Together with ndarray #333 this drops that crate's argon2-0.5 KDF and envelope, which this crate never used.

  • Doctest fix. The kdf.rs doctest imported encryption::kdf; it now imports ogar_encryption::kdf.

Ordering

This PR is safe to merge before or after ndarray #333. On current ndarray master, default-features = false changes nothing (that crate's default is []), so argon2 0.5.3 stays in the tree until #333 lands.

Verification

Tests pass for both cargo +1.98.1 test -p ogar-encryption and cargo +1.98.1 test -p ogar-encryption --features wasm: 18 passed, 1 ignored, plus 1 doctest.

The other checks pass with the fmt fixup commit:

  • cargo check -p ogar-encryption --features wasm --target wasm32-unknown-unknown
  • cargo clippy -p ogar-encryption --features wasm --all-targets -- -D warnings
  • cargo fmt --check

Dependency tree for -p ogar-encryption --features wasm:

ndarray source argon2 versions
current master 0.6.0 and 0.5.3
patched to the #333 branch 0.6.0 only

The tests were also rerun against the #333 branch and pass.

Consumers are unaffected: a2ui-rs and MedCare-rs use ogar_encryption::{kdf, KdfParams, seal, open}, and none of them enables the wasm feature.

🤖 Generated with Claude Code

https://claude.ai/code/session_019HnekoM1EidTwQLS3oFVFm


Generated by Claude Code

Summary by CodeRabbit

  • New Features
    • Added browser-based access to encryption, decryption, signing, signature verification, and SHA-384 hashing.
    • Added support for choosing interactive or default protection settings when encrypting data.
  • Compatibility
    • Updated the minimum supported Rust version and upgraded the workspace’s Lance and LanceDB versions.

The `wasm` feature used to forward ndarray encryption's wasm module, whose
seal/open ran that crate's argon2-0.5 envelope. src/wasm.rs now exports the
same seven functions over this crate's envelope (plus the re-exported sign
and hash). The encryption dep is default-features = false so, with ndarray
#333, argon2 0.5 leaves the tree. Fixes a doctest that imported
encryption::kdf.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019HnekoM1EidTwQLS3oFVFm
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019HnekoM1EidTwQLS3oFVFm
@coderabbitai

coderabbitai Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Essentials

Run ID: b139c64d-e292-4608-9f9b-c34baec4dd3d

📥 Commits

Reviewing files that changed from the base of the PR and between 899981a and 01c2eef.

📒 Files selected for processing (5)
  • Cargo.toml
  • crates/ogar-encryption/Cargo.toml
  • crates/ogar-encryption/src/kdf.rs
  • crates/ogar-encryption/src/lib.rs
  • crates/ogar-encryption/src/wasm.rs
 __________________________________
< I void warranties and segfaults. >
 ----------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

@cursor

cursor Bot commented Sep 25, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot 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_c8f7b7ba-4809-4a06-af66-f277884659f2)

Workspace-wide sweep: lance 12 / lancedb 0.39 (lancedb 0.39 requires
lance =12.0.0 and still arrow ^58 / datafusion ^54, so those are
unchanged). No member crate currently uses lance or lancedb; the
workspace table moves so the next consumer starts on the current pair.
rust-version follows rust-toolchain.toml (1.98.1).
cargo +1.98.1 check --workspace --all-targets: clean.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019HnekoM1EidTwQLS3oFVFm
@AdaWorldAPI
AdaWorldAPI marked this pull request as ready for review September 25, 2026 01:43
@AdaWorldAPI
AdaWorldAPI merged commit 220bca1 into main Sep 25, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants