Skip to content

Commit 25a5d5b

Browse files
committed
Fix for Intel QAT handling cofactor for point multiply. It is not correctly handling the cofactor so always use 1. ZD 15017
1 parent 99a7a50 commit 25a5d5b

1 file changed

Lines changed: 3 additions & 12 deletions

File tree

wolfcrypt/src/port/intel/quickassist.c

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3525,20 +3525,11 @@ int IntelQaEccPointMul(WC_ASYNC_DEV* dev, WC_BIGINT* k,
35253525
}
35263526

35273527
/* setup cofactor */
3528+
/* for this point multiply the cofactor should not be used, so always pass 1 */
35283529
/* if using default value 1 then use shared global */
35293530
opData->h.dataLenInBytes = 4;
3530-
if (cofactor == 1) {
3531-
opData->h.pData = g_qatEcdhCofactor1;
3532-
}
3533-
else {
3534-
/* if not default value 1, then use own buffer */
3535-
opData->h.pData = XMALLOC(opData->h.dataLenInBytes, dev->heap,
3536-
DYNAMIC_TYPE_ASYNC_NUMA);
3537-
if (opData->h.pData == NULL) {
3538-
ret = MEMORY_E; goto exit;
3539-
}
3540-
*((word32*)opData->h.pData) = OS_HOST_TO_NW_32(cofactor);
3541-
}
3531+
opData->h.pData = g_qatEcdhCofactor1;
3532+
(void)cofactor;
35423533

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

0 commit comments

Comments
 (0)