Skip to content

hmac: introduce hmac driver #18

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

stevenlee7189
Copy link
Collaborator

Add hmac driver based on the implementation in aspeed zephyr sdk.
Currently, accumulative (multi-part) mode is not supported, aligning
with the limitations of the original Zephyr driver.

@rusty1968
Copy link
Contributor

This PR has more changes than what is described in the summary. Let's break this into smaller units.

Add rsa driver based on the implementation in aspeed zephyr sdk.
The patch also add functional test and rsa test data generator.

How to verify driver:

1. You may use the existing test vectors in tests/functional/rsa_test_vec.rs, or
2. Generate fresh vectors by running:
     python3 scripts/rsa_test_vec_gen.py > src/tests/functional/rsa_test_vec.rs
3. Build and run the image

Signed-off-by: Steven Lee <[email protected]>
Add hmac driver based on the implementation in aspeed zephyr sdk.
Currently, accumulative (multi-part) mode is not supported, aligning
with the limitations of the original Zephyr driver.

Signed-off-by: Steven Lee <[email protected]>
@rusty1968
Copy link
Contributor

rusty1968 commented Jun 20, 2025

We have some code duplication here. Given that both digest and hmac operations are provided by the underlying HACE we should factor out the Controller type into its own module.

I have made the changes here, if you want to use them as a reference.
rusty1968@67a3994

Refactoring driver to remove duplicated code.

Merge from:
rusty1968@67a3994

Signed-off-by: Steven Lee <[email protected]>
Signed-off-by: Steven Lee <[email protected]>
@stevenlee7189
Copy link
Collaborator Author

@rusty1968 The duplicated code has been removed. It's ready for your review, thanks in advance!

- Addressed clippy lints for needless lifetimes, etc.
- Ran cargo fmt for formatting consistency

Signed-off-by: Steven Lee <[email protected]>
Removed needless lifetimes.

Signed-off-by: Steven Lee <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants