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

Jussi Kivilinna jussi.kivilinna at iki.fi
Thu Jul 21 10:09:30 CEST 2022


* 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
     {
-- 
2.34.1




More information about the Gcrypt-devel mailing list