Skip to content

Commit

Permalink
Fix for Intel QAT handling cofactor for point multiply. It is not cor…
Browse files Browse the repository at this point in the history
…rectly handling the cofactor so always use 1. ZD 15017
  • Loading branch information
dgarske committed Oct 28, 2022
1 parent 99a7a50 commit 25a5d5b
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions wolfcrypt/src/port/intel/quickassist.c
Original file line number Diff line number Diff line change
Expand Up @@ -3525,20 +3525,11 @@ int IntelQaEccPointMul(WC_ASYNC_DEV* dev, WC_BIGINT* k,
}

/* setup cofactor */
/* for this point multiply the cofactor should not be used, so always pass 1 */
/* if using default value 1 then use shared global */
opData->h.dataLenInBytes = 4;
if (cofactor == 1) {
opData->h.pData = g_qatEcdhCofactor1;
}
else {
/* if not default value 1, then use own buffer */
opData->h.pData = XMALLOC(opData->h.dataLenInBytes, dev->heap,
DYNAMIC_TYPE_ASYNC_NUMA);
if (opData->h.pData == NULL) {
ret = MEMORY_E; goto exit;
}
*((word32*)opData->h.pData) = OS_HOST_TO_NW_32(cofactor);
}
opData->h.pData = g_qatEcdhCofactor1;
(void)cofactor;

ret = IntelQaAllocFlatBuffer(pXk, q->len, dev->heap);
ret += IntelQaAllocFlatBuffer(pYk, q->len, dev->heap);
Expand Down

0 comments on commit 25a5d5b

Please # to comment.