1
0
mirror of https://github.com/wolfSSL/wolfssl.git synced 2026-10-24 04:09:07 +03:00

126 Commits

Author SHA1 Message Date
Aidan Keefe
aa3f7cb6e3 remove depriacted build option 2026-10-20 16:40:06 -07:00
jackctj117
fb67a7ebab Move C# FIPS wrapper ignores to the root .gitignore 2026-10-02 11:25:35 -06:00
jackctj117
aa4b743e19 Remove ACVP vector tests from the C# wrapper suite 2026-10-02 09:32:25 -06:00
jackctj117
acd900bcb8 Tighten argument checks and zero secrets when the read gate fails 2026-09-28 13:54:40 -06:00
jackctj117
7e94a2e6b7 Build test hooks only into the test project's copy of the wrapper 2026-09-28 10:07:01 -06:00
jackctj117
a67667cf86 Return false from verify and key checks only for invalid input 2026-09-28 10:07:01 -06:00
jackctj117
af2275c278 Zero AES output on failure and warn one message per DRBG-IV encryptor 2026-09-28 10:06:51 -06:00
jackctj117
1a442b00f1 Rename TLS 1.3 test variables flagged by codespell 2026-09-25 14:17:37 -06:00
jackctj117
7548f5b404 End a FipsCmac on any Final result 2026-09-25 12:39:03 -06:00
jackctj117
4885e2409d Pin returned secrets, close the EMS label bypass, require FIPS version in helper 2026-09-25 12:15:21 -06:00
jackctj117
96d60a0765 Scope wrapper to FIPS v5.2.1 and shorten comments 2026-09-25 10:14:48 -06:00
jackctj117
3b55d494bc Rewrite C# FIPS wrapper README with build and usage instructions 2026-09-25 09:29:11 -06:00
jackctj117
d00b079517 Serialize RSA key and CCM calls 2026-09-25 09:16:16 -06:00
jackctj117
337a7d69b5 Limit wrapper to validated boundary services 2026-09-25 09:16:16 -06:00
jackctj117
06e378b9c7 Harden wrapper from code review findings 2026-09-25 09:16:16 -06:00
jackctj117
956b7abeba Target .NET 8 and .NET 10 2026-09-25 09:16:16 -06:00
jackctj117
313e13e5ff Enforce FIPS usage rules from compliance audit 2026-09-25 09:16:16 -06:00
jackctj117
8ced00c3f4 Add FIPS forced-failure tests 2026-09-25 09:16:16 -06:00
jackctj117
0d3e286f01 Add FipsKdf (TLS 1.2, TLS 1.3, HKDF, SSH) 2026-09-25 09:16:16 -06:00
jackctj117
088a5e1aab Add FipsEccKey and FipsDh 2026-09-25 09:16:16 -06:00
jackctj117
ec6299f91c Add FipsRsaKey 2026-09-25 09:16:16 -06:00
jackctj117
202bcb0cda Add AES ECB/CBC/CTR/OFB, GCM, GMAC and CCM 2026-09-25 09:16:16 -06:00
jackctj117
e1ece2a224 Add FipsHash, FipsHmac and FipsCmac 2026-09-25 09:16:16 -06:00
jackctj117
c4ce8f411f Run C# FIPS known-answer tests from ACVP vectors 2026-09-25 09:16:16 -06:00
jackctj117
8d4b11b642 Add FipsRng (Hash_DRBG) 2026-09-25 09:16:16 -06:00
jackctj117
79ce64cf51 Add C# wrapper for the wolfCrypt FIPS v5.2.3 boundary 2026-09-25 09:16:16 -06:00
Eric Blankenhorn
b19c64b11b Fix from review 2026-09-17 07:27:17 -05:00
Eric Blankenhorn
96410fde25 MSVC: pass SP feature defines to ml64 for sp_x86_64_asm.asm 2026-09-17 07:18:29 -05:00
Daniele Lacamera
509b29bc9c Remove liboqs dependency
Falcon was the last algorithm backed by liboqs; now that wolfCrypt has a
native Falcon implementation, liboqs is no longer needed. Remove the
integration entirely so liboqs does not appear as a build or SBOM dependency:

  - configure: drop --with-liboqs (and the -loqs link), the BUILD_LIBOQS
    conditional and the summary line.
  - CMake: drop WOLFSSL_OQS, the duplicate liboqs-backed WOLFSSL_FALCON
    option, the OQS cross-validation / find_package(OQS) block, the
    FindOQS.cmake module, BUILD_OQS_HELPER, and HAVE_LIBOQS from options.h.in.
  - Remove the wolfcrypt/src/port/liboqs port layer (liboqs.c/.h) and its
    wolfSSL_liboqsInit/Close calls in wc_port.c.
  - settings.h: drop HAVE_LIBOQS from the asym key import/export aggregates
    (HAVE_FALCON already covers them) and from the experimental gate; add
    HAVE_FALCON to the experimental gate so the unstandardized Falcon requires
    WOLFSSL_EXPERIMENTAL_SETTINGS in every build system.
  - Drop liboqs.c from the VS/Zephyr/INTIME project files, remove the liboqs
    install from Docker, and update INSTALL/tls.c text (Falcon is native now).

No functional change to non-Falcon builds; the library links no liboqs.
2026-07-22 09:52:26 +02:00
Tobias Frauenschläger
673d8d00bb Merge pull request #10778 from SparkiDev/time_stamp_protocol
Time-Stamp Protocol (RFC 3161)
2026-07-08 17:43:38 +02:00
Sean Parkinson
ae023a5643 Time-Stamp Protocol (RFC 3161)
Implementation in wolfCrypt
OpenSSL compatibility layer in wolfSSL
Added tests, certificates, examples.
2026-07-08 09:33:47 +10:00
Sean Parkinson
bcef8f4f6d Add Windows assembly files to the build
Windows ASM files generated along side the ATT assembly files.
Adding them to the build so they can be used.
2026-07-07 08:02:20 +10:00
Sean Parkinson
a342eba578 Intel x64 ASM: Add new assembly for AES
Support AES-XTS AVX512/VAES
Support AES-GCM AVX512/VAES
Support AES-ECB/CBC/CTR AVX512/VAES/AVX1/AES-NI.
Remove code from aes_asm.S/aes_asm.asm
Add CPU defines for AVX512 and VAES
Updated ASM files with new defines for AVX512.
Added support for printing out the new CPU Id flags in benchmark.
Added new files to Windows projects.
aes.c: Supports ECB/CBC/CTR in assembly. Supports calling AVX512/VAES assembly.
2026-06-23 20:54:59 +10:00
Tobias Frauenschläger
2832df2139 Update C# wrapper to new ML-DSA names 2026-05-16 09:48:35 -05:00
Tobias Frauenschläger
fb6b62dd8e Rename Dilithium to canonical ML-DSA (FIPS 204) names
NIST standardized the pre-standardization Dilithium signature scheme as
ML-DSA in FIPS 204. Migrate the provider's user-visible surface to
canonical spellings, with a temporary shim that preserves source-level
backward compatibility for existing consumers.

Renames
-------
* File: wolfcrypt/src/dilithium.c -> wolfcrypt/src/wc_mldsa.c
* New canonical header: wolfssl/wolfcrypt/wc_mldsa.h
* Types: dilithium_key -> MlDsaKey, wc_dilithium_params -> MlDsaParams
* Functions: wc_dilithium_* / wc_Dilithium_* -> wc_MlDsaKey_*
* Build gates: HAVE_DILITHIUM -> WOLFSSL_HAVE_MLDSA,
  WOLFSSL_DILITHIUM_* / WC_DILITHIUM_* -> WOLFSSL_MLDSA_* / WC_MLDSA_*
* Configure flag: --enable-mldsa (legacy --enable-dilithium still works)
* CMake option: WOLFSSL_MLDSA (legacy WOLFSSL_DILITHIUM emits a
  DEPRECATION message)

Backward compatibility
----------------------
wolfssl/wolfcrypt/dilithium.h is now a temporary compatibility shim:
* Forward-translates legacy build gates to canonical (the two sub-gates
  read by certs_test.h are translated in settings.h so the auto-generated
  header is reachable without including dilithium.h; the remainder lives
  in dilithium.h itself).
* Reverse-translates canonical gates back to legacy so unmigrated
  consumer code keying off HAVE_DILITHIUM / WOLFSSL_DILITHIUM_* keeps
  compiling.
* Provides macro / static-inline aliases for the legacy type and
  function names so source-level callers compile unchanged. Sets
  WC_DILITHIUMKEY_TYPE_DEFINED to suppress strict-C99 typedef
  redefinition in asn_public.h.

Two opt-outs are honored: WOLFSSL_NO_DILITHIUM_LEGACY_GATES disables
build-gate translation; WOLFSSL_NO_DILITHIUM_LEGACY_NAMES disables the
symbol aliases. Both are temporary and the shim will be removed in a
future release. doc/dilithium-to-mldsa-migration.md describes the
migration path for downstream consumers.

ABI note
--------
The library now exports wc_MlDsaKey_* instead of wc_dilithium_*.
Pre-built binaries that linked against the legacy symbols need to
recompile against the shim header (which resolves to the new symbols at
compile time) or migrate to the canonical names directly. Source code
keeps building unchanged.

Other changes
-------------
* wolfssl/wolfcrypt/memory.h: drop ML-DSA sub-gate branching for static
  memory pool sizing; WOLFSSL_HAVE_MLDSA builds now pick the larger
  LARGEST_MEM_BUCKET / WOLFMEM_BUCKETS / WOLFMEM_DIST unconditionally.
  Override these macros for small-mem builds.
* gencertbuf.pl + wolfssl/certs_test.h: outer guards migrated to the
  canonical WOLFSSL_HAVE_MLDSA spelling.
* tests/api/test_mldsa.c: adds compile-time API surface validators
  (canonical wc_MlDsaKey_* surface plus legacy alias surface) so
  signature drift produces a build error during make check.
* IDE files (Xcode, INTIME-RTOS, WIN10, VS2022, CSharp wrapper), Zephyr
  CMakeLists.txt, and autotools include.am updated for the rename.
* DYNAMIC_TYPE_DILITHIUM and ML_DSA_PCT_E retained as internal symbols;
  scheduled to be renamed alongside the eventual shim removal.
2026-05-16 09:48:35 -05:00
Tobias Frauenschläger
9393d62591 Replace liboqs SPHINCS+ with SLH-DSA in certificate layer
Replace the liboqs-based pre-standardization SPHINCS+ implementation
with the native FIPS 205 SLH-DSA implementation across the
certificate / ASN.1 / X.509 layers, and add SLH-DSA-rooted test
certificates plus TLS 1.3 .conf scenarios that exercise the new
verification path. All liboqs SPHINCS+ code is removed.

This enables SLH-DSA for certificate chain authentication: CA
certificates signed with SLH-DSA, certificate signature verification
against an SLH-DSA root. TLS 1.3 entity authentication via
CertificateVerify with SLH-DSA will be added in a follow-up PR.

Follows RFC 9909 (X.509 Algorithm Identifiers for SLH-DSA) and
NIST FIPS 205. Supports both SHAKE and SHA-2 parameter families
across all twelve standardized variants.

DER codec:
- New PrivateKeyDecode, PublicKeyDecode, KeyToDer, PrivateKeyToDer,
  PublicKeyToDer with RFC 9909 encoding (bare OCTET STRING containing
  4*n raw bytes = SK.seed || SK.prf || PK.seed || PK.root, no nested
  wrapper). OID auto-detection across all twelve SHAKE / SHA-2 variants.
- PublicKeyDecode raw-bytes fast path mirrors wc_Falcon_PublicKeyDecode
  and wc_Dilithium_PublicKeyDecode so callers (notably
  wolfssl_x509_make_der and ConfirmSignature, which pass the raw
  BIT STRING contents stashed by StoreKey) decode correctly. Honours
  the caller's *inOutIdx start offset.
- Error paths in Private/PublicKeyDecode preserve params/flags/
  inOutIdx and only ForceZero the buffer half each helper actually
  writes; skip the wipe entirely on BAD_LENGTH_E (no bytes touched).
- ImportPublic uses |= on flags so a Private-then-Public import
  sequence retains FLAG_PRIVATE.

OID dispatch:
- 12 standardized NIST OIDs (6 SHAKE + 6 SHA-2) per RFC 9909. The
  pre-standardization OID-collision mechanism is removed since NIST
  OIDs do not collide.
- wc_SlhDsaOidToParam / wc_SlhDsaOidToCertType return NOT_COMPILED_IN
  (rather than -1) for recognised SLH-DSA OIDs whose parameter set
  isn't built; wc_IsSlhDsaOid recognises both. The x509 dispatch
  surfaces this as a precise diagnostic instead of the generic
  "No public key found".
- wc_GetKeyOID picks a placeholder parameter from whatever variant is
  compiled in and #errors at compile time if none is.
- asn_orig.c EncodeCert / EncodeCertReq accept SHA-2 SLH-DSA keyTypes
  alongside SHAKE.

Tests and fixtures:
- Test cert chain in certs/slhdsa/: SLH-DSA-SHAKE-128s and
  SLH-DSA-SHA2-128s self-signed roots that sign reused ML-DSA-44
  entity keys (server + client), plus the gen script
  (gen-slhdsa-mldsa-certs.sh, OpenSSL >= 3.5).
- New TLS 1.3 .conf scenarios under tests/suites.c dispatch:
  test-tls13-slhdsa-shake.conf, test-tls13-slhdsa-sha2.conf, and a
  wrong-CA negative test test-tls13-slhdsa-fail.conf.
- DER round-trip and on-disk decode tests; bench_slhdsa_*_key.der
  fixtures regenerated with wolfSSL's own encoder so the codec is
  pinned to RFC 9909.
- New unit test test_wc_slhdsa_x509_i2d_roundtrip exercises the raw
  PublicKeyDecode entry point that wolfssl_x509_make_der relies on.
- test_wc_slhdsa_check_key now tests both Public-then-Private and
  Private-then-Public import orderings.

Build / ABI:
- DYNAMIC_TYPE_SPHINCS = 98 kept as RESERVED with a tombstone comment
  for ABI stability; new code should use DYNAMIC_TYPE_SLHDSA (107).
- All build system / IDE project files updated; SPHINCS+ sources,
  headers, and test data removed.
- Dead bench_slhdsa_*_key arrays removed from gencertbuf.pl and
  certs_test.h; the .der files on disk drive the decode tests.
2026-04-30 18:32:07 +02:00
Tobias Frauenschläger
7a2cf5b655 Remove liboqs for ML-KEM and ML-DSA, update for Falcon 2026-04-30 11:03:06 +02:00
David Garske
d692f99631 More peer review fixes (Use ML-DSA naming) 2026-04-13 15:55:31 -07:00
David Garske
5f124a9ae9 Peer review fixes 2026-04-13 15:30:58 -07:00
David Garske
72c57dc127 Improvements to C# PQC 2026-04-13 15:30:57 -07:00
Masaki Iwai
21be3776bd add ML-KEM/ML-DSA support for C# wrapper 2026-04-13 15:29:57 -07:00
David Garske
a82583d50b Add HPKE (RFC 9180) C# wrapper and test 2026-04-12 14:50:11 -07:00
JacobBarthelmeh
a156ed7bc7 update Copyright year 2026-02-18 09:52:21 -07:00
David Garske
46251bb401 Fix issue with NO_DES3_TLS_SUITES 2026-01-27 14:42:41 -08:00
JacobBarthelmeh
9debdda1fa fix for C# wrapper Ed25519 import raw key and fix Curve25519 private key decode 2025-10-10 12:32:14 -06:00
JacobBarthelmeh
a081a033fd add C# raw public Ed25519 key export/import test 2025-10-10 12:29:05 -06:00
JacobBarthelmeh
459a4be339 add SNI support by default to user_settings.h with C# wrapper 2025-10-07 16:43:30 -06:00
JacobBarthelmeh
5c4801fca1 update mono build README instructions and add test case 2025-10-07 15:51:02 -06:00
JacobBarthelmeh
629c5b4cf6 updating license from GPLv2 to GPLv3 2025-07-10 16:11:36 -06:00
David Garske
4c6279c6c7 Good feedback about adding wolfCrypt error codes to .cs layer. Partially added useful ones. 2025-06-20 09:41:35 -07:00