Skip to content

Commit

Permalink
Merge pull request #86 from bigbrett/ml-dsa-DMA-support
Browse files Browse the repository at this point in the history
ML-DSA DMA support
  • Loading branch information
billphipps authored Dec 2, 2024
2 parents 6515aa5 + 109355f commit 6ce59d6
Show file tree
Hide file tree
Showing 12 changed files with 2,067 additions and 178 deletions.
13 changes: 7 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.DS_Store
Build/
*.o
*.a
*.la

.DS_Store
Build/
*.o
*.a
*.la
**/.gdb_history

16 changes: 6 additions & 10 deletions src/wh_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -1211,14 +1211,12 @@ int wh_Client_KeyCacheDma32Request(whClientContext* c, uint32_t flags,
packet->keyCacheDma32Req.key.addr = keyAddr;
packet->keyCacheDma32Req.key.sz = keySz;

/* Copy label if provided */
/* Copy label if provided, truncate if necessary */
if (labelSz > 0) {
if (labelSz > WH_NVM_LABEL_LEN) {
memcpy(packet->keyCacheDma32Req.label, label, WH_NVM_LABEL_LEN);
}
else {
memcpy(packet->keyCacheDma32Req.label, label, labelSz);
labelSz = WH_NVM_LABEL_LEN;
}
memcpy(packet->keyCacheDma32Req.label, label, labelSz);
}

return wh_Client_SendRequest(c, WH_MESSAGE_GROUP_KEY, WH_KEY_CACHE_DMA32,
Expand Down Expand Up @@ -1377,14 +1375,12 @@ int wh_Client_KeyCacheDma64Request(whClientContext* c, uint32_t flags,
packet->keyCacheDma64Req.key.addr = keyAddr;
packet->keyCacheDma64Req.key.sz = keySz;

/* Copy label if provided */
/* Copy label if provided, truncate if necessary */
if (labelSz > 0) {
if (labelSz > WH_NVM_LABEL_LEN) {
memcpy(packet->keyCacheDma64Req.label, label, WH_NVM_LABEL_LEN);
}
else {
memcpy(packet->keyCacheDma64Req.label, label, labelSz);
labelSz = WH_NVM_LABEL_LEN;
}
memcpy(packet->keyCacheDma64Req.label, label, labelSz);
}

return wh_Client_SendRequest(c, WH_MESSAGE_GROUP_KEY, WH_KEY_CACHE_DMA64,
Expand Down
Loading

0 comments on commit 6ce59d6

Please sign in to comment.