Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
[cris-mirror.git] / arch / x86 / include / asm / crypto / twofish.h
blob65bb80adba3ef096849595f1df2612fd7aa81431
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,
22 const u8 *src);
23 asmlinkage void twofish_dec_blk(struct twofish_ctx *ctx, u8 *dst,
24 const u8 *src);
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,
30 const u8 *src);
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,
35 le128 *iv);
36 extern void twofish_enc_blk_ctr_3way(void *ctx, u128 *dst, const u128 *src,
37 le128 *iv);
39 extern int lrw_twofish_setkey(struct crypto_tfm *tfm, const u8 *key,
40 unsigned int keylen);
42 extern void lrw_twofish_exit_tfm(struct crypto_tfm *tfm);
44 extern int xts_twofish_setkey(struct crypto_tfm *tfm, const u8 *key,
45 unsigned int keylen);
47 #endif /* ASM_X86_TWOFISH_H */