aes_platform: add riscv64 zkn asm support
@@ -428,6 +428,19 @@ void aes256_t4_xts_decrypt(const unsigned char *in, unsigned char *out,
/* Convert key size to function code: [16,24,32] -> [18,19,20]. */
# define S390X_AES_FC(keylen) (S390X_AES_128 + ((((keylen) << 3) - 128) >> 6))
+# elif defined(OPENSSL_CPUID_OBJ) && defined(__riscv) && __riscv_xlen == 64
+/* RISC-V 64 support */
+# include "riscv_arch.h"
+# define RV64I_ZKND_ZKNE_CAPABLE (RISCV_HAS_ZKND() && RISCV_HAS_ZKNE())
+
+int rv64i_zkne_set_encrypt_key(const unsigned char *userKey, const int bits,
+ AES_KEY *key);
+int rv64i_zknd_set_decrypt_key(const unsigned char *userKey, const int bits,
+ AES_KEY *key);
+void rv64i_zkne_encrypt(const unsigned char *in, unsigned char *out,
+ const AES_KEY *key);
+void rv64i_zknd_decrypt(const unsigned char *in, unsigned char *out,
+ const AES_KEY *key);
# endif
# if defined(HWAES_CAPABLE)
