serpent-avx.h 821 B

1234567891011121314151617181920212223242526272829303132
  1. #ifndef ASM_X86_SERPENT_AVX_H
  2. #define ASM_X86_SERPENT_AVX_H
  3. #include <linux/crypto.h>
  4. #include <crypto/serpent.h>
  5. #define SERPENT_PARALLEL_BLOCKS 8
  6. asmlinkage void __serpent_enc_blk_8way_avx(struct serpent_ctx *ctx, u8 *dst,
  7. const u8 *src, bool xor);
  8. asmlinkage void serpent_dec_blk_8way_avx(struct serpent_ctx *ctx, u8 *dst,
  9. const u8 *src);
  10. static inline void serpent_enc_blk_xway(struct serpent_ctx *ctx, u8 *dst,
  11. const u8 *src)
  12. {
  13. __serpent_enc_blk_8way_avx(ctx, dst, src, false);
  14. }
  15. static inline void serpent_enc_blk_xway_xor(struct serpent_ctx *ctx, u8 *dst,
  16. const u8 *src)
  17. {
  18. __serpent_enc_blk_8way_avx(ctx, dst, src, true);
  19. }
  20. static inline void serpent_dec_blk_xway(struct serpent_ctx *ctx, u8 *dst,
  21. const u8 *src)
  22. {
  23. serpent_dec_blk_8way_avx(ctx, dst, src);
  24. }
  25. #endif