-
Notifications
You must be signed in to change notification settings - Fork 25
server: add dma memcpy callback and add guard for CMAC DMA and KEY DMA #146
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 custom DMA memory copy callbacks and introduces configuration guards to selectively disable CMAC DMA and key DMA functionality. This provides more flexibility in DMA operations while allowing systems to exclude specific DMA features when not needed.
- Adds custom DMA memory copy callback infrastructure with new configuration option
WOLFHSM_CFG_DMA_CUSTOM_CLIENT_COPY - Introduces guards
WOLFHSM_CFG_NO_CMAC_DMAandWOLFHSM_CFG_NO_KEY_DMAto disable specific DMA operations - Updates DMA copy functions to use custom callbacks when available, falling back to memcpy when not configured
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| wolfhsm/wh_settings.h | Adds documentation for the three new configuration options |
| wolfhsm/wh_server.h | Defines new callback types, updates context structures, and adds registration function declaration |
| test/wh_test_crypto.c | Adds guard to conditionally compile key DMA tests |
| src/wh_server_dma.c | Implements custom callback registration and integrates callbacks into copy operations |
| src/wh_server_crypto.c | Adds guard around CMAC DMA handling |
| src/wh_client_cryptocb.c | Adds guard around CMAC DMA client-side handling |
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.
A few nits and some edits for clarity. I also bring up a global architecture question for discussion.
Co-authored-by: Brett Nicholas <[email protected]>
Co-authored-by: Brett Nicholas <[email protected]>
Co-authored-by: Brett Nicholas <[email protected]>
This reverts commit ff0ab4a.
Thanks for the review, fixed nits and reverted unneeded macros, let me know if you want me to do some git history cleaning before going forward. |
billphipps
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.
I have a few naming nits that I'll bring in a future PR and I'll tag with Brett about making this the default and removing the CFG value. Looks good!
Let's work a few of the other questions after the PIC32CZ changes are merged and tested as that exercises this interface.
No description provided.