124 Commits

Author SHA1 Message Date
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
Daniel Pouzzner 36437417b6 Merge pull request #10703 from holtrop-wolfssl/rust-validate-prefix-env-var
Rust wrapper: validate WOLFSSL_PREFIX in build.rs
2026-07-01 16:29:36 -05:00
Daniel Pouzzner a66b87b926 Merge pull request #10645 from holtrop-wolfssl/rust-ed-verify-result-codes
Rust wrapper: fix signature incorrect return value from Ed448 and Ed25519 verify functions.
2026-07-01 16:28:44 -05:00
Josh Holtrop b6d962350d Rust wrapper: rename dilithium to mldsa 2026-06-25 10:31:44 -04:00
Josh Holtrop d523e463a5 Rust wrapper: validate WOLFSSL_PREFIX in build.rs 2026-06-16 15:22:04 -04:00
Daniel Pouzzner 0097739dd8 fixes for F-3325:
wolfcrypt/src/aes.c: enforce AES-XTS K1!=K2 constraint in wc_AesXtsSetKeyNoInit() unless WC_AES_XTS_ALLOW_DUPLICATE_KEYS and !HAVE_FIPS:

tests/api/test_aes.c: add negative tests to test_wc_AesXtsSetKey() for K1==K2;

wolfcrypt/test/test.c: fix keys in aes_xts_128_inplace_test() and aes_xts_192_inplace_test() so that K1!=K2, update test vectors, and remove associated !HAVE_FIPS gating;

linuxkm/lkcapi_aes_glue.c: synchronize aes_xts_128_test() test of ciphertext stealing in-place with wolfcrypt/test/test.c.

wrapper/rust/wolfssl-wolfcrypt/src/aes.rs: synchronize XTS streaming test with wolfcrypt/test/test.c.

linuxkm/: refactor self-test sensing with version-gated setup in linuxkm_wc_port.h and refactored gates in lkcapi_glue.c.
2026-06-11 15:38:28 -05:00
Josh Holtrop f8c86ce227 Rust wrapper: fix Ed25519/Ed448 signature verify failed return values 2026-06-09 11:31:25 -04:00
Josh Holtrop 243926f5da Update wolfssl-wolfcrypt Rust crate to v2.0.0 2026-06-08 10:14:24 -04:00
Josh Holtrop 226f96db33 Rust wrapper: add comments about label pointer casts in rsa.rs 2026-06-01 14:57:58 -04:00
Josh Holtrop bdd70dd3e3 Rust wrapper: zeroize XTSStream.xtsaesstreamdata
Fix F-4467
2026-05-29 14:51:50 -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 685a6632a9 Rust wrapper: zeroize mlkem_kem seeds after use 2026-05-29 14:51:50 -04:00
Josh Holtrop 904975d5a9 Rust wrapper: add null check for kid_ptr returned from C in Lms::get_kid() 2026-05-29 14:51:50 -04:00
Josh Holtrop e3f57d5f92 Rust wrapper: fix ParamInvalid error in hash_password_customized() 2026-05-29 14:51:50 -04:00
Josh Holtrop f7a5df3489 Rust wrapper: support older non-const RSA API in rsa_pkcs1v15.rs 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 8c11a8e028 Rust wrapper: gate RSA doc tests that use set_shared_rng() on alloc feature 2026-05-18 12:49:29 -07: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 67bb40be42 Rust wrapper: fix RSA::set_rng() doc test to actually call set_rng() 2026-05-18 12:27:45 -07:00
Josh Holtrop 5e65a12b62 Rust wrapper: drop mut from rng in ecc doc tests 2026-05-18 12:27:45 -07:00
Josh Holtrop 076144cd9c Rust wrapper: avoid double wc_ecc_init_ex() call 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 0117baf011 Rust wrapper: document wolfSSL version requirement 2026-05-18 12:27:45 -07:00
Josh Holtrop 93db87e4ed Rust wrapper: remove outdated set_rng safety contract comments 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 4ed0a0a90d Rust wrapper: store pointer to C ECC key struct instead of instance
This fixes internal pointers breaking if Rust moves the ECC struct (with
some build configurations).
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
Sean Parkinson 69027c2445 LMS: fixes and improvements
Remove WC_LMS_PARM_NONE as it serves no purpose.
Change sig_len from a 16-bit value to a 32-bit value in the parameters.
Added wc_LmsKey_SetParameters_ex() and wc_LmsKey_GetParameters_ex() to
handle hash algorithm.
Change mass ForceZeros to smaller amounts with XMEMSET and setting to
NULL or default valus.
Allow signing of empty message.
Other minor fixes.

Fix API tests to work when WOLFSSL_LMS_MAX_HEIGHT/WOLFSSL_LMS_MAX_LEVELS
are/is defined.
2026-05-11 16:18:12 +10:00
David Garske 63bda771fe Merge pull request #10305 from holtrop-wolfssl/rust-crate-updates
Rust wrapper: add password-hash, kem, mac traits; fix a few Fenrir findings
2026-05-05 12:05:29 -07:00
Tobias Frauenschläger 7a2cf5b655 Remove liboqs for ML-KEM and ML-DSA, update for Falcon 2026-04-30 11:03:06 +02: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 81435c8a01 Rust wrapper: restrict RNG generic type parameters to be integers
Fixes F-3350
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 ca3c779182 Rust wrapper: use consistent rc check in ECC::shared_secret
Fixes F-2676
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 135110232f Rust wrapper: make ECC::verify_hash C result check more strict
Fixes F-1989
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