forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
crypto: x86/sm4 - export reusable AESNI/AVX functions
Export the reusable functions in the SM4 AESNI/AVX implementation, mainly public functions, which are used to develop the SM4 AESNI/AVX2 implementation, and eliminate unnecessary duplication of code. At the same time, in order to make the public function universal, minor fixes was added. Signed-off-by: Tianjia Zhang <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
- Loading branch information
Showing
2 changed files
with
84 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* SPDX-License-Identifier: GPL-2.0-or-later */ | ||
#ifndef ASM_X86_SM4_AVX_H | ||
#define ASM_X86_SM4_AVX_H | ||
|
||
#include <linux/types.h> | ||
#include <crypto/sm4.h> | ||
|
||
typedef void (*sm4_crypt_func)(const u32 *rk, u8 *dst, const u8 *src, u8 *iv); | ||
|
||
int sm4_avx_ecb_encrypt(struct skcipher_request *req); | ||
int sm4_avx_ecb_decrypt(struct skcipher_request *req); | ||
|
||
int sm4_cbc_encrypt(struct skcipher_request *req); | ||
int sm4_avx_cbc_decrypt(struct skcipher_request *req, | ||
unsigned int bsize, sm4_crypt_func func); | ||
|
||
int sm4_cfb_encrypt(struct skcipher_request *req); | ||
int sm4_avx_cfb_decrypt(struct skcipher_request *req, | ||
unsigned int bsize, sm4_crypt_func func); | ||
|
||
int sm4_avx_ctr_crypt(struct skcipher_request *req, | ||
unsigned int bsize, sm4_crypt_func func); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters