ARM-software / psa-api

Documentation source and development of the PSA Certified API
https://arm-software.github.io/psa-api/
Other
56 stars 27 forks source link

Define the export format for a SPAKE2+ key pair #153

Closed athoelke closed 8 months ago

athoelke commented 8 months ago

_From Oberon (Referencing the SPAKE2+ draft2 rendering of the PAKE Extension):_

The spec draft states on page 54, section 2.3.4 SPAKE2+ keys:

The calculation of w0, w1, and L then proceeds as described in the RFC.

Implementation note

The values of w0 and w1 are required as part of the SPAKE2+ key pair. It is IMPLEMENTATION DEFINED whether L is computed during key derivation, and stored as part of the key pair; or only computed when required from the key pair.

However, a defined export format for secret keys is required to support:

Even if import and export of secret PAKE keys is not needed in typical use cases, it should be defined for completeness, for testing, and to support predefined keys.

athoelke commented 8 months ago

Should we add a note or warning to the key-pair export format, to make clear that SPAKE2+ keys should be initially derived using psa_key_derivation_output_key() (which implements the RFC9383 process); and that psa_key_derivation_output_bytes() -> psa_import_key() does not result in the same/valid/safe/secure key pair?