Skip to content

Extract shared crypto helpers from CLI encrypt/decrypt#57

Merged
gvonness-apolitical merged 1 commit intomainfrom
cleanup/cli-crypto-dedup
Feb 10, 2026
Merged

Extract shared crypto helpers from CLI encrypt/decrypt#57
gvonness-apolitical merged 1 commit intomainfrom
cleanup/cli-crypto-dedup

Conversation

@gvonness-apolitical
Copy link
Collaborator

Summary

  • Extract duplicated prompt_password, generate_salt, derive_key_argon2, and derive_key_pbkdf2 functions from encrypt.rs and decrypt.rs into a shared crypto_common module
  • Both commands now call shared helpers, eliminating ~30 lines of copy-paste
  • Unified the Argon2 key derivation interface: callers pass memory and parallelism params directly instead of having two subtly different implementations

Follow-up to #56 (codebase cleanup).

Test plan

  • cargo build --workspace --all-features passes
  • cargo test --workspace --all-features passes (856 tests)
  • cargo clippy --workspace --all-features -- -D warnings clean

Move duplicated prompt_password, generate_salt, derive_key_argon2,
and derive_key_pbkdf2 functions into a shared crypto_common module.
Both encrypt.rs and decrypt.rs now call the shared helpers instead
of maintaining their own copies.
@gvonness-apolitical gvonness-apolitical merged commit 24d5a18 into main Feb 10, 2026
10 checks passed
@gvonness-apolitical gvonness-apolitical deleted the cleanup/cli-crypto-dedup branch February 10, 2026 03:13
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.

1 participant