[dpdk-dev] [PATCH 3/8] crypto/octeontx: add asymmetric session operations

Akhil Goyal akhil.goyal at nxp.com
Tue Oct 1 14:57:07 CEST 2019


Hi Anoob,

Just a couple of nits

> +
> +static __rte_always_inline void
> +cpt_modex_param_normalize(uint8_t **data, size_t *len)
> +{
> +	size_t i;
> +
> +	/* Strip leading NUL bytes */

Typo NULL

> +
> +	for (i = 0; i < *len; i++) {
> +		if ((*data)[i] != 0)
> +			break;
> +	}
> +
> +	*data += i;
> +	*len -= i;
> +}
> +

<.snip.>

> +static __rte_always_inline void
> +cpt_free_asym_session_parameters(struct cpt_asym_sess_misc *sess)
> +{
> +	struct rte_crypto_modex_xform *mod;
> +	struct rte_crypto_rsa_xform *rsa;
> +
> +	switch (sess->xfrm_type) {
> +	case RTE_CRYPTO_ASYM_XFORM_RSA:
> +		rsa = &sess->rsa_ctx;
> +		if (rsa->n.data)
> +			rte_free(rsa->n.data);
> +		break;
> +	case RTE_CRYPTO_ASYM_XFORM_MODEX:
> +		mod = &sess->mod_ctx;
> +		if (mod->modulus.data)
> +			rte_free(mod->modulus.data);
> +		break;
> +	default:
> +		break;


Do we need an error print here?

> +	}
> +}
> +



More information about the dev mailing list