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

[crypto] add non-blocking rsa_3072_verify function #17254

Merged
merged 1 commit into from
Feb 8, 2023

Conversation

timothytrippel
Copy link
Contributor

Previously, only a blocking version of the rsa_3072_verify function existed.

For the power virus test (see #14814), however, we want the ability to initiate OTBN operations, and then free up the CPU to complete other tasks.

This adds a non-blocking version of the rsa_3072_verify function to the crypto library to support this use case.

Signed-off-by: Timothy Trippel [email protected]

@timothytrippel timothytrippel added SW:cryptolib Crypto library Component:ChipLevelTest Used to filter the chip-level test backlog labels Feb 8, 2023
@timothytrippel timothytrippel added this to the Project: M3 milestone Feb 8, 2023
@timothytrippel timothytrippel requested a review from a team as a code owner February 8, 2023 19:46
@timothytrippel timothytrippel self-assigned this Feb 8, 2023
@timothytrippel timothytrippel requested review from moidx and removed request for a team February 8, 2023 19:46
@timothytrippel
Copy link
Contributor Author

@jadephilipoom (as discussed offline):

As part of the power virus test I want to activate the OTBN by doing an RSA computation, but I came across an issue: the current rsa_3072_verify function blocks. What I would like to do, is kick off OTBN RSA operations, and free up the CPU to do other tasks, then come back and check the result later. I saw your comment about this here, and went ahead an implemented a non-blocking version of the function in this PR. I used the terms "async/await" borrowed from JS land. However if you had separate plans for the API, please feel free to suggest an alternative or close the PR, I just wanted to put together example of what I was looking for.

Copy link
Contributor

@jadephilipoom jadephilipoom left a comment

Choose a reason for hiding this comment

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

Thanks, Tim! For the cryptolib API we've been using start and finalize terminology instead of async and await; would you mind changing the names just so that it's uniform? Otherwise this looks great 🙂

Previously, only a blocking version of the `rsa_3072_verify` function
existed.

For the power virus test (see lowRISC#14814), however, we want the ability to
initiate OTBN operations, and then free up the CPU to complete other tasks.

This adds a non-blocking version of the `rsa_3072_verify` function to
the crypto library to support this use case.

Signed-off-by: Timothy Trippel <[email protected]>
@timothytrippel
Copy link
Contributor Author

Sounds good, fixed. Thanks!

@timothytrippel timothytrippel merged commit 5e1c39c into lowRISC:master Feb 8, 2023
@timothytrippel timothytrippel deleted the add-rsa-verify-async branch February 8, 2023 23:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component:ChipLevelTest Used to filter the chip-level test backlog SW:cryptolib Crypto library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants