xref: /openbmc/linux/include/crypto/cast6.h (revision 674f368a)
1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
22b49b906SJohannes Goetzfried #ifndef _CRYPTO_CAST6_H
32b49b906SJohannes Goetzfried #define _CRYPTO_CAST6_H
42b49b906SJohannes Goetzfried 
52b49b906SJohannes Goetzfried #include <linux/types.h>
62b49b906SJohannes Goetzfried #include <linux/crypto.h>
7044ab525SJussi Kivilinna #include <crypto/cast_common.h>
82b49b906SJohannes Goetzfried 
92b49b906SJohannes Goetzfried #define CAST6_BLOCK_SIZE 16
102b49b906SJohannes Goetzfried #define CAST6_MIN_KEY_SIZE 16
112b49b906SJohannes Goetzfried #define CAST6_MAX_KEY_SIZE 32
122b49b906SJohannes Goetzfried 
132b49b906SJohannes Goetzfried struct cast6_ctx {
142b49b906SJohannes Goetzfried 	u32 Km[12][4];
152b49b906SJohannes Goetzfried 	u8 Kr[12][4];
162b49b906SJohannes Goetzfried };
172b49b906SJohannes Goetzfried 
18674f368aSEric Biggers int __cast6_setkey(struct cast6_ctx *ctx, const u8 *key, unsigned int keylen);
192b49b906SJohannes Goetzfried int cast6_setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen);
202b49b906SJohannes Goetzfried 
219c1e8836SKees Cook void __cast6_encrypt(const void *ctx, u8 *dst, const u8 *src);
229c1e8836SKees Cook void __cast6_decrypt(const void *ctx, u8 *dst, const u8 *src);
232b49b906SJohannes Goetzfried 
242b49b906SJohannes Goetzfried #endif
25