[PATCH v3 3/3] drivers/crypto: use RTE_BIT64 in initializations of hash_algos

Morten Brørup mb at smartsharesystems.com
Tue Jan 28 08:45:45 CET 2025


> From: Andre Muezerie [mailto:andremue at linux.microsoft.com]
> Sent: Monday, 27 January 2025 20.33
> 
> This was found during code review of similar issues.
> 
> Signed-off-by: Andre Muezerie <andremue at linux.microsoft.com>
> ---

Reviewed-by: Morten Brørup <mb at smartsharesystems.com>

CNXK crypto & OpenSSL crypto driver maintainers, please review/ack.


>  drivers/crypto/cnxk/cnxk_cryptodev_capabilities.c | 4 ++--
>  drivers/crypto/openssl/rte_openssl_pmd_ops.c      | 4 ++--
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/crypto/cnxk/cnxk_cryptodev_capabilities.c
> b/drivers/crypto/cnxk/cnxk_cryptodev_capabilities.c
> index 4394513002..e78bc37c37 100644
> --- a/drivers/crypto/cnxk/cnxk_cryptodev_capabilities.c
> +++ b/drivers/crypto/cnxk/cnxk_cryptodev_capabilities.c
> @@ -1207,8 +1207,8 @@ static const struct rte_cryptodev_capabilities
> caps_eddsa[] = {
>  		{.asym = {
>  			.xform_capa = {
>  				.xform_type = RTE_CRYPTO_ASYM_XFORM_EDDSA,
> -				.hash_algos = (1 << RTE_CRYPTO_AUTH_SHA512 |
> -					       1 << RTE_CRYPTO_AUTH_SHAKE_256),
> +				.hash_algos =
> (RTE_BIT64(RTE_CRYPTO_AUTH_SHA512) |
> +
> RTE_BIT64(RTE_CRYPTO_AUTH_SHAKE_256)),
>  				.op_types = ((1 << RTE_CRYPTO_ASYM_OP_SIGN) |
>  					     (1 << RTE_CRYPTO_ASYM_OP_VERIFY))
>  			}
> diff --git a/drivers/crypto/openssl/rte_openssl_pmd_ops.c
> b/drivers/crypto/openssl/rte_openssl_pmd_ops.c
> index 18f096abfd..04e018f3df 100644
> --- a/drivers/crypto/openssl/rte_openssl_pmd_ops.c
> +++ b/drivers/crypto/openssl/rte_openssl_pmd_ops.c
> @@ -630,8 +630,8 @@ static const struct rte_cryptodev_capabilities
> openssl_pmd_capabilities[] = {
>  		{.asym = {
>  			.xform_capa = {
>  				.xform_type = RTE_CRYPTO_ASYM_XFORM_EDDSA,
> -				.hash_algos = (1 << RTE_CRYPTO_AUTH_SHA512 |
> -					       1 << RTE_CRYPTO_AUTH_SHAKE_256),
> +				.hash_algos =
> (RTE_BIT64(RTE_CRYPTO_AUTH_SHA512) |
> +
> RTE_BIT64(RTE_CRYPTO_AUTH_SHAKE_256)),
>  				.op_types =
>  				((1<<RTE_CRYPTO_ASYM_OP_SIGN) |
>  				 (1 << RTE_CRYPTO_ASYM_OP_VERIFY)),
> --
> 2.47.2.vfs.0.1



More information about the dev mailing list