Mailing List Archive

[PATCH 3/3] sm4-arm-sve-ce: use 32 parallel blocks for XTS and CTR32LE
* cipher/sm4.c (sm4_crypt_blk1_32) [USE_ARM_SVE_CE]: Add SVE-SM4 code
path.
--

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@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
{
--
2.34.1


_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel@lists.gnupg.org
https://lists.gnupg.org/mailman/listinfo/gcrypt-devel
Re: [PATCH 3/3] sm4-arm-sve-ce: use 32 parallel blocks for XTS and CTR32LE [ In reply to ]
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@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@linux.alibaba.com>

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

Best regards,
Tianjia

_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel@lists.gnupg.org
https://lists.gnupg.org/mailman/listinfo/gcrypt-devel