1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef ASM_X86_TWOFISH_H
3 #define ASM_X86_TWOFISH_H
5 #include <linux/crypto.h>
6 #include <crypto/twofish.h>
7 #include <crypto/lrw.h>
8 #include <crypto/b128ops.h>
10 struct twofish_lrw_ctx
{
11 struct lrw_table_ctx lrw_table
;
12 struct twofish_ctx twofish_ctx
;
15 struct twofish_xts_ctx
{
16 struct twofish_ctx tweak_ctx
;
17 struct twofish_ctx crypt_ctx
;
20 /* regular block cipher functions from twofish_x86_64 module */
21 asmlinkage
void twofish_enc_blk(struct twofish_ctx
*ctx
, u8
*dst
,
23 asmlinkage
void twofish_dec_blk(struct twofish_ctx
*ctx
, u8
*dst
,
26 /* 3-way parallel cipher functions */
27 asmlinkage
void __twofish_enc_blk_3way(struct twofish_ctx
*ctx
, u8
*dst
,
28 const u8
*src
, bool xor);
29 asmlinkage
void twofish_dec_blk_3way(struct twofish_ctx
*ctx
, u8
*dst
,
32 /* helpers from twofish_x86_64-3way module */
33 extern void twofish_dec_blk_cbc_3way(void *ctx
, u128
*dst
, const u128
*src
);
34 extern void twofish_enc_blk_ctr(void *ctx
, u128
*dst
, const u128
*src
,
36 extern void twofish_enc_blk_ctr_3way(void *ctx
, u128
*dst
, const u128
*src
,
39 extern int lrw_twofish_setkey(struct crypto_tfm
*tfm
, const u8
*key
,
42 extern void lrw_twofish_exit_tfm(struct crypto_tfm
*tfm
);
44 extern int xts_twofish_setkey(struct crypto_tfm
*tfm
, const u8
*key
,
47 #endif /* ASM_X86_TWOFISH_H */