blowfish.h 1.1 KB

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