Commit f537454de0 for openssl.org

commit f537454de00015b4a81cbd62ebb221ebfc7bf393
Author: Simo Sorce <simo@redhat.com>
Date:   Thu Jun 11 18:03:16 2026 -0400

    Consolidate RV32I AES hardware implementations

    Move the RISC-V 32-bit hardware-accelerated AES implementations for GCM, CCM,
    and XTS modes into a single file (`cipher_aes_hw_rv32i.c`). This removes the
    need for separate files (`cipher_aes_gcm_hw_rv32i.c` and
    `cipher_aes_ccm_hw_rv32i.c`) and simplifies the build process. Additionally,
    unused `keybits` parameters are removed from the provider hardware
    initialization functions to clean up the code.

    Signed-off-by: Simo Sorce <simo@redhat.com>

    Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
    Reviewed-by: Norbert Pocs <norbertp@openssl.org>
    Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
    MergeDate: Sat Jun 27 09:05:52 2026
    (Merged from https://github.com/openssl/openssl/pull/31472)

diff --git a/providers/implementations/ciphers/build.info b/providers/implementations/ciphers/build.info
index 9dcf738946..671351743b 100644
--- a/providers/implementations/ciphers/build.info
+++ b/providers/implementations/ciphers/build.info
@@ -109,10 +109,10 @@ SOURCE[$AES_GOAL]=\
         cipher_aes_xts.c cipher_aes_xts_hw.c \
         cipher_aes_gcm.c cipher_aes_gcm_hw.c \
         cipher_aes_gcm_hw_ppc.c \
-        cipher_aes_gcm_hw_rv32i.c cipher_aes_gcm_hw_rv64i.c \
+        cipher_aes_gcm_hw_rv64i.c \
         cipher_aes_gcm_hw_s390x.c cipher_aes_gcm_hw_t4.c \
         cipher_aes_ccm.c cipher_aes_ccm_hw.c \
-        cipher_aes_ccm_hw_rv32i.c cipher_aes_ccm_hw_rv64i.c \
+        cipher_aes_ccm_hw_rv64i.c \
         cipher_aes_ccm_hw_s390x.c cipher_aes_ccm_hw_t4.c \
         cipher_aes_wrp.c \
         cipher_aes_cbc_hmac_sha.c \
diff --git a/providers/implementations/ciphers/cipher_aes.h b/providers/implementations/ciphers/cipher_aes.h
index 0f0aff4891..05028053f2 100644
--- a/providers/implementations/ciphers/cipher_aes.h
+++ b/providers/implementations/ciphers/cipher_aes.h
@@ -90,8 +90,7 @@ const PROV_CIPHER_HW *ossl_prov_cipher_hw_aesni(enum aes_modes mode);
 #elif defined(ARMv8_HWAES_CAPABLE)
 const PROV_CIPHER_HW *ossl_prov_cipher_hw_arm(enum aes_modes mode);
 #elif defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 32
-const PROV_CIPHER_HW *ossl_prov_cipher_hw_rv32i(enum aes_modes mode,
-    size_t keybits);
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_rv32i(enum aes_modes mode);
 #elif defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 64
 const PROV_CIPHER_HW *ossl_prov_cipher_hw_rv64i(enum aes_modes mode,
     size_t keybits);
diff --git a/providers/implementations/ciphers/cipher_aes_ccm.h b/providers/implementations/ciphers/cipher_aes_ccm.h
index be690dadb9..2fa59dca75 100644
--- a/providers/implementations/ciphers/cipher_aes_ccm.h
+++ b/providers/implementations/ciphers/cipher_aes_ccm.h
@@ -59,7 +59,7 @@ const PROV_CCM_HW *ossl_prov_aes_hw_ccm(size_t keylen);
 const PROV_CCM_HW *ossl_prov_aes_hw_ccm_aesni(void);
 #endif
 #if defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 32
-const PROV_CCM_HW *ossl_prov_aes_hw_ccm_rv32i(size_t keybits);
+const PROV_CCM_HW *ossl_prov_aes_hw_ccm_rv32i(void);
 #endif
 #if defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 64
 const PROV_CCM_HW *ossl_prov_aes_hw_ccm_rv64i(size_t keybits);
diff --git a/providers/implementations/ciphers/cipher_aes_ccm_hw.c b/providers/implementations/ciphers/cipher_aes_ccm_hw.c
index fa7318d460..2a69a1427d 100644
--- a/providers/implementations/ciphers/cipher_aes_ccm_hw.c
+++ b/providers/implementations/ciphers/cipher_aes_ccm_hw.c
@@ -75,7 +75,7 @@ const PROV_CCM_HW *ossl_prov_aes_hw_ccm(size_t keybits)
 #if defined(AESNI_CAPABLE)
     aes_ccm_hw = ossl_prov_aes_hw_ccm_aesni();
 #elif defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 32
-    aes_ccm_hw = ossl_prov_aes_hw_ccm_rv32i(keybits);
+    aes_ccm_hw = ossl_prov_aes_hw_ccm_rv32i();
 #elif defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 64
     aes_ccm_hw = ossl_prov_aes_hw_ccm_rv64i(keybits);
 #elif defined(S390X_aes_128_CAPABLE)
diff --git a/providers/implementations/ciphers/cipher_aes_ccm_hw_rv32i.c b/providers/implementations/ciphers/cipher_aes_ccm_hw_rv32i.c
deleted file mode 100644
index b2dfee5650..0000000000
--- a/providers/implementations/ciphers/cipher_aes_ccm_hw_rv32i.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright 2022-2023 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/*-
- * RISC-V 32 ZKND ZKNE support for AES CCM.
- * This file is used by cipher_aes_ccm_hw.c
- */
-
-#include "internal/deprecated.h"
-#include "cipher_aes_ccm.h"
-
-#if defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 64
-
-static int ccm_rv32i_zknd_zkne_initkey(PROV_CCM_CTX *ctx, const unsigned char *key,
-    size_t keylen)
-{
-    return ossl_cipher_set_ccm_aes_initkey(ctx, key, keylen,
-        rv32i_zkne_set_encrypt_key, rv32i_zkne_encrypt, NULL, NULL);
-}
-
-static int ccm_rv32i_zbkb_zknd_zkne_initkey(PROV_CCM_CTX *ctx, const unsigned char *key,
-    size_t keylen)
-{
-    return ossl_cipher_set_ccm_aes_initkey(ctx, key, keylen,
-        rv32i_zbkb_zkne_set_encrypt_key, rv32i_zkne_encrypt, NULL, NULL);
-}
-
-static const PROV_CCM_HW rv32i_zknd_zkne_ccm = {
-    ccm_rv32i_zknd_zkne_initkey,
-    ossl_ccm_generic_setiv,
-    ossl_ccm_generic_setaad,
-    ossl_ccm_generic_auth_encrypt,
-    ossl_ccm_generic_auth_decrypt,
-    ossl_ccm_generic_gettag
-};
-
-static const PROV_CCM_HW rv32i_zbkb_zknd_zkne_ccm = {
-    ccm_rv32i_zbkb_zknd_zkne_initkey,
-    ossl_ccm_generic_setiv,
-    ossl_ccm_generic_setaad,
-    ossl_ccm_generic_auth_encrypt,
-    ossl_ccm_generic_auth_decrypt,
-    ossl_ccm_generic_gettag
-};
-
-const PROV_CCM_HW *ossl_prov_aes_hw_ccm_rv32i(size_t keybits)
-{
-    if (RISCV_HAS_ZBKB_AND_ZKND_AND_ZKNE())
-        return &rv32i_zbkb_zknd_zkne_ccm;
-    if (RISCV_HAS_ZKND_AND_ZKNE())
-        return &rv32i_zknd_zkne_ccm;
-    return NULL;
-}
-
-#endif
diff --git a/providers/implementations/ciphers/cipher_aes_gcm.h b/providers/implementations/ciphers/cipher_aes_gcm.h
index 0b8d23fcb9..88ad752e92 100644
--- a/providers/implementations/ciphers/cipher_aes_gcm.h
+++ b/providers/implementations/ciphers/cipher_aes_gcm.h
@@ -62,12 +62,12 @@ const PROV_GCM_HW *ossl_prov_aes_hw_gcm_armv8(void);
 #if defined(PPC_AES_GCM_CAPABLE) && defined(_ARCH_PPC64)
 const PROV_GCM_HW *ossl_prov_aes_hw_gcm_ppc(size_t keybits);
 #endif
+#if defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 32
+const PROV_GCM_HW *ossl_prov_aes_hw_gcm_rv32i(void);
+#endif
 #if defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 64
 const PROV_GCM_HW *ossl_prov_aes_hw_gcm_rv64i(size_t keybits);
 #endif
-#if defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 32
-const PROV_GCM_HW *ossl_prov_aes_hw_gcm_rv32i(size_t keybits);
-#endif
 #if defined(S390X_aes_128_CAPABLE)
 const PROV_GCM_HW *ossl_prov_aes_hw_gcm_s390x(size_t keybits);
 #endif
diff --git a/providers/implementations/ciphers/cipher_aes_gcm_hw.c b/providers/implementations/ciphers/cipher_aes_gcm_hw.c
index 0d166b545a..87e46e71b3 100644
--- a/providers/implementations/ciphers/cipher_aes_gcm_hw.c
+++ b/providers/implementations/ciphers/cipher_aes_gcm_hw.c
@@ -161,10 +161,10 @@ const PROV_GCM_HW *ossl_prov_aes_hw_gcm(size_t keybits)
     aes_gcm_hw = ossl_prov_aes_hw_gcm_armv8();
 #elif defined(PPC_AES_GCM_CAPABLE) && defined(_ARCH_PPC64)
     aes_gcm_hw = ossl_prov_aes_hw_gcm_ppc(keybits);
+#elif defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 32
+    aes_gcm_hw = ossl_prov_aes_hw_gcm_rv32i();
 #elif defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 64
     aes_gcm_hw = ossl_prov_aes_hw_gcm_rv64i(keybits);
-#elif defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 32
-    aes_gcm_hw = ossl_prov_aes_hw_gcm_rv32i(keybits);
 #elif defined(S390X_aes_128_CAPABLE)
     aes_gcm_hw = ossl_prov_aes_hw_gcm_s390x(keybits);
 #elif defined(SPARC_AES_CAPABLE)
diff --git a/providers/implementations/ciphers/cipher_aes_gcm_hw_rv32i.c b/providers/implementations/ciphers/cipher_aes_gcm_hw_rv32i.c
deleted file mode 100644
index 708be6aef5..0000000000
--- a/providers/implementations/ciphers/cipher_aes_gcm_hw_rv32i.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright 2022-2023 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-/*-
- * RISC-V 32 ZKND ZKNE support for AES GCM.
- * This file is used by cipher_aes_gcm_hw.c
- */
-#include "internal/deprecated.h"
-#include "cipher_aes_gcm.h"
-
-#if defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 32
-
-static int rv32i_zknd_zkne_gcm_initkey(PROV_GCM_CTX *ctx, const unsigned char *key,
-    size_t keylen)
-{
-    return aes_gcm_hw_initkey(ctx, key, keylen,
-        rv32i_zkne_set_encrypt_key, rv32i_zkne_encrypt, NULL);
-}
-
-static int rv32i_zbkb_zknd_zkne_gcm_initkey(PROV_GCM_CTX *ctx,
-    const unsigned char *key,
-    size_t keylen)
-{
-    return aes_gcm_hw_initkey(ctx, key, keylen,
-        rv32i_zbkb_zkne_set_encrypt_key, rv32i_zkne_encrypt, NULL);
-}
-
-static const PROV_GCM_HW rv32i_zknd_zkne_gcm = {
-    rv32i_zknd_zkne_gcm_initkey,
-    ossl_gcm_setiv,
-    ossl_gcm_aad_update,
-    generic_aes_gcm_cipher_update,
-    ossl_gcm_cipher_final,
-    ossl_gcm_one_shot
-};
-
-static const PROV_GCM_HW rv32i_zbkb_zknd_zkne_gcm = {
-    rv32i_zbkb_zknd_zkne_gcm_initkey,
-    ossl_gcm_setiv,
-    ossl_gcm_aad_update,
-    generic_aes_gcm_cipher_update,
-    ossl_gcm_cipher_final,
-    ossl_gcm_one_shot
-};
-
-const PROV_GCM_HW *ossl_prov_aes_hw_gcm_rv32i(size_t keybits)
-{
-    if (RISCV_HAS_ZBKB_AND_ZKND_AND_ZKNE())
-        return &rv32i_zbkb_zknd_zkne_gcm;
-    if (RISCV_HAS_ZKND_AND_ZKNE())
-        return &rv32i_zknd_zkne_gcm;
-    return NULL;
-}
-
-#endif
diff --git a/providers/implementations/ciphers/cipher_aes_hw.c b/providers/implementations/ciphers/cipher_aes_hw.c
index e71a15cc00..34b28bb196 100644
--- a/providers/implementations/ciphers/cipher_aes_hw.c
+++ b/providers/implementations/ciphers/cipher_aes_hw.c
@@ -221,7 +221,7 @@ static const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_mode(enum aes_modes mode,
 #elif defined(ARMv8_HWAES_CAPABLE)
     aes_hw_mode = ossl_prov_cipher_hw_arm(mode);
 #elif defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 32
-    aes_hw_mode = ossl_prov_cipher_hw_rv32i(mode, keybits);
+    aes_hw_mode = ossl_prov_cipher_hw_rv32i(mode);
 #elif defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 64
     aes_hw_mode = ossl_prov_cipher_hw_rv64i(mode, keybits);
 #elif defined(S390X_aes_128_CAPABLE)
diff --git a/providers/implementations/ciphers/cipher_aes_hw_rv32i.c b/providers/implementations/ciphers/cipher_aes_hw_rv32i.c
index 375f9dc946..237f6fc20e 100644
--- a/providers/implementations/ciphers/cipher_aes_hw_rv32i.c
+++ b/providers/implementations/ciphers/cipher_aes_hw_rv32i.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2022-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2022-2026 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -8,15 +8,19 @@
  */

 /*-
- * RISC-V 32 ZKND ZKNE support for AES modes ecb, cbc, ofb, cfb, ctr.
- * This file is used by cipher_aes_hw.c
+ * RISC-V 32 ZKND ZKNE support for all hardware accelerated AES modes.
  */

 #include "internal/deprecated.h"
 #include "cipher_aes.h"
+#include "cipher_aes_gcm.h"
+#include "cipher_aes_ccm.h"
+#include "cipher_aes_xts.h"

 #if defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 32

+/* MODES: ecb, cbc, cfb, ofb, ctr */
+
 static int cipher_hw_rv32i_initkey(PROV_CIPHER_CTX *ctx,
     const unsigned char *key, size_t keylen)
 {
@@ -84,8 +88,7 @@ static const PROV_CIPHER_HW rv32i_ctr = {
     ossl_cipher_aes_copyctx
 };

-const PROV_CIPHER_HW *ossl_prov_cipher_hw_rv32i(enum aes_modes mode,
-    size_t keybits)
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_rv32i(enum aes_modes mode)
 {
     if (RISCV_HAS_ZKND_AND_ZKNE()) {
         switch (mode) {
@@ -110,4 +113,99 @@ const PROV_CIPHER_HW *ossl_prov_cipher_hw_rv32i(enum aes_modes mode,
     return NULL;
 }

+/* MODES: GCM */
+
+static int aes_gcm_rv32i_initkey(PROV_GCM_CTX *ctx,
+    const unsigned char *key,
+    size_t keylen)
+{
+    if (RISCV_HAS_ZBKB_AND_ZKND_AND_ZKNE()) {
+        return aes_gcm_hw_initkey(ctx, key, keylen,
+            rv32i_zbkb_zkne_set_encrypt_key, rv32i_zkne_encrypt, NULL);
+    } else if (RISCV_HAS_ZKND_AND_ZKNE()) {
+        return aes_gcm_hw_initkey(ctx, key, keylen,
+            rv32i_zkne_set_encrypt_key, rv32i_zkne_encrypt, NULL);
+    }
+    return 0;
+}
+
+static const PROV_GCM_HW aes_gcm_rv32i = {
+    aes_gcm_rv32i_initkey,
+    ossl_gcm_setiv,
+    ossl_gcm_aad_update,
+    generic_aes_gcm_cipher_update,
+    ossl_gcm_cipher_final,
+    ossl_gcm_one_shot
+};
+
+const PROV_GCM_HW *ossl_prov_aes_hw_gcm_rv32i(void)
+{
+    if (RISCV_HAS_ZKND_AND_ZKNE())
+        return &aes_gcm_rv32i;
+    return NULL;
+}
+
+/* MODES: CCM */
+
+static int aes_ccm_rv32i_initkey(PROV_CCM_CTX *ctx,
+    const unsigned char *key, size_t keylen)
+{
+    if (RISCV_HAS_ZBKB_AND_ZKND_AND_ZKNE()) {
+        return ossl_cipher_set_ccm_aes_initkey(ctx, key, keylen,
+            rv32i_zbkb_zkne_set_encrypt_key, rv32i_zkne_encrypt, NULL, NULL);
+    } else if (RISCV_HAS_ZKND_AND_ZKNE()) {
+        return ossl_cipher_set_ccm_aes_initkey(ctx, key, keylen,
+            rv32i_zkne_set_encrypt_key, rv32i_zkne_encrypt, NULL, NULL);
+    }
+    return 0;
+}
+
+static const PROV_CCM_HW aes_ccm_rv32i = {
+    aes_ccm_rv32i_initkey,
+    ossl_ccm_generic_setiv,
+    ossl_ccm_generic_setaad,
+    ossl_ccm_generic_auth_encrypt,
+    ossl_ccm_generic_auth_decrypt,
+    ossl_ccm_generic_gettag
+};
+
+const PROV_CCM_HW *ossl_prov_aes_hw_ccm_rv32i(void)
+{
+    if (RISCV_HAS_ZKND_AND_ZKNE())
+        return &aes_ccm_rv32i;
+    return NULL;
+}
+
+/* MODES: XTS */
+
+static int cipher_hw_aes_xts_rv32i_initkey(PROV_CIPHER_CTX *ctx,
+    const unsigned char *key, size_t keylen)
+{
+    if (RISCV_HAS_ZBKB_AND_ZKND_AND_ZKNE())
+        return ossl_cipher_set_aes_xts_initkey(ctx, key, keylen,
+            rv32i_zbkb_zkne_set_encrypt_key,
+            rv32i_zbkb_zknd_zkne_set_decrypt_key,
+            rv32i_zkne_encrypt, rv32i_zknd_decrypt, NULL, NULL);
+
+    if (RISCV_HAS_ZKND_AND_ZKNE())
+        return ossl_cipher_set_aes_xts_initkey(ctx, key, keylen,
+            rv32i_zkne_set_encrypt_key, rv32i_zknd_zkne_set_decrypt_key,
+            rv32i_zkne_encrypt, rv32i_zknd_decrypt, NULL, NULL);
+
+    return 0;
+}
+
+static const PROV_CIPHER_HW aes_xts_rv32i = {
+    cipher_hw_aes_xts_rv32i_initkey,
+    NULL,
+    ossl_cipher_hw_aes_xts_copyctx
+};
+
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_xts_rv32i(void)
+{
+    if (RISCV_HAS_ZKND_AND_ZKNE())
+        return &aes_xts_rv32i;
+    return NULL;
+}
+
 #endif
diff --git a/providers/implementations/ciphers/cipher_aes_xts.h b/providers/implementations/ciphers/cipher_aes_xts.h
index f103bad0a9..908e6ab937 100644
--- a/providers/implementations/ciphers/cipher_aes_xts.h
+++ b/providers/implementations/ciphers/cipher_aes_xts.h
@@ -74,6 +74,10 @@ void ossl_cipher_hw_aes_xts_copyctx(PROV_CIPHER_CTX *dst,
 const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_xts_aesni(void);
 #endif

+#if defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 32
+const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_xts_rv32i(void);
+#endif
+
 #ifdef AES_XTS_S390X
 int s390x_aes_xts_cipher_stream(PROV_AES_XTS_CTX *xctx,
     unsigned char *out, size_t *outl,
diff --git a/providers/implementations/ciphers/cipher_aes_xts_hw.c b/providers/implementations/ciphers/cipher_aes_xts_hw.c
index 215d151d69..4bf4462442 100644
--- a/providers/implementations/ciphers/cipher_aes_xts_hw.c
+++ b/providers/implementations/ciphers/cipher_aes_xts_hw.c
@@ -195,38 +195,6 @@ static const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_xts_rv64i()
     return NULL;
 }

-#elif defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 32
-
-static int cipher_hw_aes_xts_rv32i_initkey(PROV_CIPHER_CTX *ctx,
-    const unsigned char *key, size_t keylen)
-{
-    if (RISCV_HAS_ZBKB_AND_ZKND_AND_ZKNE())
-        return ossl_cipher_set_aes_xts_initkey(ctx, key, keylen,
-            rv32i_zbkb_zkne_set_encrypt_key,
-            rv32i_zbkb_zknd_zkne_set_decrypt_key,
-            rv32i_zkne_encrypt, rv32i_zknd_decrypt, NULL, NULL);
-
-    if (RISCV_HAS_ZKND_AND_ZKNE())
-        return ossl_cipher_set_aes_xts_initkey(ctx, key, keylen,
-            rv32i_zkne_set_encrypt_key, rv32i_zknd_zkne_set_decrypt_key,
-            rv32i_zkne_encrypt, rv32i_zknd_decrypt, NULL, NULL);
-
-    return 0;
-}
-
-static const PROV_CIPHER_HW aes_xts_rv32i = {
-    cipher_hw_aes_xts_rv32i_initkey,
-    NULL,
-    ossl_cipher_hw_aes_xts_copyctx
-};
-
-static const PROV_CIPHER_HW *ossl_prov_cipher_hw_aes_xts_rv32i()
-{
-    if (RISCV_HAS_ZKND_AND_ZKNE())
-        return &aes_xts_rv32i;
-    return NULL;
-}
-
 #elif defined(AES_XTS_S390X)

 int s390x_aes_xts_cipher_stream(PROV_AES_XTS_CTX *xctx,