Skip to content

Rust wrapper: add password-hash, kem, mac traits; fix a few Fenrir findings#10305

Open
holtrop-wolfssl wants to merge 12 commits intowolfSSL:masterfrom
holtrop-wolfssl:rust-crate-updates
Open

Rust wrapper: add password-hash, kem, mac traits; fix a few Fenrir findings#10305
holtrop-wolfssl wants to merge 12 commits intowolfSSL:masterfrom
holtrop-wolfssl:rust-crate-updates

Conversation

@holtrop-wolfssl
Copy link
Copy Markdown
Contributor

Description

Rust wrapper: add password-hash, kem, mac traits; fix a few Fenrir findings

Testing

Unit/CI tests

Checklist

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

@holtrop-wolfssl holtrop-wolfssl self-assigned this Apr 24, 2026
Copilot AI review requested due to automatic review settings April 24, 2026 17:59
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds RustCrypto trait support (password-hash, KEM, MAC) to the wolfCrypt Rust wrapper while addressing several static-analysis (Fenrir) findings and aligning tests/docs with API changes.

Changes:

  • Add PBKDF2 password-hash (PHC) hasher/verifier support and corresponding tests.
  • Add ML-KEM RustCrypto kem trait wrappers and tests.
  • Add HMAC/CMAC RustCrypto digest::Mac wrappers and tests; include ECC/LMS/ML-KEM fixes and doc/test updates.

Reviewed changes

Copilot reviewed 17 out of 18 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
wrapper/rust/wolfssl-wolfcrypt/src/pbkdf2_password_hash.rs Implements password-hash traits for PBKDF2 and PHC formatting/parsing.
wrapper/rust/wolfssl-wolfcrypt/tests/test_pbkdf2_password_hash.rs Adds PBKDF2 password-hash tests (roundtrip, params, algorithm variants).
wrapper/rust/wolfssl-wolfcrypt/src/mlkem_kem.rs Adds RustCrypto kem trait wrappers for ML-KEM.
wrapper/rust/wolfssl-wolfcrypt/tests/test_mlkem_kem.rs Adds ML-KEM KEM trait tests (roundtrip, export/import, rejection).
wrapper/rust/wolfssl-wolfcrypt/src/hmac_mac.rs Adds RustCrypto digest::Mac trait wrappers for HMAC variants.
wrapper/rust/wolfssl-wolfcrypt/tests/test_hmac_mac.rs Adds HMAC MAC-trait vector and behavior tests.
wrapper/rust/wolfssl-wolfcrypt/src/cmac_mac.rs Adds RustCrypto digest::Mac trait wrappers for AES-CMAC.
wrapper/rust/wolfssl-wolfcrypt/tests/test_cmac_mac.rs Adds CMAC MAC-trait tests including wrong key size.
wrapper/rust/wolfssl-wolfcrypt/src/mlkem.rs Changes ML-KEM encode APIs to return Result<(), i32> and updates docs.
wrapper/rust/wolfssl-wolfcrypt/tests/test_mlkem.rs Updates ML-KEM tests for new encode API return type.
wrapper/rust/wolfssl-wolfcrypt/src/lms.rs Renames signature-availability API to has_sigs_left and updates docs.
wrapper/rust/wolfssl-wolfcrypt/tests/test_lms.rs Updates tests for has_sigs_left rename.
wrapper/rust/wolfssl-wolfcrypt/src/ecc.rs Adds NUL-termination validation and adjusts return-value handling.
wrapper/rust/wolfssl-wolfcrypt/tests/test_ecc.rs Adds test coverage for rs_hex_to_sig NUL-termination behavior.
wrapper/rust/wolfssl-wolfcrypt/src/lib.rs Exposes new modules behind feature/cfg gates.
wrapper/rust/wolfssl-wolfcrypt/Cargo.toml Adds new features/deps for mac, password-hash, kem, hybrid-array.
wrapper/rust/wolfssl-wolfcrypt/Makefile Enables new features in the default feature list.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread wrapper/rust/wolfssl-wolfcrypt/src/pbkdf2_password_hash.rs
Comment thread wrapper/rust/wolfssl-wolfcrypt/src/pbkdf2_password_hash.rs
Comment thread wrapper/rust/wolfssl-wolfcrypt/src/ecc.rs Outdated
Comment thread wrapper/rust/wolfssl-wolfcrypt/tests/test_ecc.rs
Comment thread wrapper/rust/wolfssl-wolfcrypt/src/lib.rs Outdated
Comment thread wrapper/rust/wolfssl-wolfcrypt/src/lib.rs Outdated
Comment thread wrapper/rust/wolfssl-wolfcrypt/src/lms.rs
Comment thread wrapper/rust/wolfssl-wolfcrypt/src/lms.rs
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 24, 2026

MemBrowse Memory Report

No memory changes detected for:

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