fips140.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #undef TRACE_SYSTEM
  3. #define TRACE_SYSTEM fips140
  4. #define TRACE_INCLUDE_PATH trace/hooks
  5. #if !defined(_TRACE_HOOK_FIPS140_H) || defined(TRACE_HEADER_MULTI_READ)
  6. #define _TRACE_HOOK_FIPS140_H
  7. #include <trace/hooks/vendor_hooks.h>
  8. struct crypto_aes_ctx;
  9. /*
  10. * These hooks exist only for the benefit of the FIPS140 crypto module, which
  11. * uses them to swap out the underlying implementation with one that is integrity
  12. * checked as per FIPS 140 requirements. No other uses are allowed or
  13. * supported.
  14. */
  15. DECLARE_HOOK(android_vh_sha256,
  16. TP_PROTO(const u8 *data,
  17. unsigned int len,
  18. u8 *out,
  19. int *hook_inuse),
  20. TP_ARGS(data, len, out, hook_inuse));
  21. DECLARE_HOOK(android_vh_aes_expandkey,
  22. TP_PROTO(struct crypto_aes_ctx *ctx,
  23. const u8 *in_key,
  24. unsigned int key_len,
  25. int *err),
  26. TP_ARGS(ctx, in_key, key_len, err));
  27. DECLARE_HOOK(android_vh_aes_encrypt,
  28. TP_PROTO(const struct crypto_aes_ctx *ctx,
  29. u8 *out,
  30. const u8 *in,
  31. int *hook_inuse),
  32. TP_ARGS(ctx, out, in, hook_inuse));
  33. DECLARE_HOOK(android_vh_aes_decrypt,
  34. TP_PROTO(const struct crypto_aes_ctx *ctx,
  35. u8 *out,
  36. const u8 *in,
  37. int *hook_inuse),
  38. TP_ARGS(ctx, out, in, hook_inuse));
  39. #endif /* _TRACE_HOOK_FIPS140_H */
  40. /* This part must be outside protection */
  41. #include <trace/define_trace.h>