Skip to content

Commit a4d1187

Browse files
authored
Merge pull request #19 from danielinux/PSA-1.4
Update specs to PSA 1.4 + Low/Info fenrir fixes
2 parents e8f6f9a + ee99669 commit a4d1187

47 files changed

Lines changed: 11881 additions & 1630 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build-config-matrix.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: sha512-family
2727
modifiers: "-WOLFSSL_SHA512 -WOLFSSL_SHA384 -HAVE_ED25519 -WOLFSSL_ED25519_STREAMING_VERIFY -HAVE_ED448 -WOLFSSL_ED448_STREAMING_VERIFY +NO_SHA512"
2828
- name: sha3-ed448
29-
modifiers: "-WOLFSSL_SHA3 -WOLFSSL_SHAKE128 -WOLFSSL_SHAKE256 -WOLFSSL_HAVE_MLDSA -HAVE_ED448 -WOLFSSL_ED448_STREAMING_VERIFY"
29+
modifiers: "-WOLFSSL_SHA3 -WOLFSSL_SHAKE128 -WOLFSSL_SHAKE256 -WOLFSSL_HAVE_MLDSA -WOLFSSL_HAVE_MLKEM -HAVE_ED448 -WOLFSSL_ED448_STREAMING_VERIFY"
3030
- name: des3
3131
modifiers: "-WOLFSSL_DES3 -WOLFSSL_DES_ECB +NO_DES3"
3232
- name: aes-gcm
@@ -44,9 +44,9 @@ jobs:
4444
- name: des-ecb
4545
modifiers: "-WOLFSSL_DES_ECB"
4646
- name: cmac
47-
modifiers: "-WOLFSSL_CMAC"
47+
modifiers: "-WOLFSSL_CMAC -HAVE_CMAC_KDF"
4848
- name: chacha20-poly1305
49-
modifiers: "-HAVE_CHACHA -HAVE_POLY1305"
49+
modifiers: "-HAVE_CHACHA -HAVE_POLY1305 -HAVE_XCHACHA"
5050
- name: curve25519
5151
modifiers: "-HAVE_CURVE25519"
5252
- name: ed25519
@@ -59,6 +59,18 @@ jobs:
5959
modifiers: "-WOLFSSL_HAVE_MLDSA"
6060
- name: mldsa-44-only
6161
modifiers: "+WOLFSSL_NO_ML_DSA_65 +WOLFSSL_NO_ML_DSA_87"
62+
- name: mlkem
63+
modifiers: "-WOLFSSL_HAVE_MLKEM"
64+
- name: lms-xmss
65+
modifiers: "-WOLFSSL_HAVE_LMS -WOLFSSL_LMS_VERIFY_ONLY -WOLFSSL_HAVE_XMSS -WOLFSSL_XMSS_VERIFY_ONLY"
66+
- name: ascon
67+
modifiers: "-HAVE_ASCON"
68+
- name: aes-keywrap
69+
modifiers: "-HAVE_AES_KEYWRAP -WOLFSSL_AES_DIRECT"
70+
- name: xchacha
71+
modifiers: "-HAVE_XCHACHA"
72+
- name: cmac-kdf
73+
modifiers: "-HAVE_CMAC_KDF"
6274
- name: hkdf
6375
modifiers: "-HAVE_HKDF -HAVE_ECC_ENCRYPT"
6476
- name: tls-prf

.github/workflows/test-psa-api.yml

Lines changed: 37 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -27,39 +27,44 @@ jobs:
2727
run: make -C test rebuild-wolfssl-psa
2828

2929
- name: Build PSA API tests
30-
run: make -C test psa_api_test psa_des3_stack_scrub_test psa_ecc_bit_inference_test psa_ecc_curve_id_test psa_random_size_test
30+
run: >
31+
make -C test
32+
psa_api_test
33+
psa_des3_stack_scrub_test
34+
psa_ecc_bit_inference_test
35+
psa_ecc_curve_id_test
36+
psa_random_size_test
37+
psa_rsa_pss_interop_test
38+
psa_mldsa_test
39+
psa_mlkem_test
40+
psa_xof_test
41+
psa_key_wrap_test
42+
psa_sign_context_test
43+
psa_lms_xmss_verify_test
44+
psa_ascon_xchacha_test
45+
psa_sp800_108_test
46+
psa_14_misc_test
3147
32-
- name: Run PSA API test
48+
- name: Run PSA API tests
3349
env:
3450
LD_LIBRARY_PATH: ${{ github.workspace }}:${{ github.workspace }}/../wolfssl/src/.libs
3551
run: |
36-
rm -rf test/.store
37-
./test/psa_api_test
38-
39-
- name: Run ECC bit inference test
40-
env:
41-
LD_LIBRARY_PATH: ${{ github.workspace }}:${{ github.workspace }}/../wolfssl/src/.libs
42-
run: |
43-
rm -rf test/.store
44-
./test/psa_ecc_bit_inference_test
45-
46-
- name: Run DES3 stack scrub test
47-
env:
48-
LD_LIBRARY_PATH: ${{ github.workspace }}:${{ github.workspace }}/../wolfssl/src/.libs
49-
run: |
50-
rm -rf test/.store
51-
./test/psa_des3_stack_scrub_test
52-
53-
- name: Run ECC curve id test
54-
env:
55-
LD_LIBRARY_PATH: ${{ github.workspace }}:${{ github.workspace }}/../wolfssl/src/.libs
56-
run: |
57-
rm -rf test/.store
58-
./test/psa_ecc_curve_id_test
59-
60-
- name: Run random size test
61-
env:
62-
LD_LIBRARY_PATH: ${{ github.workspace }}:${{ github.workspace }}/../wolfssl/src/.libs
63-
run: |
64-
rm -rf test/.store
65-
./test/psa_random_size_test
52+
for t in psa_api_test \
53+
psa_ecc_bit_inference_test \
54+
psa_des3_stack_scrub_test \
55+
psa_ecc_curve_id_test \
56+
psa_random_size_test \
57+
psa_rsa_pss_interop_test \
58+
psa_mldsa_test \
59+
psa_mlkem_test \
60+
psa_xof_test \
61+
psa_key_wrap_test \
62+
psa_sign_context_test \
63+
psa_lms_xmss_verify_test \
64+
psa_ascon_xchacha_test \
65+
psa_sp800_108_test \
66+
psa_14_misc_test; do
67+
echo "=== $t ==="
68+
rm -rf test/.store
69+
./test/$t
70+
done

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,12 @@ wolfcrypt-psa-benchmark
1919
.store/
2020
*.log
2121
.codex
22+
test/psa_mldsa_test
23+
test/psa_mlkem_test
24+
test/psa_xof_test
25+
test/psa_key_wrap_test
26+
test/psa_sign_context_test
27+
test/psa_lms_xmss_verify_test
28+
test/psa_ascon_xchacha_test
29+
test/psa_sp800_108_test
30+
test/psa_14_misc_test

CHANGELOG.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,60 @@
11
# Changelog
22

3+
## Unreleased: PSA Certified Crypto API 1.4 + PQC extension 1.4
4+
5+
Upgrade of the public API surface and implementation to PSA Certified
6+
Crypto API 1.4 Final and the PQC extension 1.4, built against current
7+
wolfSSL master.
8+
9+
### Breaking changes
10+
11+
- ML-DSA now follows the PSA 1.4 PQC extension: key bits are 128/192/256
12+
(security strength, ML-DSA-44/65/87) instead of the previous 2/3/5
13+
level convention, and the key-pair import/export format is the 32-byte
14+
FIPS 204 seed xi (public keys remain raw pk bytes).
15+
- The nonstandard `psa_ml_dsa_generate_key/sign/verify` exports and the
16+
`PSA_ML_DSA_PARAMETER_*` / `psa_ml_dsa_parameter_t` macros were removed;
17+
use the standard PSA key management and signature APIs instead.
18+
19+
### Added
20+
21+
- Key encapsulation: `psa_encapsulate()` / `psa_decapsulate()` with
22+
PSA_ALG_ML_KEM. ML-KEM key pairs use the 64-byte d||z seed format with
23+
bits 512/768/1024; the shared secret is returned as a new key.
24+
- ML-DSA through the standard APIs: hedged and deterministic pure ML-DSA
25+
via `psa_sign_message`/`psa_verify_message`, plus HashML-DSA variants
26+
usable through both the message and hash entry points.
27+
- Context-aware signatures: `psa_sign_message_with_context()`,
28+
`psa_verify_message_with_context()`, `psa_sign_hash_with_context()`,
29+
`psa_verify_hash_with_context()` and PSA_ALG_EDDSA_CTX (Ed25519ctx),
30+
with context support for Ed25519ph/Ed448 and the ML-DSA family.
31+
- Verify-only LMS/HSS and XMSS/XMSS^MT public-key support through
32+
`psa_verify_message` (PSA_ALG_LMS/HSS/XMSS/XMSS_MT).
33+
- XOF API: incremental SHAKE128/SHAKE256 via `psa_xof_setup/update/
34+
output/abort` (Ascon XOFs report NOT_SUPPORTED).
35+
- Key wrapping: `psa_wrap_key()` / `psa_unwrap_key()` with PSA_ALG_KW
36+
(AES-KW, RFC 3394) and the new WRAP/UNWRAP usage flags (PSA_ALG_KWP
37+
reports NOT_SUPPORTED).
38+
- Ascon-Hash256 and Ascon-AEAD128 (one-shot), XChaCha20-Poly1305
39+
(one-shot, 24-byte nonce) with the PSA_KEY_TYPE_XCHACHA20/ASCON key
40+
types.
41+
- SP800-108r1 counter-mode KDFs: PSA_ALG_SP800_108_COUNTER_HMAC(hash)
42+
and PSA_ALG_SP800_108_COUNTER_CMAC.
43+
- `psa_check_key_usage()`, `psa_generate_key_custom()` and
44+
`psa_key_derivation_output_key_custom()` (default parameters only).
45+
- 1.4 semantic change: ECDSA and deterministic ECDSA are treated as
46+
equivalent when verifying signatures.
47+
- Complete 1.4 macro surface: PQC classifier/encoding macros (ML-DSA,
48+
ML-KEM, SLH-DSA, LMS/HSS, XMSS), WPA3-SAE values, encapsulation and
49+
key-wrap size macros, hash-suspend format constants, and PQC arms in
50+
the signature/export size macros (PSA_SIGNATURE_MAX_SIZE is now 4627).
51+
- Stubs returning PSA_ERROR_NOT_SUPPORTED for the interruptible
52+
operations, `psa_attach_key()` and `psa_hash_suspend/resume()`.
53+
SLH-DSA key types are recognized but report NOT_SUPPORTED.
54+
- New coverage tests: ML-DSA, ML-KEM/KEM API, XOF, AES-KW, signature
55+
contexts, LMS/XMSS verify, Ascon/XChaCha, SP800-108 and 1.4 misc.
56+
57+
358
## v5.9.1
459

560
Initial official release of `wolfPSA`. This project follows wolfSSL version numbering.

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ OBJ_PIC := $(patsubst src/%.c,$(OBJDIR_PIC)/%.o,$(SRC))
2121

2222
WOLFCRYPT_SRC := \
2323
$(WOLFSSL_PATH)/wolfcrypt/src/aes.c \
24+
$(WOLFSSL_PATH)/wolfcrypt/src/ascon.c \
2425
$(WOLFSSL_PATH)/wolfcrypt/src/asn.c \
2526
$(WOLFSSL_PATH)/wolfcrypt/src/chacha.c \
2627
$(WOLFSSL_PATH)/wolfcrypt/src/chacha20_poly1305.c \

build-test/build-variant.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,17 @@ HAVE_CURVE448
6969
HAVE_ED448
7070
WOLFSSL_ED448_STREAMING_VERIFY
7171
WOLFSSL_HAVE_MLDSA
72+
WOLFSSL_HAVE_MLKEM
73+
WOLFSSL_HAVE_LMS
74+
WOLFSSL_LMS_VERIFY_ONLY
75+
WOLFSSL_HAVE_XMSS
76+
WOLFSSL_XMSS_VERIFY_ONLY
77+
WOLFSSL_EXPERIMENTAL_SETTINGS
78+
HAVE_ASCON
79+
WOLFSSL_AES_DIRECT
80+
HAVE_AES_KEYWRAP
81+
HAVE_XCHACHA
82+
HAVE_CMAC_KDF
7283
"
7384

7485
flags="${BASELINE}"

0 commit comments

Comments
 (0)