Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
18 changes: 12 additions & 6 deletions wolfcrypt/src/port/intel/quickassist.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ int IntelQaHardwareStart(const char* process_name, int limitDevAccess)
Cpa32U coreAffinity = 0;
CpaCySymCapabilitiesInfo capabilities;
int j;
XMEMSET(&capabilities, 0, sizeof(capabilities));

status = cpaCyInstanceGetInfo2(g_cyInstances[i],
&g_cyInstanceInfo[i]);
Expand Down Expand Up @@ -1416,11 +1417,11 @@ static int IntelQaSymClose(WC_ASYNC_DEV* dev, int doFree)
#endif

#ifdef QAT_DEBUG
printf("IntelQaSymClose: dev %p, symCtx %p (src %p), symCtxSize %d, isCopy %d, isOpen %d, doFree %d\n",
dev, ctx->symCtx, ctx->symCtxSrc, ctx->symCtxSize, ctx->isCopy, ctx->isOpen, doFree);
printf("IntelQaSymClose: dev %p, ctx %p, symCtx %p (src %p), symCtxSize %d, isCopy %d, isOpen %d, doFree %d\n",
dev, ctx, ctx->symCtx, ctx->symCtxSrc, ctx->symCtxSize, ctx->isCopy, ctx->isOpen, doFree);
#endif

if (ctx->symCtx == ctx->symCtxSrc) {
if (ctx->symCtx == ctx->symCtxSrc && ctx->symCtx != NULL) {
if (ctx->isOpen) {
ctx->isOpen = 0;
#ifdef QAT_DEBUG
Expand Down Expand Up @@ -2842,7 +2843,7 @@ int IntelQaEcdsaVerify(WC_ASYNC_DEV* dev, WC_BIGINT* m,
WC_BIGINT* r, WC_BIGINT* s,
WC_BIGINT* a, WC_BIGINT* b,
WC_BIGINT* q, WC_BIGINT* n,
WC_BIGINT* xg, WC_BIGINT* yg, int* stat)
WC_BIGINT* xg, WC_BIGINT* yg, int* pVerifyStatus)
{
int ret, retryCount = 0;
CpaStatus status = CPA_STATUS_SUCCESS;
Expand Down Expand Up @@ -2878,7 +2879,7 @@ int IntelQaEcdsaVerify(WC_ASYNC_DEV* dev, WC_BIGINT* m,
}

/* store info needed for output */
dev->qat.op.ecc_verify.stat = stat;
dev->qat.op.ecc_verify.stat = pVerifyStatus;
IntelQaOpInit(dev, IntelQaEcdsaVerifyFree);

/* Perform ECDSA verify */
Expand Down Expand Up @@ -3342,10 +3343,15 @@ int IntelQaDrbg(WC_ASYNC_DEV* dev, byte* rngBuf, word32 rngSz)
CpaFlatBuffer* pOut = NULL;
word32 idx = 0, gen = 0;

if (dev == NULL || rngBuf == NULL || rngSz == 0) {
if (dev == NULL || rngBuf == NULL) {
return BAD_FUNC_ARG;
}

/* This function can be called with rngSz == 0 */
if (rngSz == 0) {
return 0; /* no data to get */
}

#ifdef QAT_DEBUG
printf("IntelQaDrbg: dev %p, buf %p, sz %d\n", dev, rngBuf, rngSz);
#endif
Expand Down
2 changes: 1 addition & 1 deletion wolfcrypt/src/port/intel/quickassist_mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ static void* _qaeMemAlloc(size_t size, void* heap, int type

#ifdef WOLFSSL_DEBUG_MEMORY
#ifdef WOLFSSL_DEBUG_MEMORY_PRINT
printf("Malloc: %p (%u) at %s:%d, heap %p, type %d\n",
printf("Alloc: %p (%u) at %s:%d, heap %p, type %d\n",
ptr, (unsigned int)size, func, line, heap, type);
#else
(void)func;
Expand Down