Skip to content

Add TLS-1.2 EC J-PAKE-to-PMS KDF algorithm#91

Merged
athoelke merged 1 commit intoARM-software:mainfrom
athoelke:crypto-ecjpake-kdf
Nov 8, 2023
Merged

Add TLS-1.2 EC J-PAKE-to-PMS KDF algorithm#91
athoelke merged 1 commit intoARM-software:mainfrom
athoelke:crypto-ecjpake-kdf

Conversation

@athoelke
Copy link
Copy Markdown
Contributor

@athoelke athoelke commented Aug 8, 2023

Fixes #11

Note that this does not exactly follow the MBEDTLS implementation:

  • The output size is provided by PSA_TLS12_ECJPAKE_TO_PMS_OUTPUT_SIZE rather than PSA_TLS12_ECJPAKE_TO_PMS_DATA_SIZE, which is more consistent with the other Crypto API support macros.

@athoelke athoelke added enhancement New feature or request Crypto API Issue or PR related to the Cryptography API labels Aug 8, 2023
@athoelke athoelke added this to the Crypto API 1.2 milestone Aug 8, 2023
@athoelke
Copy link
Copy Markdown
Contributor Author

athoelke commented Aug 8, 2023

[Sorry, I made a mistake in reading the code, fixed these comments to correctly reflect the code]

@gilles-peskine-arm @mpg - Note also that in mbedtls:

  1. The header documents PSA_TLS12_ECJPAKE_TO_PMS_DATA_SIZE macro as the input size for the algorithm, but describes it from the algorithm definition as the size of output.
  2. The implementation uses PSA_TLS12_ECJPAKE_TO_PMS_DATA_SIZE for size of the internal input to SHA256 (the X coordinate of the secp256r1 point).

It just happens to work because both the X coordinate, and the output from SHA256 are 32 bytes.

Applications only need to know the size of the output (XXX_OUTPUT_SIZE), not the internal data sizes. As we expect applications to use a PAKE operation, the size of the secret input is not really needed as an API element.

@mpg
Copy link
Copy Markdown

mpg commented Aug 9, 2023

@athoelke I'm going on holiday for 4 weeks at the end of the week, and have a number of urgent things that require my attention, so it's unlikely I'll find time to review before I leave, sorry. I've added this to my list, and will look at it when I return if I can't find time this week.

@athoelke
Copy link
Copy Markdown
Contributor Author

athoelke commented Nov 7, 2023

@mpg - would you be able to review this PR please?

@mpg
Copy link
Copy Markdown

mpg commented Nov 8, 2023

Thanks for the reminder, sorry I had forgotten about this, I'm having a look right now.

Copy link
Copy Markdown

@mpg mpg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@athoelke athoelke merged commit b402181 into ARM-software:main Nov 8, 2023
@athoelke athoelke deleted the crypto-ecjpake-kdf branch November 13, 2023 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

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

2 participants