Commit Graph

67 Commits (master)

Author SHA1 Message Date
philljj bcadaa39c7
Merge pull request #11321 from holtrop-wolfssl/f-10091
Rust wrapper: ecdsa: allow module usage for verify-only ECC builds
2026-09-04 18:20:14 -05:00
philljj 88c0902c35
Merge pull request #11307 from holtrop-wolfssl/f-8303
Rust wrapper: ed25519: guard generate with ed25519_make_key cfg
2026-09-04 09:19:13 -05:00
Sean Parkinson ee45da0e3c
Merge pull request #11347 from holtrop-wolfssl/f-11269
Rust wrapper: curve25519: fix possible dangling WC_RNG pointer
2026-09-03 16:14:48 +10:00
Sean Parkinson 78c984242f
Merge pull request #11337 from holtrop-wolfssl/f-10093
Rust wrapper: pbkdf2_password_hash: gate out unsupported SHA algorithms
2026-09-03 16:14:09 +10:00
Josh Holtrop 3622adefc8 Rust wrapper: curve25519: fix possible dangling WC_RNG pointer
Fixes F-11269
2026-09-01 21:27:33 -04:00
Josh Holtrop 4a239be0b7 Rust wrapper: pbkdf2_password_hash: gate out unsupported SHA algorithms
Fixes F-10093
2026-09-01 11:08:40 -04:00
Josh Holtrop e74a6e79c0 Rust wrapper: rsa_pkcs1v15: allow using VerifyingKey without random cfg
Fixes F-10092
2026-08-31 14:21:32 -04:00
Josh Holtrop f31e461906 Rust wrapper: ecdsa: allow module usage for verify-only ECC builds
Fixes F-10091
2026-08-31 10:43:02 -04:00
Josh Holtrop 055b1285b1 Rust wrapper: ed25519: guard generate with ed25519_make_key cfg
Detect based on wc_ed25519_make_key prototype presence and guard
prototype presence with HAVE_ED25519_MAKE_KEY.
2026-08-31 09:33:09 -04:00
Josh Holtrop bb430555f7 Rust wrapper: ed448: gate RNG references with random cfg
Fixes F-8304.
2026-08-17 17:06:20 -04:00
Josh Holtrop ab97151e69 Rust wrapper: ed25519: gate RNG references with random cfg
Fixes F-8302.
2026-08-17 17:06:20 -04:00
JacobBarthelmeh 11ef0e1254
Merge pull request #11157 from holtrop-wolfssl/f-8297
Gate SHA3-224/256/384/512 prototypes separately
2026-08-13 10:10:04 -06:00
Josh Holtrop 4b1ff0e346 Gate SHA3-224/256/384/512 prototypes separately
Rust wrapper: detect SHA3-224/256/384/512 build options separately.

Fixes F-8297.
2026-08-12 10:43:36 -04:00
Mark Atwood b6a857cbaa feat(rust): add copy() to SHA256 and SHA384
Add copy(&mut self) methods backed by wc_Sha256Copy/wc_Sha384Copy
for transcript snapshotting (e.g. TLS handshake hashing).

Uses &mut self (not Clone trait) because wc_ShaCopy may mutate src
on some platforms. Initializes dst before calling Copy to avoid
passing uninitialized memory to wc_ShaFree inside the C function.

Includes unit tests verifying independent copy semantics with
externally computed SHA-256/SHA-384 test vectors.
2026-07-30 10:36:31 -07:00
Josh Holtrop c3903cddce Rust wrapper: Add ChaCha20Poly1305::finalize_verify() 2026-07-16 13:56:41 -04:00
Josh Holtrop 708357c403 Rust wrapper: check DH::shared_secret buffer size against prime size
The underlying C API treats the agreeSz parameter as output-only.
2026-07-15 23:37:49 -04:00
Daniel Pouzzner 64a0f384a4
Merge pull request #10780 from holtrop-wolfssl/rust-rename-dilithium-mldsa
Rust wrapper: rename dilithium to mldsa
2026-07-01 16:30:28 -05:00
Josh Holtrop b6d962350d Rust wrapper: rename dilithium to mldsa 2026-06-25 10:31:44 -04:00
Josh Holtrop f8c86ce227 Rust wrapper: fix Ed25519/Ed448 signature verify failed return values 2026-06-09 11:31:25 -04:00
Josh Holtrop 364e883941 Rust wrapper: handle MAC_CMP_FAILED_E from CMAC::verify{,_ex}()
Fix F-4468
2026-05-29 14:51:50 -04:00
Josh Holtrop 830aa7f7b6 Rust wrapper: fix CFB::encrypt1 and CFB::decrypt1 to take size in bits 2026-05-29 14:51:50 -04:00
Josh Holtrop 014925d37b Rust wrapper: Add RSA-OAEP API 2026-05-29 14:51:50 -04:00
Josh Holtrop 056d548467 Rust wrapper: add scrypt kdf support and scrypt_password_hash trait impl module 2026-05-29 14:51:50 -04:00
Josh Holtrop 735d00d3d7 Rust wrapper: check slice lengths in ECC::import_unsigned 2026-05-18 12:40:17 -07:00
Josh Holtrop a2b9a24082 Rust wrapper: test more empty slices in test_ecc 2026-05-18 12:27:45 -07:00
Josh Holtrop 9696cf26eb Rust wrapper: use Rc instead of Arc for RNG references
WC_RNG has no internal locking so it is not safe to share a single
WC_RNG across threads without locking.
2026-05-18 12:27:45 -07:00
Josh Holtrop f6e279ab42 Rust wrapper: test for null-terminated C-style strings in ECC import_raw APIs 2026-05-18 12:27:45 -07:00
Josh Holtrop 5a45fabb0d Rust wrapper: add blake2_digest module 2026-05-18 12:27:45 -07:00
Josh Holtrop cfc600977a Rust wrapper: add blake2_mac module 2026-05-18 12:27:45 -07:00
Josh Holtrop d88d5702e5 Rust wrapper: implement Clone for HMAC types 2026-05-18 12:27:45 -07:00
Josh Holtrop b3aa7ef260 Rust wrapper: add Aes192Ccm and Aes192Gcm 2026-05-18 12:27:45 -07:00
Josh Holtrop 54cb1d8d38 Rust wrapper: ensure memory safety for C RNG struct
- store pointer to WC_RNG instead of full struct
- enforce RNG is not dropped before consumer structs

The C library stores a pointer via the set_rng() methods on a few
structs (e.g. RSA). This change holds a reference (or instance) of RNG
within the consumer structs to ensure it is kept alive if set_rng (or
now set_shared_rng) is used.
2026-05-18 12:27:44 -07:00
Josh Holtrop b38d7bf630 Rust wrapper: guard sha384 pbkdf2 unit test 2026-04-28 13:49:16 -04:00
Josh Holtrop 1e35f94f04 Rust wrapper: guard a couple unit tests that require sha512 2026-04-28 11:08:09 -04:00
Josh Holtrop 6bb8f8f5cd Rust wrapper: address Copilot review comments 2026-04-28 11:08:09 -04:00
Josh Holtrop cf199c9ab8 Rust wrapper: replace Lms::sigs_left() with Lms::has_sigs_left()
Fixes F-3094
2026-04-28 11:08:08 -04:00
Josh Holtrop 40bc5d09f7 Rust wrapper: remove return value from MlKem::encode_{public,private}_key()
Fixes F-3093
2026-04-28 11:08:08 -04:00
Josh Holtrop 0cddbb25b2 Rust wrapper: check for NUL-terminated slice in ECC::rs_hex_to_sig
Fixes F-3092
2026-04-28 11:08:08 -04:00
Josh Holtrop 79358fea80 Rust wrapper: add mac feature and implement digest/mac traits 2026-04-28 11:08:08 -04:00
Josh Holtrop 84f8b5fa13 Rust wrapper: implement kem traits 2026-04-28 11:08:08 -04:00
Josh Holtrop c08c16ee8f Rust wrapper: implement password-hash traits 2026-04-28 11:08:08 -04:00
JacobBarthelmeh 1da353b516
Merge pull request #10248 from holtrop-wolfssl/rust-digest-signature
Rust wrapper: add digest and signature crate trait implementations
2026-04-24 11:15:40 -06:00
Josh Holtrop a2b1f580c6 Rust wrapper: add buffer size checks in Rust wrapper for ChaCha20_Poly1305 one-shot encrypt/decrypt wrappers 2026-04-20 13:58:36 -04:00
Josh Holtrop 3ca90b1904 Rust wrapper: add signature implementations 2026-04-17 15:52:07 -04:00
Josh Holtrop 7f33de0882 Rust wrapper: add digest implementations 2026-04-17 15:52:07 -04:00
Josh Holtrop 4fb4b3c0c8 Rust wrapper: test BLAKE2 finalize() returns error for empty output buffer 2026-04-14 20:50:08 -04:00
Josh Holtrop e1a01926bc Rust wrapper: check length returned by Lms.get_kid() in unit test 2026-04-14 20:50:08 -04:00
Josh Holtrop 2f94121078 Rust wrapper: require caller supplied buffer for Lms.get_kid()
Fixes F-1073.
2026-04-14 20:50:08 -04:00
Josh Holtrop 23cb7ae30c Rust wrapper: add cipher trait support 2026-03-25 10:51:06 -04:00
Josh Holtrop 873bc05cde Rust wrapper: add aead trait support 2026-03-25 10:51:00 -04:00