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

Allow creating multiple SHA instances and / or resume state. #842

Closed
AnthonyGrondin opened this issue Oct 10, 2023 · 3 comments · Fixed by #1908
Closed

Allow creating multiple SHA instances and / or resume state. #842

AnthonyGrondin opened this issue Oct 10, 2023 · 3 comments · Fixed by #1908
Labels
help wanted Extra attention is needed peripheral:sha SHA peripheral

Comments

@AnthonyGrondin
Copy link
Contributor

While implementing SHA hardware acceleration in esp-rs/esp-mbedtls#19, we've struck on a tricky edge-case, where in a real utilization scenario, the MbedTLS library needs to be able to quickly switch between different SHA operations, and also to be able to clone a context, and resume work for it.

@bjoernQ
Copy link
Contributor

bjoernQ commented Oct 11, 2023

Probably we should make this possible for all the crypto accelerators

@AnthonyGrondin
Copy link
Contributor Author

Hi!

I'm currently blocked on this for esp-rs/esp-mbedtls#19 but I don't really know what would be the best way to do it. If anyone wants to take care of it, I can then implement hardware accelerated SHA1, SHA256 and SHA512 for esp-mbedtls.

I haven't looked currently into AES and the other crypto accelerators, but I assume it would be the same thing.

@jessebraham jessebraham added the help wanted Extra attention is needed label Oct 16, 2023
@bjoernQ
Copy link
Contributor

bjoernQ commented Oct 17, 2023

I hope I can take a swing on this but won't be able to get to this too soon. So, if someone else wants to work on this feel free to do so

My guess is that we need to save the current state after any operation and restore it before continuing an in-progress operation (see https://github.com/espressif/esp-idf/blob/8fc8f3f47997aadba21facabc66004c1d22de181/components/mbedtls/port/sha/block/sha.c#L19-L27 )

Will require API changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed peripheral:sha SHA peripheral
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants