Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose ECJPAKE through the PSA Crypto API #4153

Closed
yanesca opened this issue Feb 17, 2021 · 4 comments · Fixed by #5871
Closed

Expose ECJPAKE through the PSA Crypto API #4153

yanesca opened this issue Feb 17, 2021 · 4 comments · Fixed by #5871
Assignees
Labels
size-m Estimated task size: medium (~1w)

Comments

@yanesca
Copy link
Contributor

yanesca commented Feb 17, 2021

Make the ECJPAKE functionality available through the PSA Crypto API defined in #4000 .

@yanesca yanesca added the size-m Estimated task size: medium (~1w) label Mar 15, 2021
@yanesca
Copy link
Contributor Author

yanesca commented Mar 15, 2021

(Estimating it for Medium instead of small, because the PSA API probably won't be well aligned with the current public API, thus the task won't be trivial.)

@bensze01 bensze01 added this to the EC J-PAKE follow-up milestone Jul 28, 2021
@bensze01 bensze01 removed this from the EC J-PAKE follow-up milestone Aug 11, 2021
@superna9999 superna9999 self-assigned this May 23, 2022
@superna9999
Copy link
Contributor

I have a question about implementation.

The MbedTLS ecjpake API write the while output data at once ((ec point + key) x 2).
What's the best way to implement the PSA API:

  • generate the whole output in a buffer in operation and serve the bits depending on the step
  • directly access the MbedTLS context and write data on demand.

Second seems simpler, but for the input part, it would be much harder to implement and simpler to cat data in a buffer and run mbedtls_ecjpake_read_round_one.

@gilles-peskine-arm
Copy link
Contributor

I would say whatever is most convenient to implement, and we can revise it later.

But I'm not familiar with ecjpake. Maybe @mpg has some advice?

@mpg
Copy link
Contributor

mpg commented May 24, 2022

Hmm, I think both approaches are reasonable* and I don't see a strong reason to prefer one over the other, so I'd also say whatever you find most convenient to implement.

Note that I don't think you even need to use the same approach for inputs and outputs, so you could for example directly output from the Mbed TLS context, but cat input data in a buffer until you have enough to call mbedtls_ecjpake_read_round_xxx() if that's the most convenient.

*We only support P-256 with SHA-256, so all sizes are static. Looking at test data, round one in 330 bytes and round two is 168 bytes, so that's an OK size for an internal buffer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size-m Estimated task size: medium (~1w)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants