docs: add WPA3-SAE (PSA Crypto API 1.4) design proposal - #837
Conversation
gilles-peskine-arm
left a comment
There was a problem hiding this comment.
Thank you for providing a detailed design plan.
I've reviewed it as someone who is familiar with PSA APIs in general and with TF-PSA-Crypto as a product, but not with the PAKE API and not with the WPA3 algorithm family. In particular, I have not confronted the proposal with the WPA3 and related specifications.
8be6e2d to
84802e6
Compare
|
Thanks, this was a useful pass — all 16 points are in the updated note (force-pushed). Substantive changes:
On that last one — the answer came out more definite than "open question" suggests, so flagging it here too: The three maintainer-facing open questions (§9: FFDH group set, omitting Looping, built-in vs encoding-only) are unchanged and still open. Unrelated: the spec example errata (#372) merged, targeted for 1.5.1 — the note now reflects that. |
gilles-peskine-arm
left a comment
There was a problem hiding this comment.
Thanks for the update. I'm generally happy with the plan now, except that I'm unsure about bignum_core vs bignum_mod: the arguments given against bignum_mod feel very weak to me. It's hard for me to judge because I'm not at all familiar with the algorithm.
Do you have a reading suggestion (code or math+English) that would make it clear how the representation of numbers matter? Are all the numbers involved in the same
Note: when I say I'm happy with the plan, that's as a general plan for implementing some calculations as a new cryptographic mechanism in TF-PSA-Crypto. I'm not familiar with the WPA3-SAE family of algorithms, so I can't vouch for difficulties or incompleteness for implementing the desired algorithms.
| merge at a major/minor release per the API-extension policy. The framework | ||
| submodule change is a separate PR — see §3. |
There was a problem hiding this comment.
To be precise, the changes inside the framework are a separate PR since it's a separate repository. Updating the framework submodule in the TF-PSA-Crypto repository should be done in the TF-PSA-Crypto PR that needs it, but the need may go away if another TF-PSA-Crypto PR updates the framework for its own needs first.
There was a problem hiding this comment.
Understood — I'll fix §3 to say it precisely: the framework changes are a separate PR (separate repo), and the submodule bump lands in whichever TF-PSA-Crypto PR first needs it, so the "merged first" framing was too rigid.
| `sae.c`. If extending `bignum_mod.h` is wanted instead, we would rather do | ||
| it as its own piece of work than on this feature's critical path. |
There was a problem hiding this comment.
Many functions in the bignum modules and in the ecp module have automatically generated tests (framework/scripts/generate_bignum_tests.py, framework/scripts/generate_ecp_tests.py). If this work introduces new functions that should have automatically generated tests, we'll need to arrange. to add new tested functions
Because the framework code and the crypto code can't be updated atomically, the first time those scripts need to cover a new test function, this will require preliminary work to split the script into two parts:
framework/scripts/mbedtls_framwork/xxx_generator.pyhaving almost all the code.- A small harness
tests/scripts/generate_xxx.pythat calls an entry point in the framework and passes it arguments that describe which test functions should be covered. - For a transition period,
framework/scripts/generate_xxx.pystill exists. It callstests/scripts/generate_xxx.pyfrom the consuming branch if it exists, and otherwise generates test cases for the historical set of test functions.
See scripts/maintainer/generate_mldsa_tests.py and framework/util/mbedtls_maintainer/mldsa_test_generator.py for an example of this split. Note that the file paths are different for mldsa because it needs extra python packages, and that would break some validation scripts that we run on framework/scripts, scripts and tests/scripts; that doesn't apply for bignum and ecp.
There was a problem hiding this comment.
This is the real deciding factor now that capability isn't. If we go bignum_mod we're adding exp_mod (and probably cmp / cond-assign) as first-class bignum_mod functions, which per your note means doing the generator split — a mbedtls_framework/..._generator.py plus a thin tests/scripts/generate_*.py harness, transition shim and all — following the mldsa example. bignum_core already has all of these, so that path adds no bignum API and touches no generator.
So the choice is: grow bignum_mod properly (better long-term home, but the first code PR then also owns a bignum-module extension + the generator split), or keep the first SSWU PR tight on bignum_core and leave bignum_mod growth as separate future work. I lean toward doing it properly on bignum_mod since you'd want those functions eventually anyway — but you're better placed to say whether you want that coupled into the first SSWU PR or kept out of it. Either way I'll write it up to match.
Add a Phase 0 design proposal for implementing the WPA3-SAE PAKE from the PSA Certified Crypto API 1.4 (sections 10.13.12-13) in the built-in driver. The note covers the scope (hash-to-element only; ECC groups 19/20/21; FFDH via RFC 3526; fixed and group-dependent-hash variants), the PSA 1.4 API surface with specification citations, the files to touch, the new primitives required (RFC 9380 hash-to-curve, modular square root, the SAE engine), a per-step constant-time strategy, the test plan, a proposed PR phasing, and open questions for maintainers. For discussion on Mbed-TLS#709 before any implementation begins. Signed-off-by: Chaitanya Tata <Chaitanya@dotstarsystems.com>
84802e6 to
986f205
Compare
|
@gilles-peskine-arm — I answered your three questions (representation/reading, single-field vs mix, where the Montgomery conversions land) on the bignum thread rather than here so they wouldn't get buried: #837 (comment) Short version: it's a single field (F_p) throughout |
gilles-peskine-arm
left a comment
There was a problem hiding this comment.
LGTM at 986f205, with the caveat that I am not familiar with WPA3-SAE and I have not checked the plan against the specification of the mechanisms.
On bignum_core vs bignum_mod, I could go either way based on my knowledge. I'll ask a colleague who's more familiar with ECC math and the planned evolution of bignum and ECP modules.
|
@gilles-peskine-arm Should I add any other reviewer to get this merged? |
|
We do need a second reviewer. But I have no idea when someone will be available or who it will be. By the way, given the size of the contribution, have you made arrangements with our product management to have the review of the code scheduled? We currently have very little bandwidth since most of the team is triaging and fixing LLM-assisted vulnerability reports. |
This adds a Phase 0 design proposal (
docs/proposed/wpa3-sae.md) forimplementing the WPA3-SAE PAKE from the PSA Certified Crypto API 1.4
(§10.13.12–13) in the built-in driver.
It is a design note for discussion — no implementation code — intended
to reach agreement on scope, API surface, new primitives, constant-time
strategy, and PR phasing before any code is written. Relates to #709.
What it covers
PSA_DH_FAMILY_RFC3526; theFIXEDandGDHalgorithm variants and theWPA3_SAE_H2EKDF. Protocol-level concerns (anti-clogging, groupnegotiation, SAE-PK, mesh) are out of scope — they belong in the Wi-Fi stack.
modular square root, and the SAE engine.
motivating threat).
Open questions for maintainers (see §9 of the note)
PSA_DH_FAMILY_RFC3526(IANA 15–18) for SAE FFDH tokens; confirm this is the intended set.
PWE; H2E supersedes it) and return
PSA_ERROR_NOT_SUPPORTED.(SPAKE2+ is currently API-encoding-only).
Related
Fix incorrect identifiers in PAKE operation example code GlobalPlatform/psa-api#372.