[EXT] [PATCH v2 03/14] cryptodev: separate key exchange operation enum

Kusztal, ArkadiuszX arkadiuszx.kusztal at intel.com
Thu May 26 13:06:24 CEST 2022



> -----Original Message-----
> From: Akhil Goyal <gakhil at marvell.com>
> Sent: Thursday, May 26, 2022 12:58 PM
> To: Kusztal, ArkadiuszX <arkadiuszx.kusztal at intel.com>; dev at dpdk.org
> Cc: Zhang, Roy Fan <roy.fan.zhang at intel.com>
> Subject: RE: [EXT] [PATCH v2 03/14] cryptodev: separate key exchange
> operation enum
> 
> >  /**
> > + * Asymmetric crypto key exchange operation type  */ enum
> > +rte_crypto_asym_ke_type {
> > +	RTE_CRYPTO_ASYM_KE_PRIVATE_KEY_GENERATE,
> 
> Is it better to shorten it to
> RTE_CRYPTO_ASYM_KE_PRIV_KEY_GENERATE
> RTE_CRYPTO_ASYM_KE_PUB_KEY_GENERATE
+1, Actually I am not big fan of having asym everywhere too.
RTE_CRYPTO_KE_PRIV_KEY_GENERATE would be equally good.
> 
> > +	/**< Private Key generation operation */
> > +	RTE_CRYPTO_ASYM_KE_PUBLIC_KEY_GENERATE,
> > +	/**< Public Key generation operation */
> > +	RTE_CRYPTO_ASYM_KE_SHARED_SECRET_COMPUTE
> > +	/**< Shared Secret compute operation */ };
> > +
> > +/**
> >   * Padding types for RSA signature.
> >   */
> >  enum rte_crypto_rsa_padding_type {
> > @@ -238,7 +248,7 @@ struct rte_crypto_modinv_xform {
> >   *
> >   */
> >  struct rte_crypto_dh_xform {
> > -	enum rte_crypto_asym_op_type type;
> > +	enum rte_crypto_asym_ke_type type;
> >  	/**< Setup xform for key generate or shared secret compute */
> >  	rte_crypto_uint p;
> >  	/**< Prime modulus data */
> > @@ -375,26 +385,27 @@ struct rte_crypto_rsa_op_param {  struct
> > rte_crypto_dh_op_param {
> >  	rte_crypto_uint pub_key;
> >  	/**<
> > -	 * Output generated public key when xform type is
> > -	 * DH PUB_KEY_GENERATION.
> > -	 * Input peer public key when xform type is DH
> > -	 * SHARED_SECRET_COMPUTATION
> > +	 * Output - generated public key, when xform type is
> 
> It is not xform type, Right?
> It should be key exchange type.
Yes, I meant xform op_type. Will change, leter it will be overwritten by move dh op patch too.
> Check at other places also.
> 
> > +	 * RTE_CRYPTO_ASYM_KE_PUBLIC_KEY_GENERATE.
> >  	 *
> > +	 * Input - peer's public key, when xform type is
> > +	 * RTE_CRYPTO_ASYM_KE_SHARED_SECRET_COMPUTE.
> >  	 */
> >
> >  	rte_crypto_uint priv_key;
> >  	/**<
> > -	 * Output generated private key if xform type is
> > -	 * DH PRIVATE_KEY_GENERATION
> > -	 * Input when xform type is DH SHARED_SECRET_COMPUTATION.
> > +	 * Output - generated private key, when xform type is
> > +	 * RTE_CRYPTO_ASYM_KE_PRIVATE_KEY_GENERATE.
> >  	 *
> > +	 * Input - private key, when xform type is one of:
> > +	 * RTE_CRYPTO_ASYM_KE_PUBLIC_KEY_GENERATE,
> > +	 * RTE_CRYPTO_ASYM_KE_SHARED_SECRET_COMPUTE.
> >  	 */
> >
> >  	rte_crypto_uint shared_secret;
> >  	/**<
> > -	 * Output with calculated shared secret
> > -	 * when dh xform set up with op type =
> > SHARED_SECRET_COMPUTATION.
> > -	 *
> > +	 * Output - calculated shared secret when xform type is
> > +	 * RTE_CRYPTO_ASYM_KE_SHARED_SECRET_COMPUTE.
> >  	 */
> >  };
> >



More information about the dev mailing list