xref: /openbmc/linux/arch/x86/crypto/sm4-avx.h (revision de79d9aa)
1*de79d9aaSTianjia Zhang /* SPDX-License-Identifier: GPL-2.0-or-later */
2*de79d9aaSTianjia Zhang #ifndef ASM_X86_SM4_AVX_H
3*de79d9aaSTianjia Zhang #define ASM_X86_SM4_AVX_H
4*de79d9aaSTianjia Zhang 
5*de79d9aaSTianjia Zhang #include <linux/types.h>
6*de79d9aaSTianjia Zhang #include <crypto/sm4.h>
7*de79d9aaSTianjia Zhang 
8*de79d9aaSTianjia Zhang typedef void (*sm4_crypt_func)(const u32 *rk, u8 *dst, const u8 *src, u8 *iv);
9*de79d9aaSTianjia Zhang 
10*de79d9aaSTianjia Zhang int sm4_avx_ecb_encrypt(struct skcipher_request *req);
11*de79d9aaSTianjia Zhang int sm4_avx_ecb_decrypt(struct skcipher_request *req);
12*de79d9aaSTianjia Zhang 
13*de79d9aaSTianjia Zhang int sm4_cbc_encrypt(struct skcipher_request *req);
14*de79d9aaSTianjia Zhang int sm4_avx_cbc_decrypt(struct skcipher_request *req,
15*de79d9aaSTianjia Zhang 			unsigned int bsize, sm4_crypt_func func);
16*de79d9aaSTianjia Zhang 
17*de79d9aaSTianjia Zhang int sm4_cfb_encrypt(struct skcipher_request *req);
18*de79d9aaSTianjia Zhang int sm4_avx_cfb_decrypt(struct skcipher_request *req,
19*de79d9aaSTianjia Zhang 			unsigned int bsize, sm4_crypt_func func);
20*de79d9aaSTianjia Zhang 
21*de79d9aaSTianjia Zhang int sm4_avx_ctr_crypt(struct skcipher_request *req,
22*de79d9aaSTianjia Zhang 			unsigned int bsize, sm4_crypt_func func);
23*de79d9aaSTianjia Zhang 
24*de79d9aaSTianjia Zhang #endif
25