[PATCH v6 2/3] crypto/qat: add sm2 encryption/decryption function

Stephen Hemminger stephen at networkplumber.org
Wed Oct 23 02:46:51 CEST 2024


On Tue, 22 Oct 2024 20:05:59 +0100
Arkadiusz Kusztal <arkadiuszx.kusztal at intel.com> wrote:

> +	uint32_t alg_bytesize = cookie->alg_bytesize;
> +
> +	rte_memcpy(asym_op->sm2.c1.x.data, cookie->output_array[0], alg_bytesize);
> +	rte_memcpy(asym_op->sm2.c1.y.data, cookie->output_array[1], alg_bytesize);
> +	rte_memcpy(asym_op->sm2.kp.x.data, cookie->output_array[2], alg_bytesize);
> +	rte_memcpy(asym_op->sm2.kp.y.data, cookie->output_array[3], alg_bytesize);

Since the copy is small and not in the fast path, there is no reason to use rte_memcpy().
The memcpy() function is as fast inlines and has more checking from gcc, coverity, ASAN
so it is preferred.


More information about the dev mailing list