1 #ifndef ASM_X86_BLOWFISH_H
2 #define ASM_X86_BLOWFISH_H
3
4 #include <linux/crypto.h>
5 #include <crypto/blowfish.h>
6
7 #define BF_PARALLEL_BLOCKS 4
8
9 /* regular block cipher functions */
10 asmlinkage void __blowfish_enc_blk(struct bf_ctx *ctx, u8 *dst, const u8 *src,
11 bool xor);
12 asmlinkage void blowfish_dec_blk(struct bf_ctx *ctx, u8 *dst, const u8 *src);
13
14 /* 4-way parallel cipher functions */
15 asmlinkage void __blowfish_enc_blk_4way(struct bf_ctx *ctx, u8 *dst,
16 const u8 *src, bool xor);
17 asmlinkage void blowfish_dec_blk_4way(struct bf_ctx *ctx, u8 *dst,
18 const u8 *src);
19
blowfish_enc_blk(struct bf_ctx * ctx,u8 * dst,const u8 * src)20 static inline void blowfish_enc_blk(struct bf_ctx *ctx, u8 *dst, const u8 *src)
21 {
22 __blowfish_enc_blk(ctx, dst, src, false);
23 }
24
blowfish_enc_blk_xor(struct bf_ctx * ctx,u8 * dst,const u8 * src)25 static inline void blowfish_enc_blk_xor(struct bf_ctx *ctx, u8 *dst,
26 const u8 *src)
27 {
28 __blowfish_enc_blk(ctx, dst, src, true);
29 }
30
blowfish_enc_blk_4way(struct bf_ctx * ctx,u8 * dst,const u8 * src)31 static inline void blowfish_enc_blk_4way(struct bf_ctx *ctx, u8 *dst,
32 const u8 *src)
33 {
34 __blowfish_enc_blk_4way(ctx, dst, src, false);
35 }
36
blowfish_enc_blk_xor_4way(struct bf_ctx * ctx,u8 * dst,const u8 * src)37 static inline void blowfish_enc_blk_xor_4way(struct bf_ctx *ctx, u8 *dst,
38 const u8 *src)
39 {
40 __blowfish_enc_blk_4way(ctx, dst, src, true);
41 }
42
43 #endif
44