Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
6c19e7a
Implement SPAKE2+ public key import and export
KiruthikPrakash Aug 5, 2025
ca289fd
SPAKE2+: Prover key pair import and export
sigvartmh Jun 18, 2026
cc1c5e7
Implement psa_export_public_key for SPAKE2+ key pairs
sigvartmh Jul 19, 2026
d6e99b1
Add psa_pake_set_context function for SPAKE2+
kusumitg Dec 3, 2025
e090c04
SPAKE2+: Add prover setup and key-share output for PAKE
sigvartmh Jun 18, 2026
00eddce
SPAKE2+: CI: Add test-hooks all.sh component
sigvartmh Jun 19, 2026
04c7cd2
Add SPAKE2+ Verifier setup and key-share output tests (PSA PAKE)
sigvartmh Jun 18, 2026
8deaa46
SPAKE2+: verifier transcript hash and peer key-share input (#9349)
sigvartmh Jun 18, 2026
4bb1e41
SPAKE2+: verifier confirmation output (#9352)
sigvartmh Jun 18, 2026
4e10b16
SPAKE2+: prover transcript hash (#9359)
sigvartmh Jun 18, 2026
35abb46
SPAKE2+: prover confirmation check (#9355)
sigvartmh Jun 18, 2026
45a9c68
SPAKE2+: prover confirmation output (#9367)
sigvartmh Jun 18, 2026
cb8a0d3
SPAKE2+: verifier confirmation check (#9367)
sigvartmh Jun 18, 2026
3c248e1
SPAKE2+: implement get_shared_key (#9370)
sigvartmh Jun 18, 2026
af101c6
SPAKE2+: add end-to-end rounds tests (#9370)
sigvartmh Jun 18, 2026
9d34ff3
SPAKE2+: de-duplicate the e2e rounds test setup (#9370)
sigvartmh Jun 19, 2026
65e8bbd
SPAKE2+: add CMAC key-confirmation support (#9377)
sigvartmh Jun 18, 2026
649ed07
SPAKE2+: CMAC end-to-end rounds tests (#9377)
sigvartmh Jun 18, 2026
b2002ff
SPAKE2+: Matter ciphersuite (draft-02 key schedule) for #9378
sigvartmh Jun 18, 2026
256492a
SPAKE2+: Matter end-to-end rounds tests (#9378)
sigvartmh Jun 18, 2026
441570c
SPAKE2+: implement registration (derive key pair) (#9381)
sigvartmh Jun 18, 2026
70ab0dd
Add RFC 9383 KATs for the P256-SHA512 and P384-SHA512 HMAC ciphersuites
sigvartmh Jul 19, 2026
11f4505
Add HMAC dependency to SPAKE2+ HMAC confirmation and shared-key KATs
sigvartmh Jul 19, 2026
b0d4748
Test that mbedtls_spake2p_setup rejects an invalid role
sigvartmh Jul 19, 2026
19946cd
Align SPAKE2P public-key policy with the RFC 9383 P-384 ciphersuites
sigvartmh Jul 19, 2026
7af20b8
Add PSA-level P-521 SPAKE2+ key-share format tests
sigvartmh Jul 19, 2026
c7c89cd
Use the SPAKE2+ setup helpers throughout the PSA PAKE test suite
sigvartmh Jul 19, 2026
7fcf21b
Test SPAKE2+ rounds with a verifier key pair and with empty identities
sigvartmh Jul 19, 2026
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
4 changes: 4 additions & 0 deletions ChangeLog.d/spake2p-cmac.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Features
* Add CMAC support for SPAKE2+. The PSA_ALG_SPAKE2P_CMAC ciphersuites use
AES-CMAC-128 instead of HMAC for the key confirmation MAC (RFC 9383
Section 3.4); the key schedule stays HKDF. Resolves Mbed-TLS/mbedtls#9377.
7 changes: 7 additions & 0 deletions ChangeLog.d/spake2p-get-shared-key.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Features
* Implement psa_pake_get_shared_key() for SPAKE2+. Once both the key share
and the key confirmation exchanges have completed, both parties can export
the RFC 9383 K_shared shared secret. As a security measure the shared key
is released only after the peer's confirmation MAC has been verified.
Use PSA_ALG_SPAKE2P_HMAC for P-256/P-384/P-521. Resolves Mbed-
TLS/mbedtls#9370.
8 changes: 8 additions & 0 deletions ChangeLog.d/spake2p-key-pair-import-export.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Features
* Add support for importing and exporting SPAKE2+ key pairs
(key type PSA_KEY_TYPE_SPAKE2P_KEY_PAIR) through psa_import_key() and
psa_export_key(). The prover key pair is the concatenation w0 || w1 of
two equal-length secp256r1/secp384r1/secp521r1 scalars in the range
[1, n-1]. psa_export_public_key() computes the corresponding verifier
registration record w0 || L with L = w1 * P. Resolves Mbed-
TLS/mbedtls#9343.
7 changes: 7 additions & 0 deletions ChangeLog.d/spake2p-matter.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Features
* Support the Matter SPAKE2+ ciphersuite (P256-SHA256-HKDF-HMAC-SHA256)
through PSA_ALG_SPAKE2P_MATTER. This is the HMAC-SHA-256 / P-256
ciphersuite using the older draft-bar-cfrg-spake2plus-02 key schedule
(split-digest Kae = Ka || Ke; the shared secret is Ke and the
confirmation keys are HKDF-expanded from Ka) rather than the RFC 9383
schedule. Resolves Mbed-TLS/mbedtls#9378.
9 changes: 9 additions & 0 deletions ChangeLog.d/spake2p-prover-confirmation-check.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Features
* Add the SPAKE2+ (RFC 9383) prover confirmation check to the PSA PAKE API:
once both key shares have been exchanged, a CLIENT-role operation accepts
the PSA_PAKE_STEP_CONFIRM message through psa_pake_input(), verifying the
verifier's confirmation MAC confirmV = MAC(K_confirmV, shareP) in constant
time. A mismatching MAC is rejected with PSA_ERROR_INVALID_SIGNATURE.
Supported for the HMAC confirmation profile (PSA_ALG_SPAKE2P_HMAC) over
the
P-256/P-384/P-521 ciphersuites. Resolves Mbed-TLS/mbedtls#9355.
10 changes: 10 additions & 0 deletions ChangeLog.d/spake2p-prover-confirmation.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Features
* Add the SPAKE2+ (RFC 9383) prover confirmation output to the PSA PAKE
API: once both key shares have been exchanged and the key schedule
(K_main, K_confirmP, K_confirmV, K_shared per RFC 9383 Section 3.3-3.4) is
derived, psa_pake_output() now accepts the PSA_PAKE_STEP_CONFIRM message
on the prover (client) side, returning the confirmation MAC confirmP.
Supported for the HMAC confirmation profile (PSA_ALG_SPAKE2P_HMAC) over
the P-256/P-384/P-521 ciphersuites. Resolves Mbed-TLS/mbedtls#9367 prover
confirmation
output.
7 changes: 7 additions & 0 deletions ChangeLog.d/spake2p-prover-key-share.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Features
* Add the SPAKE2+ (RFC 9383) Prover setup and key-share output to the PSA
PAKE API: psa_pake_setup() now accepts SPAKE2+ key types for the client
(Prover) role with PSA_ALG_SPAKE2P_HMAC, and psa_pake_output() produces
the
PSA_PAKE_STEP_KEY_SHARE message. Supported on the NIST P-256, P-384 and
P-521 curves. Resolves part of #9347 (Prover key share).
8 changes: 8 additions & 0 deletions ChangeLog.d/spake2p-prover-transcript-hash.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Features
* Add the SPAKE2+ (RFC 9383) prover transcript hash to the PSA PAKE API:
a CLIENT-role operation now accumulates the transcript TT (RFC 9383
Section 3.3) over the fields derivable from the exchanged shares (Context,
idProver, idVerifier, M, N, shareP, shareV) across all prover-side calls,
and psa_pake_input() rejects an out-of-order PSA_PAKE_STEP_KEY_SHARE on
the
prover side with PSA_ERROR_BAD_STATE. Resolves Mbed-TLS/mbedtls#9359.
5 changes: 5 additions & 0 deletions ChangeLog.d/spake2p-public-key-import-export.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Features
* Add support for importing and exporting SPAKE2+ public keys
(key type PSA_KEY_TYPE_SPAKE2P_PUBLIC_KEY) through psa_import_key()
and psa_export_key(), following the PSA Crypto API encoding for
SPAKE2+. Resolves Mbed-TLS/mbedtls#9342.
10 changes: 10 additions & 0 deletions ChangeLog.d/spake2p-registration.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Features
* Implement SPAKE2+ registration (RFC 9383 Section 3.2): derive a SPAKE2+
key pair from a key-derivation operation via
psa_key_derivation_output_key()
with key type PSA_KEY_TYPE_SPAKE2P_KEY_PAIR. For each scalar,
ceil(bits/8)+8
bytes are drawn from the operation and reduced modulo the group order to
produce w0 and w1, yielding the importable/usable key pair w0 || w1. Use
PSA_ALG_SPAKE2P_HMAC with the secp_r1 (Weierstrass) ciphersuites. Requires
PSA_WANT_KEY_TYPE_SPAKE2P_KEY_PAIR_DERIVE. Resolves Mbed-TLS/mbedtls#9381.
5 changes: 5 additions & 0 deletions ChangeLog.d/spake2p-set-context.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Features
* Implement psa_pake_set_context() so a SPAKE2+ operation can store the
optional context string passed at the collect-inputs stage. The function
returns PSA_ERROR_BAD_STATE for EC-JPAKE, which does not take a context.
Resolves Mbed-TLS/mbedtls#9344.
9 changes: 9 additions & 0 deletions ChangeLog.d/spake2p-verifier-confirmation-check.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Features
* Add the SPAKE2+ (RFC 9383) verifier confirmation check to the PSA PAKE
API: once both key shares have been exchanged and the key schedule is
derived, psa_pake_input() now accepts the PSA_PAKE_STEP_CONFIRM message
on the verifier (server) side, verifying the prover's confirmation MAC
confirmP = MAC(K_confirmP, shareV) in constant time and failing with
PSA_ERROR_INVALID_SIGNATURE on mismatch. Supported for the HMAC
confirmation profile (PSA_ALG_SPAKE2P_HMAC) over the P-256/P-384/P-521
ciphersuites. Resolves Mbed-TLS/mbedtls#9367 verifier confirmation check.
10 changes: 10 additions & 0 deletions ChangeLog.d/spake2p-verifier-confirmation.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Features
* Add the SPAKE2+ (RFC 9383) verifier confirmation output to the PSA PAKE
API: once both key shares have been exchanged, the key schedule
(K_main, K_confirmP, K_confirmV, K_shared per RFC 9383 Section 3.3-3.4) is
derived, and psa_pake_output() now accepts the PSA_PAKE_STEP_CONFIRM
message on the verifier (server) side, returning the confirmation MAC
confirmV. Supported for the HMAC confirmation profile
(PSA_ALG_SPAKE2P_HMAC
and PSA_ALG_SPAKE2P_MATTER) over the P-256/P-384/P-521 ciphersuites.
Resolves Mbed-TLS/mbedtls#9352.
7 changes: 7 additions & 0 deletions ChangeLog.d/spake2p-verifier-key-share.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Features
* Add the SPAKE2+ (RFC 9383) Verifier setup and key-share output to the PSA
PAKE API: psa_pake_setup() now accepts a SPAKE2+ public-key registration
record (w0||L) for the server (Verifier) role, and psa_pake_output()
produces the server PSA_PAKE_STEP_KEY_SHARE message (shareV = y*P + w0*N).
Supported on the NIST P-256, P-384 and P-521 curves. Resolves part of
#9347 (Verifier key share).
7 changes: 7 additions & 0 deletions ChangeLog.d/spake2p-verifier-transcript-hash.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Features
* Add the SPAKE2+ (RFC 9383) verifier transcript hash and peer key-share
input to the PSA PAKE API: psa_pake_input() now accepts the
PSA_PAKE_STEP_KEY_SHARE message for a SPAKE2+ operation, and the
transcript TT (RFC 9383 Section 3.3) is accumulated over the fields
derivable from the exchanged shares (Context, idProver, idVerifier, M, N,
shareP, shareV). Resolves Mbed-TLS/mbedtls#9349.
34 changes: 34 additions & 0 deletions core/check_crypto_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,38 @@
#error "PSA_WANT_ALG_TLS12_ECJPAKE_TO_PMS defined, but not all prerequisites"
#endif

#if (defined(PSA_WANT_KEY_TYPE_SPAKE2P_KEY_PAIR_BASIC) || \
defined(PSA_WANT_KEY_TYPE_SPAKE2P_KEY_PAIR_IMPORT) || \
defined(PSA_WANT_KEY_TYPE_SPAKE2P_KEY_PAIR_EXPORT)) && \
!defined(PSA_WANT_KEY_TYPE_SPAKE2P_PUBLIC_KEY)
#error "PSA_WANT_KEY_TYPE_SPAKE2P_KEY_PAIR_xxx defined, but not all prerequisites"
#endif

#if defined(PSA_WANT_ALG_SPAKE2P_HMAC) && \
!(defined(PSA_WANT_ALG_HMAC) && \
defined(PSA_WANT_KEY_TYPE_SPAKE2P_PUBLIC_KEY) && \
(defined(PSA_WANT_ECC_SECP_R1_256) || \
defined(PSA_WANT_ECC_SECP_R1_384) || \
defined(PSA_WANT_ECC_SECP_R1_521)))
#error "PSA_WANT_ALG_SPAKE2P_HMAC defined, but not all prerequisites"
#endif

#if defined(PSA_WANT_ALG_SPAKE2P_CMAC) && \
!(defined(PSA_WANT_ALG_CMAC) && \
defined(PSA_WANT_KEY_TYPE_AES) && \
defined(PSA_WANT_KEY_TYPE_SPAKE2P_PUBLIC_KEY) && \
(defined(PSA_WANT_ECC_SECP_R1_256) || \
defined(PSA_WANT_ECC_SECP_R1_384) || \
defined(PSA_WANT_ECC_SECP_R1_521)))
#error "PSA_WANT_ALG_SPAKE2P_CMAC defined, but not all prerequisites"
#endif

#if defined(PSA_WANT_ALG_SPAKE2P_MATTER) && \
!(defined(PSA_WANT_ALG_HMAC) && \
defined(PSA_WANT_ALG_SHA_256) && \
defined(PSA_WANT_ECC_SECP_R1_256) && \
defined(PSA_WANT_KEY_TYPE_SPAKE2P_PUBLIC_KEY))
#error "PSA_WANT_ALG_SPAKE2P_MATTER defined, but not all prerequisites"
#endif

#endif /* TF_PSA_CRYPTO_CHECK_CRYPTO_CONFIG_H */
Loading