MCPcopy Create free account
hub / github.com/F-Stack/f-stack / process_cpu_auth_hmac

Function process_cpu_auth_hmac

dpdk/drivers/crypto/ccp/ccp_crypto.c:1424–1450  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1422}
1423
1424static int
1425process_cpu_auth_hmac(uint8_t *src, uint8_t *dst,
1426 __rte_unused uint8_t *iv,
1427 EVP_PKEY *pkey,
1428 int srclen,
1429 EVP_MD_CTX *ctx,
1430 const EVP_MD *algo,
1431 uint16_t d_len)
1432{
1433 size_t dstlen;
1434 unsigned char temp_dst[64];
1435
1436 if (EVP_DigestSignInit(ctx, NULL, algo, NULL, pkey) <= 0)
1437 goto process_auth_err;
1438
1439 if (EVP_DigestSignUpdate(ctx, (char *)src, srclen) <= 0)
1440 goto process_auth_err;
1441
1442 if (EVP_DigestSignFinal(ctx, temp_dst, &dstlen) <= 0)
1443 goto process_auth_err;
1444
1445 memcpy(dst, temp_dst, d_len);
1446 return 0;
1447process_auth_err:
1448 CCP_LOG_ERR("Process cpu auth failed");
1449 return -EINVAL;
1450}
1451
1452static int cpu_crypto_auth(struct ccp_qp *qp,
1453 struct rte_crypto_op *op,

Callers 1

cpu_crypto_authFunction · 0.85

Calls 1

memcpyFunction · 0.50

Tested by

no test coverage detected