xref: /OK3568_Linux_fs/kernel/include/crypto/cast6.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0 */
2*4882a593Smuzhiyun #ifndef _CRYPTO_CAST6_H
3*4882a593Smuzhiyun #define _CRYPTO_CAST6_H
4*4882a593Smuzhiyun 
5*4882a593Smuzhiyun #include <linux/types.h>
6*4882a593Smuzhiyun #include <linux/crypto.h>
7*4882a593Smuzhiyun #include <crypto/cast_common.h>
8*4882a593Smuzhiyun 
9*4882a593Smuzhiyun #define CAST6_BLOCK_SIZE 16
10*4882a593Smuzhiyun #define CAST6_MIN_KEY_SIZE 16
11*4882a593Smuzhiyun #define CAST6_MAX_KEY_SIZE 32
12*4882a593Smuzhiyun 
13*4882a593Smuzhiyun struct cast6_ctx {
14*4882a593Smuzhiyun 	u32 Km[12][4];
15*4882a593Smuzhiyun 	u8 Kr[12][4];
16*4882a593Smuzhiyun };
17*4882a593Smuzhiyun 
18*4882a593Smuzhiyun int __cast6_setkey(struct cast6_ctx *ctx, const u8 *key, unsigned int keylen);
19*4882a593Smuzhiyun int cast6_setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen);
20*4882a593Smuzhiyun 
21*4882a593Smuzhiyun void __cast6_encrypt(const void *ctx, u8 *dst, const u8 *src);
22*4882a593Smuzhiyun void __cast6_decrypt(const void *ctx, u8 *dst, const u8 *src);
23*4882a593Smuzhiyun 
24*4882a593Smuzhiyun #endif
25