10 #ifndef __RISCV_CRYPTO_H
11 #define __RISCV_CRYPTO_H
15 #if defined(__cplusplus)
19 #if defined(__riscv_zknd)
20 #if __riscv_xlen == 32
21 #define __riscv_aes32dsi(x, y, bs) __builtin_riscv_aes32dsi(x, y, bs)
22 #define __riscv_aes32dsmi(x, y, bs) __builtin_riscv_aes32dsmi(x, y, bs)
25 #if __riscv_xlen == 64
28 return __builtin_riscv_aes64ds(__x,
__y);
33 return __builtin_riscv_aes64dsm(__x,
__y);
38 return __builtin_riscv_aes64im(__x);
43 #if defined(__riscv_zkne)
44 #if __riscv_xlen == 32
45 #define __riscv_aes32esi(x, y, bs) __builtin_riscv_aes32esi(x, y, bs)
46 #define __riscv_aes32esmi(x, y, bs) __builtin_riscv_aes32esmi(x, y, bs)
49 #if __riscv_xlen == 64
52 return __builtin_riscv_aes64es(__x,
__y);
57 return __builtin_riscv_aes64esm(__x,
__y);
62 #if defined(__riscv_zknd) || defined(__riscv_zkne)
63 #if __riscv_xlen == 64
64 #define __riscv_aes64ks1i(x, rnum) __builtin_riscv_aes64ks1i(x, rnum)
68 return __builtin_riscv_aes64ks2(__x,
__y);
73 #if defined(__riscv_zknh)
76 return __builtin_riscv_sha256sig0(__x);
81 return __builtin_riscv_sha256sig1(__x);
86 return __builtin_riscv_sha256sum0(__x);
91 return __builtin_riscv_sha256sum1(__x);
94 #if __riscv_xlen == 32
97 return __builtin_riscv_sha512sig0h(__x,
__y);
102 return __builtin_riscv_sha512sig0l(__x,
__y);
107 return __builtin_riscv_sha512sig1h(__x,
__y);
112 return __builtin_riscv_sha512sig1l(__x,
__y);
117 return __builtin_riscv_sha512sum0r(__x,
__y);
122 return __builtin_riscv_sha512sum1r(__x,
__y);
126 #if __riscv_xlen == 64
129 return __builtin_riscv_sha512sig0(__x);
134 return __builtin_riscv_sha512sig1(__x);
139 return __builtin_riscv_sha512sum0(__x);
144 return __builtin_riscv_sha512sum1(__x);
149 #if defined(__riscv_zksh)
152 return __builtin_riscv_sm3p0(__x);
157 return __builtin_riscv_sm3p1(__x);
161 #if defined(__riscv_zksed)
162 #define __riscv_sm4ed(x, y, bs) __builtin_riscv_sm4ed(x, y, bs);
163 #define __riscv_sm4ks(x, y, bs) __builtin_riscv_sm4ks(x, y, bs);
166 #if defined(__cplusplus)
_Float16 __2f16 __attribute__((ext_vector_type(2)))
Zeroes the upper 128 bits (bits 255:128) of all YMM registers.
static __inline__ uint32_t uint32_t __y