Skip to content

New algorithm: Ad-hoc KDF for EC J-PAKE in TLS 1.2 #11

@athoelke

Description

@athoelke

Add API elements for the algorithm and supporting macros for the KDF used with EC J-PAKE in the TLS 1.2.

This has already been included in the development branch of Mbed-TLS (see Mbed-TLS/mbedtls#6115), following review with the Crypto API authors.

Todo:

  • Add and document PSA_ALG_TLS12_ECJPAKE_TO_PMS and PSA_TLS12_ECJPAKE_TO_PMS_DATA_SIZE API elements to the Crypto API
  • Add encoding for PSA_ALG_TLS12_ECJPAKE_TO_PMS to Appendix B
  • [optionally] Provide a code snippet to demonstrate its usage

The relevant Mbed-TLS changes are as follows:

/* The TLS 1.2 ECJPAKE-to-PMS KDF. It takes the shared secret K (an EC point
 * in case of EC J-PAKE) and calculates SHA256(K.X) that the rest of TLS 1.2
 * will use to derive the session secret, as defined by step 2 of
 * https://datatracker.ietf.org/doc/html/draft-cragie-tls-ecjpake-01#section-8.7.
 * Uses PSA_ALG_SHA_256.
 * This function takes a single input:
 * #PSA_KEY_DERIVATION_INPUT_SECRET is the shared secret K from EC J-PAKE.
 * The only supported curve is secp256r1 (the 256-bit curve in
 * #PSA_ECC_FAMILY_SECP_R1), so the input must be exactly 65 bytes.
 * The output has to be read as a single chunk of 32 bytes, defined as
 * PSA_TLS12_ECJPAKE_TO_PMS_DATA_SIZE.
 */
#define PSA_ALG_TLS12_ECJPAKE_TO_PMS            ((psa_algorithm_t)0x08000609)

/* The size of a serialized K.X coordinate to be used in
 * psa_tls12_ecjpake_to_pms_input. This function only accepts the P-256
 * curve. */
#define PSA_TLS12_ECJPAKE_TO_PMS_DATA_SIZE 32

Metadata

Metadata

Assignees

No one assigned

    Labels

    Crypto APIIssue or PR related to the Cryptography APIenhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions