xref: /linux/include/crypto/cast5.h (revision 498495dba268b20e8eadd7fe93c140c68b6cc9d2)
1*b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
2270b0c6bSJohannes Goetzfried #ifndef _CRYPTO_CAST5_H
3270b0c6bSJohannes Goetzfried #define _CRYPTO_CAST5_H
4270b0c6bSJohannes Goetzfried 
5270b0c6bSJohannes Goetzfried #include <linux/types.h>
6270b0c6bSJohannes Goetzfried #include <linux/crypto.h>
7044ab525SJussi Kivilinna #include <crypto/cast_common.h>
8270b0c6bSJohannes Goetzfried 
9270b0c6bSJohannes Goetzfried #define CAST5_BLOCK_SIZE 8
10270b0c6bSJohannes Goetzfried #define CAST5_MIN_KEY_SIZE 5
11270b0c6bSJohannes Goetzfried #define CAST5_MAX_KEY_SIZE 16
12270b0c6bSJohannes Goetzfried 
13270b0c6bSJohannes Goetzfried struct cast5_ctx {
14270b0c6bSJohannes Goetzfried 	u32 Km[16];
15270b0c6bSJohannes Goetzfried 	u8 Kr[16];
16270b0c6bSJohannes Goetzfried 	int rr;	/* rr ? rounds = 12 : rounds = 16; (rfc 2144) */
17270b0c6bSJohannes Goetzfried };
18270b0c6bSJohannes Goetzfried 
19270b0c6bSJohannes Goetzfried int cast5_setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen);
20270b0c6bSJohannes Goetzfried 
21270b0c6bSJohannes Goetzfried void __cast5_encrypt(struct cast5_ctx *ctx, u8 *dst, const u8 *src);
22270b0c6bSJohannes Goetzfried void __cast5_decrypt(struct cast5_ctx *ctx, u8 *dst, const u8 *src);
23270b0c6bSJohannes Goetzfried 
24270b0c6bSJohannes Goetzfried #endif
25