-
Notifications
You must be signed in to change notification settings - Fork 25
Support AES-CTR and AES-ECB #155
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for AES-CTR and AES-ECB cipher modes to wolfHSM, extending the existing AES implementation with these additional modes.
- Implements AES-CTR (Counter) and AES-ECB (Electronic Codebook) modes for both client and server sides
- Adds comprehensive unit tests for both cipher modes with client-side and HSM-side key operations
- Includes benchmark implementations for performance testing of CTR and ECB modes
Reviewed Changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| wolfhsm/wh_message_crypto.h | Defines message structures and function prototypes for AES-CTR and AES-ECB operations |
| wolfhsm/wh_client_crypto.h | Adds client-side function declarations for CTR and ECB modes |
| src/wh_message_crypto.c | Implements message translation functions for CTR and ECB request/response structures |
| src/wh_client_crypto.c | Implements client-side AES-CTR and AES-ECB functions with request/response handling |
| src/wh_client_cryptocb.c | Adds crypto callback handlers for CTR and ECB cipher operations |
| src/wh_server_crypto.c | Implements server-side handlers for processing CTR and ECB cipher requests |
| test/wh_test_crypto.c | Adds unit tests for both CTR and ECB modes testing client and HSM key scenarios |
| benchmark/wh_bench_mod_aes.c | Implements benchmark functions for CTR and ECB performance testing |
| Various user_settings.h files | Enables WOLFSSL_AES_COUNTER flag across different configurations |
Comments suppressed due to low confidence (1)
wolfhsm/wh_message_crypto.h:1
- ECB mode does not use an IV (initialization vector), so including iv[AES_IV_SIZE] in the ECB request structure documentation is misleading. ECB operates on individual blocks without chaining.
/*
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
bigbrett
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, looks great, just a few nits. I also flagged a point for discussion that I want @billphipps to look at.
Finally, @miyazakh can you please run git-clang-format main on this branch to run only your changed lines through clang-format? I think there were a few things that will be fixed.
|
Run |
d2a4b92 to
1b6c7e9
Compare
|
@miyazakh needs rebase, we fixed an error in makefiles. SOrry! |
1b6c7e9 to
689fcb8
Compare
|
rebase and increase |
Add unit test and benchmark for CTR and ECB as well
This comes from Issue#153