Jocelyn Bohr | a4ed3aa | 2015-07-30 10:44:16 -0700 | [diff] [blame] | 1 | // Copyright 2015 The Chromium OS Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
Vadim Bendebury | ccc99fe | 2015-05-27 10:10:39 -0700 | [diff] [blame] | 4 | |
Jocelyn Bohr | a4ed3aa | 2015-07-30 10:44:16 -0700 | [diff] [blame] | 5 | // THIS CODE IS GENERATED - DO NOT MODIFY! |
| 6 | |
Vadim Bendebury | 776e236 | 2015-09-04 16:14:53 -0700 | [diff] [blame] | 7 | #ifndef TPM2_HASH_FP_H_ |
| 8 | #define TPM2_HASH_FP_H_ |
Jocelyn Bohr | a4ed3aa | 2015-07-30 10:44:16 -0700 | [diff] [blame] | 9 | |
| 10 | #include "tpm_generated.h" |
Vadim Bendebury | ccc99fe | 2015-05-27 10:10:39 -0700 | [diff] [blame] | 11 | |
| 12 | typedef struct { |
Jocelyn Bohr | a4ed3aa | 2015-07-30 10:44:16 -0700 | [diff] [blame] | 13 | TPM2B_MAX_BUFFER data; |
Vadim Bendebury | f788ffb | 2015-06-05 12:57:27 -0700 | [diff] [blame] | 14 | TPMI_ALG_HASH hashAlg; |
| 15 | TPMI_RH_HIERARCHY hierarchy; |
Vadim Bendebury | ccc99fe | 2015-05-27 10:10:39 -0700 | [diff] [blame] | 16 | } Hash_In; |
| 17 | |
| 18 | typedef struct { |
Vadim Bendebury | f788ffb | 2015-06-05 12:57:27 -0700 | [diff] [blame] | 19 | TPM2B_DIGEST outHash; |
| 20 | TPMT_TK_HASHCHECK validation; |
Vadim Bendebury | ccc99fe | 2015-05-27 10:10:39 -0700 | [diff] [blame] | 21 | } Hash_Out; |
| 22 | |
Jocelyn Bohr | a4ed3aa | 2015-07-30 10:44:16 -0700 | [diff] [blame] | 23 | // Executes Hash with request handles and parameters from |
| 24 | // |in| and computes response handles and parameters to |out|. |
| 25 | TPM_RC TPM2_Hash(Hash_In* in, Hash_Out* out); |
Vadim Bendebury | ccc99fe | 2015-05-27 10:10:39 -0700 | [diff] [blame] | 26 | |
Vadim Bendebury | 776e236 | 2015-09-04 16:14:53 -0700 | [diff] [blame] | 27 | // Initializes handle fields in |target| from |request_handles|. Unmarshals |
Jocelyn Bohr | a4ed3aa | 2015-07-30 10:44:16 -0700 | [diff] [blame] | 28 | // parameter fields in |target| from |buffer|. |
| 29 | TPM_RC Hash_In_Unmarshal(Hash_In* target, |
Vadim Bendebury | 776e236 | 2015-09-04 16:14:53 -0700 | [diff] [blame] | 30 | TPM_HANDLE request_handles[], |
Jocelyn Bohr | a4ed3aa | 2015-07-30 10:44:16 -0700 | [diff] [blame] | 31 | BYTE** buffer, |
| 32 | INT32* size); |
| 33 | |
| 34 | // Marshals response handles and parameters from |source| to |buffer|. Computes |
| 35 | // and marshals the size of the parameter area (parameter_size) if |tag| == |
| 36 | // TPM_ST_SESSIONS. Returns size of (parameter area + handle area) in bytes. |
Vadim Bendebury | 776e236 | 2015-09-04 16:14:53 -0700 | [diff] [blame] | 37 | // Return value does not include parameter_size field. |
Jocelyn Bohr | a4ed3aa | 2015-07-30 10:44:16 -0700 | [diff] [blame] | 38 | UINT16 Hash_Out_Marshal(Hash_Out* source, |
| 39 | TPMI_ST_COMMAND_TAG tag, |
| 40 | BYTE** buffer, |
| 41 | INT32* size); |
| 42 | |
Vadim Bendebury | 776e236 | 2015-09-04 16:14:53 -0700 | [diff] [blame] | 43 | // Unmarshals any request parameters starting at |request_parameter_buffer|. |
Jocelyn Bohr | a4ed3aa | 2015-07-30 10:44:16 -0700 | [diff] [blame] | 44 | // Executes command. Marshals any response handles and parameters to the |
Vadim Bendebury | 776e236 | 2015-09-04 16:14:53 -0700 | [diff] [blame] | 45 | // global response buffer and computes |*response_handle_buffer_size| and |
| 46 | // |*response_parameter_buffer_size|. If |tag| == TPM_ST_SESSIONS, marshals |
Jocelyn Bohr | a4ed3aa | 2015-07-30 10:44:16 -0700 | [diff] [blame] | 47 | // parameter_size indicating the size of the parameter area. parameter_size |
| 48 | // field is located between the handle area and parameter area. |
| 49 | TPM_RC Exec_Hash(TPMI_ST_COMMAND_TAG tag, |
Vadim Bendebury | 776e236 | 2015-09-04 16:14:53 -0700 | [diff] [blame] | 50 | BYTE** request_parameter_buffer, |
| 51 | INT32* request_parameter_buffer_size, |
| 52 | TPM_HANDLE request_handles[], |
| 53 | UINT32* response_handle_buffer_size, |
| 54 | UINT32* response_parameter_buffer_size); |
Jocelyn Bohr | a4ed3aa | 2015-07-30 10:44:16 -0700 | [diff] [blame] | 55 | |
| 56 | #endif // TPM2_HASH_FP_H |