Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/line-length-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ jobs:
continue
fi

# Skip certificate/key files. These carry encoded key material
# and OpenSSL text dumps (long Issuer/Subject lines) that cannot
# be wrapped
if [[ "$file" =~ \.(pem|der)$ ]]; then
echo "Skipping $file (certificate/key file)"
continue
fi

echo "Checking: $file"

# Get added lines with actual file line numbers and check their length
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,46 @@ jobs:
jdk_version: ${{ matrix.jdk_version }}
wolfssl_configure: ${{ matrix.wolfssl_configure }}

# ----------------------- SLH-DSA (FIPS 205) --------------------------
# SLH-DSA provides full keygen/sign/verify in wolfJCE and requires wolfSSL
# to be built with --enable-slhdsa. It is not pulled in by --enable-all.
# The --enable-slhdsa option is comma-separated:
# (default/yes) the six SHAKE parameter sets (128s/128f/192s/192f/
# 256s/256f), full keygen + sign + verify
# sha2 -> adds the six SHA2 parameter sets (SLH-DSA-SHA2-*)
# 128f, sha2-128f, ... -> select individual parameter sets
# small -> WOLFSSL_WC_SLHDSA_SMALL (low-memory codepath)
# small-mem -> WOLFSSL_WC_SLHDSA_SMALL_MEM (lower-memory codepath)
# verify-only -> WOLFSSL_SLHDSA_VERIFY_ONLY (no keygen/sign)
# Extra options do not imply 'yes': parameter sets must be selected via
# 'yes', 'sha2', or per-set tokens, otherwise no set is compiled in and
# native wolfSSL fails to build ("No parameters defined"). SHAKE256/SHA-3
# dependencies are auto-enabled by wolfSSL configure, so no --enable-sha3
# is needed. JUnit tests probe per parameter set and per capability, so
# each permutation runs what it can and skips the rest. Permutations:
# default SHAKE-only, all 12 sets, all 12 + small codepath, a reduced
# per-set selection + small-mem codepath, verify-only degradation, and
# --enable-all interop.
linux-zulu-slhdsa:
strategy:
matrix:
os: [ 'ubuntu-latest', 'macos-latest' ]
jdk_version: [ '11', '21', '24' ]
wolfssl_configure:
- '--enable-jni --enable-slhdsa'
- '--enable-jni --enable-slhdsa=yes,sha2'
- '--enable-jni --enable-slhdsa=yes,sha2,small'
- '--enable-jni --enable-slhdsa=128f,sha2-128f,small-mem'
- '--enable-jni --enable-slhdsa=yes,sha2,verify-only'
- '--enable-jni --enable-all --enable-slhdsa=yes,sha2'
name: ${{ matrix.os }} (Zulu JDK ${{ matrix.jdk_version }}, ${{ matrix.wolfssl_configure }})
uses: ./.github/workflows/linux-common.yml
with:
os: ${{ matrix.os }}
jdk_distro: "zulu"
jdk_version: ${{ matrix.jdk_version }}
wolfssl_configure: ${{ matrix.wolfssl_configure }}

# ------------------ Facebook Infer static analysis -------------------
# Run Facebook infer over PR code, only running on Linux with one
# JDK/version for now.
Expand Down
1 change: 1 addition & 0 deletions IDE/Android/app/src/main/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@ add_library(wolfcryptjni SHARED
${wolfcryptjni_DIR}/jni/jni_md5.c
${wolfcryptjni_DIR}/jni/jni_mldsa.c
${wolfcryptjni_DIR}/jni/jni_mlkem.c
${wolfcryptjni_DIR}/jni/jni_slhdsa.c
${wolfcryptjni_DIR}/jni/jni_native_struct.c
${wolfcryptjni_DIR}/jni/jni_pwdbased.c
${wolfcryptjni_DIR}/jni/jni_rng.c
Expand Down
1 change: 1 addition & 0 deletions IDE/WIN/wolfcryptjni.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
<ClCompile Include="..\..\jni\jni_md5.c" />
<ClCompile Include="..\..\jni\jni_mldsa.c" />
<ClCompile Include="..\..\jni\jni_mlkem.c" />
<ClCompile Include="..\..\jni\jni_slhdsa.c" />
<ClCompile Include="..\..\jni\jni_native_struct.c" />
<ClCompile Include="..\..\jni\jni_pwdbased.c" />
<ClCompile Include="..\..\jni\jni_rng.c" />
Expand Down
3 changes: 3 additions & 0 deletions IDE/WIN/wolfcryptjni.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,9 @@
<ClCompile Include="..\..\jni\jni_mldsa.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\jni\jni_slhdsa.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\jni\jni_native_struct.c">
<Filter>Source Files</Filter>
</ClCompile>
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,16 @@ JDK SUN provider: it registers the LMS `Signature` (verification) and
`KeyFactory` (public-key) services. wolfJCE does not generate LMS keys or sign,
since stateful hash-based signing belongs in hardware (NIST SP 800-208).

**Note on SLH-DSA (FIPS 205):** SLH-DSA support is **not** enabled by default
in `--enable-jni`. To use the SLH-DSA `Signature`, `KeyPairGenerator`, and
`KeyFactory` services (and SLH-DSA keys in the WKS KeyStore), add
`--enable-slhdsa` to the native wolfSSL `./configure` line. The parameter-set
families are selected by the configure value: `--enable-slhdsa` builds the six
SHAKE sets, and `--enable-slhdsa=yes,sha2` builds all twelve and is the
recommended configuration for SHA2 parameter-set support (the
`SLH-DSA-SHA2-128f` default lives in the SHA2 family). Without SLH-DSA, wolfJCE
compiles and runs normally but the SLH-DSA services are not registered.

**wolfSSL Standard Build**:
```
$ cd wolfssl-x.x.x
Expand Down
83 changes: 80 additions & 3 deletions README_JCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,56 @@ The JCE provider currently supports the following algorithms:
OID: 1.3.6.1.5.5.7.6.35
LMS (also registered as HSS/LMS)
OID: 1.2.840.113549.1.9.16.3.17
SLH-DSA (any SLH-DSA parameter set key)
SLH-DSA-SHA2-128s
OID: 2.16.840.1.101.3.4.3.20
SLH-DSA-SHA2-128f
OID: 2.16.840.1.101.3.4.3.21
SLH-DSA-SHA2-192s
OID: 2.16.840.1.101.3.4.3.22
SLH-DSA-SHA2-192f
OID: 2.16.840.1.101.3.4.3.23
SLH-DSA-SHA2-256s
OID: 2.16.840.1.101.3.4.3.24
SLH-DSA-SHA2-256f
OID: 2.16.840.1.101.3.4.3.25
SLH-DSA-SHAKE-128s
OID: 2.16.840.1.101.3.4.3.26
SLH-DSA-SHAKE-128f
OID: 2.16.840.1.101.3.4.3.27
SLH-DSA-SHAKE-192s
OID: 2.16.840.1.101.3.4.3.28
SLH-DSA-SHAKE-192f
OID: 2.16.840.1.101.3.4.3.29
SLH-DSA-SHAKE-256s
OID: 2.16.840.1.101.3.4.3.30
SLH-DSA-SHAKE-256f
OID: 2.16.840.1.101.3.4.3.31
HASH-SLH-DSA (pre-hash, any SLH-DSA parameter set key)
SLH-DSA-SHA2-128s-WITH-SHA256
OID: 2.16.840.1.101.3.4.3.35
SLH-DSA-SHA2-128f-WITH-SHA256
OID: 2.16.840.1.101.3.4.3.36
SLH-DSA-SHA2-192s-WITH-SHA512
OID: 2.16.840.1.101.3.4.3.37
SLH-DSA-SHA2-192f-WITH-SHA512
OID: 2.16.840.1.101.3.4.3.38
SLH-DSA-SHA2-256s-WITH-SHA512
OID: 2.16.840.1.101.3.4.3.39
SLH-DSA-SHA2-256f-WITH-SHA512
OID: 2.16.840.1.101.3.4.3.40
SLH-DSA-SHAKE-128s-WITH-SHAKE128
OID: 2.16.840.1.101.3.4.3.41
SLH-DSA-SHAKE-128f-WITH-SHAKE128
OID: 2.16.840.1.101.3.4.3.42
SLH-DSA-SHAKE-192s-WITH-SHAKE256
OID: 2.16.840.1.101.3.4.3.43
SLH-DSA-SHAKE-192f-WITH-SHAKE256
OID: 2.16.840.1.101.3.4.3.44
SLH-DSA-SHAKE-256s-WITH-SHAKE256
OID: 2.16.840.1.101.3.4.3.45
SLH-DSA-SHAKE-256f-WITH-SHAKE256
OID: 2.16.840.1.101.3.4.3.46

KeyAgreement Class
DiffieHellman
Expand Down Expand Up @@ -262,6 +312,19 @@ The JCE provider currently supports the following algorithms:
ML-DSA-44 (alias OID: 2.16.840.1.101.3.4.3.17)
ML-DSA-65 (alias OID: 2.16.840.1.101.3.4.3.18)
ML-DSA-87 (alias OID: 2.16.840.1.101.3.4.3.19)
SLH-DSA (defaults to SLH-DSA-SHA2-128f, set overridable via init())
SLH-DSA-SHA2-128s (alias OID: 2.16.840.1.101.3.4.3.20)
SLH-DSA-SHA2-128f (alias OID: 2.16.840.1.101.3.4.3.21)
SLH-DSA-SHA2-192s (alias OID: 2.16.840.1.101.3.4.3.22)
SLH-DSA-SHA2-192f (alias OID: 2.16.840.1.101.3.4.3.23)
SLH-DSA-SHA2-256s (alias OID: 2.16.840.1.101.3.4.3.24)
SLH-DSA-SHA2-256f (alias OID: 2.16.840.1.101.3.4.3.25)
SLH-DSA-SHAKE-128s (alias OID: 2.16.840.1.101.3.4.3.26)
SLH-DSA-SHAKE-128f (alias OID: 2.16.840.1.101.3.4.3.27)
SLH-DSA-SHAKE-192s (alias OID: 2.16.840.1.101.3.4.3.28)
SLH-DSA-SHAKE-192f (alias OID: 2.16.840.1.101.3.4.3.29)
SLH-DSA-SHAKE-256s (alias OID: 2.16.840.1.101.3.4.3.30)
SLH-DSA-SHAKE-256f (alias OID: 2.16.840.1.101.3.4.3.31)
ML-KEM (defaults to ML-KEM-768, level overridable via init())
ML-KEM-512 (alias OID: 2.16.840.1.101.3.4.4.1)
ML-KEM-768 (alias OID: 2.16.840.1.101.3.4.4.2)
Expand All @@ -275,6 +338,19 @@ The JCE provider currently supports the following algorithms:
ML-DSA-44 (alias OID: 2.16.840.1.101.3.4.3.17)
ML-DSA-65 (alias OID: 2.16.840.1.101.3.4.3.18)
ML-DSA-87 (alias OID: 2.16.840.1.101.3.4.3.19)
SLH-DSA
SLH-DSA-SHA2-128s (alias OID: 2.16.840.1.101.3.4.3.20)
SLH-DSA-SHA2-128f (alias OID: 2.16.840.1.101.3.4.3.21)
SLH-DSA-SHA2-192s (alias OID: 2.16.840.1.101.3.4.3.22)
SLH-DSA-SHA2-192f (alias OID: 2.16.840.1.101.3.4.3.23)
SLH-DSA-SHA2-256s (alias OID: 2.16.840.1.101.3.4.3.24)
SLH-DSA-SHA2-256f (alias OID: 2.16.840.1.101.3.4.3.25)
SLH-DSA-SHAKE-128s (alias OID: 2.16.840.1.101.3.4.3.26)
SLH-DSA-SHAKE-128f (alias OID: 2.16.840.1.101.3.4.3.27)
SLH-DSA-SHAKE-192s (alias OID: 2.16.840.1.101.3.4.3.28)
SLH-DSA-SHAKE-192f (alias OID: 2.16.840.1.101.3.4.3.29)
SLH-DSA-SHAKE-256s (alias OID: 2.16.840.1.101.3.4.3.30)
SLH-DSA-SHAKE-256f (alias OID: 2.16.840.1.101.3.4.3.31)
ML-KEM
ML-KEM-512 (alias OID: 2.16.840.1.101.3.4.4.1)
ML-KEM-768 (alias OID: 2.16.840.1.101.3.4.4.2)
Expand Down Expand Up @@ -422,9 +498,10 @@ FIPS 140-2/3.
#### Stored Object Compatibility

The WKS KeyStore supports storage of PrivateKey, Certificate, and SecretKey
objects. PrivateKey storage includes RSA, ECC, and ML-DSA (FIPS 204) keys.
ML-DSA key support requires native wolfSSL to be built with ML-DSA enabled
(see the ML-DSA note in [README.md](./README.md)).
objects. PrivateKey storage includes RSA, ECC, ML-DSA (FIPS 204), and SLH-DSA
(FIPS 205) keys. ML-DSA and SLH-DSA key support requires native wolfSSL to be
built with the respective algorithm enabled (see the ML-DSA and SLH-DSA notes
in [README.md](./README.md)).

#### Converting Other KeyStore Formats to WKS

Expand Down
4 changes: 4 additions & 0 deletions examples/certs/slhdsa/root-slhdsa-sha2-128s-priv.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-----BEGIN PRIVATE KEY-----
MFICAQAwCwYJYIZIAWUDBAMUBEBIDLnGQ7/b2dqaWSNZ6GNUDPTUVnm6hv7L66kx
FwCox6bgJKhKGBBNzcbaIyRn3paVgQCmys5D5P38exqM+ut+
-----END PRIVATE KEY-----
Loading
Loading