SPAKE2+: Add prover setup and key-share output for SPAKE2+ #820

Open
sigvartmh wants to merge 6 commits from sigvartmh/pr/spake2p-9347-prover-depends-on-9342-9343-9344 into development
sigvartmh commented 2026-06-21 17:19:37 -05:00 (Migrated from github.com)

Description

Prover-only part of SPAKE2+ (RFC 9383): psa_pake_setup() accepts SPAKE2+ key types, and psa_pake_output() produces the PSA_PAKE_STEP_KEY_SHARE message for the client (Prover) role, with the RFC 9383 Appendix C known-answer tests (P-256/P-384/P-521) driven through a MBEDTLS_TEST_HOOKS ephemeral-injection seam, plus negative tests.

This addresses Mbed-TLS issue https://github.com/Mbed-TLS/mbedtls/issues/9347 (part 1 of the split requested there; the verifier part follows in a separate PR).

Depends on https://github.com/Mbed-TLS/TF-PSA-Crypto/pull/817, https://github.com/Mbed-TLS/TF-PSA-Crypto/pull/819 and https://github.com/Mbed-TLS/TF-PSA-Crypto/pull/818 — the branch stacks their commits (public-key import/export, key-pair import/export, psa_pake_set_context) so it builds and tests standalone; once those merge, a rebase drops the shared commits.

Also included per the issue's scope: empty identities accepted for SPAKE2+ (zero-length per the PSA PAKE spec and RFC 9383 — needed for Matter), the verifier role usable with a key pair (the driver derives the registration record w0 ‖ L itself), password-key/cipher-suite consistency checks, key-confirmation setting validation, invalid-point errors mapped to PSA_ERROR_INVALID_ARGUMENT, and per-algorithm compile-time gating of the SPAKE2+ setup arms.

PR checklist

  • changelog provided
  • framework PR provided Mbed-TLS/mbedtls-framework#308
  • TF-PSA-Crypto development PR provided
  • mbedtls development PR not required because: Not targeting mbedtls
  • tests provided
## Description Prover-only part of SPAKE2+ (RFC 9383): `psa_pake_setup()` accepts SPAKE2+ key types, and `psa_pake_output()` produces the PSA_PAKE_STEP_KEY_SHARE message for the client (Prover) role, with the RFC 9383 Appendix C known-answer tests (P-256/P-384/P-521) driven through a MBEDTLS_TEST_HOOKS ephemeral-injection seam, plus negative tests. This addresses Mbed-TLS issue https://github.com/Mbed-TLS/mbedtls/issues/9347 (part 1 of the split requested there; the verifier part follows in a separate PR). Depends on https://github.com/Mbed-TLS/TF-PSA-Crypto/pull/817, https://github.com/Mbed-TLS/TF-PSA-Crypto/pull/819 and https://github.com/Mbed-TLS/TF-PSA-Crypto/pull/818 — the branch stacks their commits (public-key import/export, key-pair import/export, psa_pake_set_context) so it builds and tests standalone; once those merge, a rebase drops the shared commits. Also included per the issue's scope: empty identities accepted for SPAKE2+ (zero-length per the PSA PAKE spec and RFC 9383 — needed for Matter), the verifier role usable with a key pair (the driver derives the registration record w0 ‖ L itself), password-key/cipher-suite consistency checks, key-confirmation setting validation, invalid-point errors mapped to PSA_ERROR_INVALID_ARGUMENT, and per-algorithm compile-time gating of the SPAKE2+ setup arms. ## PR checklist - [X] **changelog** provided - [X] **framework PR** provided Mbed-TLS/mbedtls-framework#308 - [X] **TF-PSA-Crypto development PR** provided - [X] **mbedtls development PR** not required because: Not targeting mbedtls - [X] **tests** provided
This pull request has changes conflicting with the target branch.
  • include/psa/crypto_extra.h
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'sigvartmh/pr/spake2p-9347-prover-depends-on-9342-9343-9344:sigvartmh/pr/spake2p-9347-prover-depends-on-9342-9343-9344'
git switch 'sigvartmh/pr/spake2p-9347-prover-depends-on-9342-9343-9344'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'development'
git merge --no-ff 'sigvartmh/pr/spake2p-9347-prover-depends-on-9342-9343-9344'
git switch 'sigvartmh/pr/spake2p-9347-prover-depends-on-9342-9343-9344'
git rebase 'development'
git switch 'development'
git merge --ff-only 'sigvartmh/pr/spake2p-9347-prover-depends-on-9342-9343-9344'
git switch 'sigvartmh/pr/spake2p-9347-prover-depends-on-9342-9343-9344'
git rebase 'development'
git switch 'development'
git merge --no-ff 'sigvartmh/pr/spake2p-9347-prover-depends-on-9342-9343-9344'
git switch 'development'
git merge --squash 'sigvartmh/pr/spake2p-9347-prover-depends-on-9342-9343-9344'
git switch 'development'
git merge --ff-only 'sigvartmh/pr/spake2p-9347-prover-depends-on-9342-9343-9344'
git switch 'development'
git merge 'sigvartmh/pr/spake2p-9347-prover-depends-on-9342-9343-9344'
git push origin 'development'
Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-Mbed-TLS/TF-PSA-Crypto!820
No description provided.