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