[PATCH 3/3] sm4-arm-sve-ce: use 32 parallel blocks for XTS and CTR32LE

Tianjia Zhang tianjia.zhang at linux.alibaba.com
Thu Jul 21 14:08:49 CEST 2022


Hi Jussi,

On 7/21/22 4:09 PM, Jussi Kivilinna wrote:
> * cipher/sm4.c (sm4_crypt_blk1_32) [USE_ARM_SVE_CE]: Add SVE-SM4 code
> path.
> --
> 
> Signed-off-by: Jussi Kivilinna <jussi.kivilinna at iki.fi>
> ---
>   cipher/sm4.c | 7 +++++++
>   1 file changed, 7 insertions(+)
> 
> diff --git a/cipher/sm4.c b/cipher/sm4.c
> index f68197c4..b5d4691d 100644
> --- a/cipher/sm4.c
> +++ b/cipher/sm4.c
> @@ -1462,6 +1462,13 @@ sm4_crypt_blk1_32 (const SM4_context *ctx, byte *outbuf, const byte *inbuf,
>         return _gcry_sm4_gfni_avx512_crypt_blk32 (rk, outbuf, inbuf);
>       }
>   #endif
> +#ifdef USE_ARM_SVE_CE
> +  if (ctx->use_arm_sve_ce)
> +    {
> +      _gcry_sm4_armv9_sve_ce_crypt (rk, outbuf, inbuf, num_blks);
> +      return 0;
> +    }
> +#endif
>   
>     do
>       {

Looks good to me.

Reviewed-by: Tianjia Zhang <tianjia.zhang at linux.alibaba.com>

Unfortunately I don't have a machine to test avx512 at the moment.

Best regards,
Tianjia



More information about the Gcrypt-devel mailing list