Skip to content

Commit

Permalink
Merge pull request #54 from dgarske/zd15017
Browse files Browse the repository at this point in the history
  • Loading branch information
haydenroche5 authored Nov 4, 2022
2 parents 99a7a50 + aeade76 commit 85c1c6b
Showing 1 changed file with 6 additions and 24 deletions.
30 changes: 6 additions & 24 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 Expand Up @@ -3714,20 +3705,11 @@ int IntelQaEcdh(WC_ASYNC_DEV* dev, WC_BIGINT* k, WC_BIGINT* xG,
}

/* 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;

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

0 comments on commit 85c1c6b

Please # to comment.