xts.h 613 B

123456789101112131415161718192021222324252627
  1. #ifndef _CRYPTO_XTS_H
  2. #define _CRYPTO_XTS_H
  3. #include <crypto/b128ops.h>
  4. struct scatterlist;
  5. struct blkcipher_desc;
  6. #define XTS_BLOCK_SIZE 16
  7. struct xts_crypt_req {
  8. be128 *tbuf;
  9. unsigned int tbuflen;
  10. void *tweak_ctx;
  11. void (*tweak_fn)(void *ctx, u8* dst, const u8* src);
  12. void *crypt_ctx;
  13. void (*crypt_fn)(void *ctx, u8 *blks, unsigned int nbytes);
  14. };
  15. #define XTS_TWEAK_CAST(x) ((void (*)(void *, u8*, const u8*))(x))
  16. int xts_crypt(struct blkcipher_desc *desc, struct scatterlist *dst,
  17. struct scatterlist *src, unsigned int nbytes,
  18. struct xts_crypt_req *req);
  19. #endif /* _CRYPTO_XTS_H */