cryptd.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * Software async crypto daemon
  3. */
  4. #ifndef _CRYPTO_CRYPT_H
  5. #define _CRYPTO_CRYPT_H
  6. #include <linux/crypto.h>
  7. #include <linux/kernel.h>
  8. #include <crypto/hash.h>
  9. struct cryptd_ablkcipher {
  10. struct crypto_ablkcipher base;
  11. };
  12. static inline struct cryptd_ablkcipher *__cryptd_ablkcipher_cast(
  13. struct crypto_ablkcipher *tfm)
  14. {
  15. return (struct cryptd_ablkcipher *)tfm;
  16. }
  17. /* alg_name should be algorithm to be cryptd-ed */
  18. struct cryptd_ablkcipher *cryptd_alloc_ablkcipher(const char *alg_name,
  19. u32 type, u32 mask);
  20. struct crypto_blkcipher *cryptd_ablkcipher_child(struct cryptd_ablkcipher *tfm);
  21. void cryptd_free_ablkcipher(struct cryptd_ablkcipher *tfm);
  22. struct cryptd_ahash {
  23. struct crypto_ahash base;
  24. };
  25. static inline struct cryptd_ahash *__cryptd_ahash_cast(
  26. struct crypto_ahash *tfm)
  27. {
  28. return (struct cryptd_ahash *)tfm;
  29. }
  30. /* alg_name should be algorithm to be cryptd-ed */
  31. struct cryptd_ahash *cryptd_alloc_ahash(const char *alg_name,
  32. u32 type, u32 mask);
  33. struct crypto_shash *cryptd_ahash_child(struct cryptd_ahash *tfm);
  34. void cryptd_free_ahash(struct cryptd_ahash *tfm);
  35. #endif