Skip to content

Commit 85c1c6b

Browse files
authored
Merge pull request #54 from dgarske/zd15017
2 parents 99a7a50 + aeade76 commit 85c1c6b

1 file changed

Lines changed: 6 additions & 24 deletions

File tree

wolfcrypt/src/port/intel/quickassist.c

Lines changed: 6 additions & 24 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);
@@ -3714,20 +3705,11 @@ int IntelQaEcdh(WC_ASYNC_DEV* dev, WC_BIGINT* k, WC_BIGINT* xG,
37143705
}
37153706

37163707
/* setup cofactor */
3708+
/* for this point multiply the cofactor should not be used, so always pass 1 */
37173709
/* if using default value 1 then use shared global */
37183710
opData->h.dataLenInBytes = 4;
3719-
if (cofactor == 1) {
3720-
opData->h.pData = g_qatEcdhCofactor1;
3721-
}
3722-
else {
3723-
/* if not default value 1, then use own buffer */
3724-
opData->h.pData = XMALLOC(opData->h.dataLenInBytes, dev->heap,
3725-
DYNAMIC_TYPE_ASYNC_NUMA);
3726-
if (opData->h.pData == NULL) {
3727-
ret = MEMORY_E; goto exit;
3728-
}
3729-
*((word32*)opData->h.pData) = OS_HOST_TO_NW_32(cofactor);
3730-
}
3711+
opData->h.pData = g_qatEcdhCofactor1;
3712+
(void)cofactor;
37313713

37323714
pXk->dataLenInBytes = q->len; /* bytes key size / 8 (aligned) */
37333715
pXk->pData = XREALLOC(out, pXk->dataLenInBytes, dev->heap,

0 commit comments

Comments
 (0)