crypto.h 800 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * AppArmor security module
  4. *
  5. * This file contains AppArmor policy loading interface function definitions.
  6. *
  7. * Copyright 2013 Canonical Ltd.
  8. */
  9. #ifndef __APPARMOR_CRYPTO_H
  10. #define __APPARMOR_CRYPTO_H
  11. #include "policy.h"
  12. #ifdef CONFIG_SECURITY_APPARMOR_HASH
  13. unsigned int aa_hash_size(void);
  14. char *aa_calc_hash(void *data, size_t len);
  15. int aa_calc_profile_hash(struct aa_profile *profile, u32 version, void *start,
  16. size_t len);
  17. #else
  18. static inline char *aa_calc_hash(void *data, size_t len)
  19. {
  20. return NULL;
  21. }
  22. static inline int aa_calc_profile_hash(struct aa_profile *profile, u32 version,
  23. void *start, size_t len)
  24. {
  25. return 0;
  26. }
  27. static inline unsigned int aa_hash_size(void)
  28. {
  29. return 0;
  30. }
  31. #endif
  32. #endif /* __APPARMOR_CRYPTO_H */