crypto.h 829 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. int init_profile_hash(void);
  14. unsigned int aa_hash_size(void);
  15. char *aa_calc_hash(void *data, size_t len);
  16. int aa_calc_profile_hash(struct aa_profile *profile, u32 version, void *start,
  17. size_t len);
  18. #else
  19. static inline char *aa_calc_hash(void *data, size_t len)
  20. {
  21. return NULL;
  22. }
  23. static inline int aa_calc_profile_hash(struct aa_profile *profile, u32 version,
  24. void *start, size_t len)
  25. {
  26. return 0;
  27. }
  28. static inline unsigned int aa_hash_size(void)
  29. {
  30. return 0;
  31. }
  32. #endif
  33. #endif /* __APPARMOR_CRYPTO_H */