summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorHongren (Zenithal) Zheng <i@zenithal.me>2022-04-30 00:11:28 +0800
committerTomas Mraz <tomas@openssl.org>2022-06-10 11:45:41 +0200
commit77d29ff041edcdc6a3d33251d6270a4cfe0be9b3 (patch)
treea584c13930fd02cda0d486cfff5fd0592bd38cfd /include
parentd5dd608364074fadbf4776142ccd8c7b268845cc (diff)
downloadopenssl-new-77d29ff041edcdc6a3d33251d6270a4cfe0be9b3.tar.gz
aes_platform: add riscv64 zkn asm support
Signed-off-by: Hongren (Zenithal) Zheng <i@zenithal.me> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18197)
Diffstat (limited to 'include')
-rw-r--r--include/crypto/aes_platform.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/crypto/aes_platform.h b/include/crypto/aes_platform.h
index fd19c6e2dc..4967d59a64 100644
--- a/include/crypto/aes_platform.h
+++ b/include/crypto/aes_platform.h
@@ -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)