Skip to content

[v2] Define the SPAKE2+ algorithms#129

Merged
athoelke merged 11 commits intoARM-software:mainfrom
athoelke:pake-spake2p-v2
Jan 10, 2024
Merged

[v2] Define the SPAKE2+ algorithms#129
athoelke merged 11 commits intoARM-software:mainfrom
athoelke:pake-spake2p-v2

Conversation

@athoelke
Copy link
Copy Markdown
Contributor

@athoelke athoelke commented Dec 1, 2023

This PR is a second draft of the complete SPAKE2+ API, incorporating the last remaining SPAKE2+ PR #119. The first draft is in PR #126.

None of the API elements have changed since the first draft. This one reorganises the documentation, and reworks the overview of the SPAKE2+ protocol. The first draft defined the SPAKE2+ algorithms (see 701c9ec), the new updates are from 3cf983f onwards. The primary effects of the rework:

  • Move the key/algorithm encoding to a separate chapter

  • Organise the API chapter into three sections:

    • Definition of the common PAKE API elements
    • Overview and API for J-PAKE
    • Overview and API for SPAKE2+

This permits a more consolidated structure for describing how to use the Crypto API for all of the phases of the SPAKE2+ protocol.

The result of the changes can be seen in this draft rendering: AES0058-PSA_Certified_Crypto_API-1.2_PAKE_Extension-bet.2-draft3-spake2plus.pdf
Out-dated draft: AES0058-PSA_Certified_Crypto_API-1.2_PAKE_Extension-bet.2-draft2-spake2plus.pdf

DO NOT MERGE

There remains one open issue in the preceding PR: verifying the table of KDF extraction lengths when deriving the SPAKE2+ keys.

* Add key encodings
* Define public key format
* Define key derivation procedure
* Add macros to crack a PAKE primitive value
* Decide on using USAGE_DERIVE for SPAKE2+ keys
* Fix typos
* Update header file
* Constrain key derivation to SPAKE2+ key pairs
* Specify the length of data extracted from the KDF during derivation
* Use a list format to define the exported key format
* Supporting both RFC 9393 and Matter
* New APIs:
  - `PSA_ALG_SPAKE2P_HMAC()`
  - `PSA_ALG_SPAKE2P_CMAC()`
  - `PSA_ALG_SPAKE2P_MATTER`
  - `PSA_ALG_IS_SPAKE2P()`
  - `PSA_ALG_IS_SPAKE2P_HMAC()`
  - `PSA_ALG_IS_SPAKE2P_CMAC()`
* Split into three sections: Common, J-PAKE, SPAKE2+
* Provide an overview and flow for each protocol, including password handling
@athoelke athoelke added enhancement New feature or request API design Related the design of the API Crypto API Issue or PR related to the Cryptography API labels Dec 1, 2023
@athoelke athoelke added this to the Crypto API 1.2 PAKE Extension milestone Dec 1, 2023
@athoelke athoelke self-assigned this Dec 1, 2023
@athoelke
Copy link
Copy Markdown
Contributor Author

athoelke commented Dec 1, 2023

@silabs-Kusumit, @silabs-hannes, @oberon-sk, @yanesca: please continue review of SPAKE2+ here

@athoelke
Copy link
Copy Markdown
Contributor Author

On the name of the algorithms... should we version the MATTER algorithm identifier, as in PSA_ALG_SPAKE2P_MATTER1 or PSA_ALG_SPAKE2P_MATTERV1?

I don't know if a future version of Matter might decide to update to the RFC definition of SPAKE2+, or use something else entirely. So we would end up with two different SPAKE2+ Matter algorithms.

@yanesca
Copy link
Copy Markdown
Contributor

yanesca commented Dec 29, 2023

AES0058-PSA_Certified_Crypto_API-1.2_PAKE_Extension-bet.2-draft2-spake2plus.pdf Doesn't seem to be the latest rendering. It still says "The current API proposal provides the general interface for PAKE algorithms, and the specific interface for J-PAKE." as opposed to the source which correctly mentions SPAKE2+ as well.

@athoelke
Copy link
Copy Markdown
Contributor Author

athoelke commented Jan 8, 2024

Doesn't seem to be the latest rendering. It still says "The current API proposal provides the general interface for PAKE algorithms, and the specific interface for J-PAKE." as opposed to the source which correctly mentions SPAKE2+ as well.

You are correct. I don't know if the document build had missed the last commit on Dec 1. There are a few follow-up edits now, so let me rebuild a v3 draft.

@athoelke
Copy link
Copy Markdown
Contributor Author

athoelke commented Jan 8, 2024

Updated draft PDF now available: AES0058-PSA_Certified_Crypto_API-1.2_PAKE_Extension-bet.2-draft3-spake2plus.pdf

This adds the last three commits in this PR to the previous draft PDF.

@silabs-Kusumit
Copy link
Copy Markdown

I viewed the draft PDF and didn't find any issues. The values calculated for size of w0s and w1s in bytes are correct.

LGTM

@athoelke athoelke merged commit 6d5bc33 into ARM-software:main Jan 10, 2024
@athoelke athoelke deleted the pake-spake2p-v2 branch January 10, 2024 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API design Related the design of the API Crypto API Issue or PR related to the Cryptography API enhancement New feature or request

Projects

Development

Successfully merging this pull request may close these issues.

Support for SPAKE2+ in the Crypto PAKE API

3 participants