Skip to content

Rust wrapper: add wolfssl::wolfcrypt::kdf, wolfssl::wolfcrypt::prf#9336

Merged
JacobBarthelmeh merged 3 commits intowolfSSL:masterfrom
holtrop:rust-wc-kdf-prf
Oct 24, 2025
Merged

Rust wrapper: add wolfssl::wolfcrypt::kdf, wolfssl::wolfcrypt::prf#9336
JacobBarthelmeh merged 3 commits intowolfSSL:masterfrom
holtrop:rust-wc-kdf-prf

Conversation

@holtrop
Copy link

@holtrop holtrop commented Oct 23, 2025

Description

Rust wrapper: add wolfssl::wolfcrypt::kdf, wolfssl::wolfcrypt::prf

Testing

How did you test?

Checklist

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

@holtrop holtrop self-assigned this Oct 23, 2025
@holtrop holtrop marked this pull request as ready for review October 23, 2025 21:04
@holtrop holtrop assigned wolfSSL-Bot and unassigned holtrop Oct 23, 2025
Copy link
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

This PR adds Rust wrapper modules for wolfCrypt's Key Derivation Function (KDF) and Pseudo Random Function (PRF) capabilities. The changes include new public API modules, test coverage, and refactoring of existing code to use consistent core::ptr::null* instead of std::ptr::null*.

  • Adds wolfssl::wolfcrypt::kdf module with TLS 1.3 HKDF and SSH KDF functions
  • Adds wolfssl::wolfcrypt::prf module for PRF operations with various hash algorithms
  • Standardizes null pointer usage across the codebase to use core::ptr for better no_std compatibility

Reviewed Changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
wrapper/rust/wolfssl/src/wolfcrypt/kdf.rs New module implementing TLS 1.3 HKDF extract/expand and SSH KDF wrappers
wrapper/rust/wolfssl/src/wolfcrypt/prf.rs New module implementing PRF wrapper with support for multiple hash algorithms
wrapper/rust/wolfssl/tests/test_kdf.rs Test cases for TLS 1.3 HKDF and SSH KDF functions
wrapper/rust/wolfssl/tests/test_prf.rs Test case for PRF with SHA-384
wrapper/rust/wolfssl/src/wolfcrypt.rs Exports the new kdf and prf modules
wrapper/rust/include.am Adds new source and test files to build system
wrapper/rust/wolfssl/tests/test_hmac.rs Updates to use SHA256::DIGEST_SIZE constant instead of raw FFI constant
wrapper/rust/wolfssl/tests/test_hkdf.rs Updates to use SHA256::DIGEST_SIZE constant instead of raw FFI constant
wrapper/rust/wolfssl/src/wolfcrypt/hkdf.rs Updates documentation examples to use SHA256::DIGEST_SIZE
wrapper/rust/wolfssl/src/wolfcrypt/sha.rs Standardizes to use core::ptr::null_mut()
wrapper/rust/wolfssl/src/wolfcrypt/rsa.rs Standardizes to use core::ptr::null_mut()
wrapper/rust/wolfssl/src/wolfcrypt/ecc.rs Standardizes to use core::ptr::null_mut()
wrapper/rust/wolfssl/src/wolfcrypt/dh.rs Standardizes to use core::ptr::null()
wrapper/rust/wolfssl/src/wolfcrypt/aes.rs Standardizes to use core::ptr::null() and core::ptr::null_mut()
doc/dox_comments/header_files/hmac.h Corrects documentation comment for wc_Tls13_HKDF_Expand_Label

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@JacobBarthelmeh JacobBarthelmeh merged commit a28e107 into wolfSSL:master Oct 24, 2025
258 checks passed
@holtrop holtrop deleted the rust-wc-kdf-prf branch November 11, 2025 18:49
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.

4 participants