Vadim Bendebury | 889ec83 | 2015-05-26 17:11:06 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2015 The Chromium OS Authors. All rights reserved. |
| 3 | * Use of this source code is governed by a BSD-style license that can be |
| 4 | * found in the LICENSE file. |
| 5 | */ |
| 6 | |
| 7 | #ifndef __TPM2_PCR_FP_H |
| 8 | #define __TPM2_PCR_FP_H |
| 9 | |
Vadim Bendebury | 5b7b2ca | 2015-06-01 11:14:54 -0700 | [diff] [blame] | 10 | TPM_RC PCRAllocate( |
| 11 | TPML_PCR_SELECTION *allocate, // IN: required allocation |
| 12 | UINT32 *maxPCR, // OUT: Maximum number of PCR |
| 13 | UINT32 *sizeNeeded, // OUT: required space |
| 14 | UINT32 *sizeAvailable // OUT: available space |
| 15 | ); |
Vadim Bendebury | 025269a | 2015-06-01 12:15:52 -0700 | [diff] [blame] | 16 | BOOL PCRBelongsAuthGroup( |
| 17 | TPMI_DH_PCR handle, // IN: handle of PCR |
| 18 | UINT32 *groupIndex // OUT: group index if PCR belongs a |
| 19 | // group that allows authValue. If PCR |
| 20 | // does not belong to an auth group, |
| 21 | // the value in this parameter is |
| 22 | // invalid |
| 23 | ); |
Vadim Bendebury | f0a510e | 2015-06-01 12:11:58 -0700 | [diff] [blame] | 24 | BOOL PCRBelongsPolicyGroup( |
| 25 | TPMI_DH_PCR handle, // IN: handle of PCR |
| 26 | UINT32 *groupIndex // OUT: group index if PCR belongs a group that |
| 27 | // allows policy. If PCR does not belong to |
| 28 | // a policy group, the value in this |
| 29 | // parameter is invalid |
| 30 | ); |
Vadim Bendebury | bbd7900 | 2015-05-31 14:44:07 -0700 | [diff] [blame] | 31 | TPMI_YES_NO PCRCapGetAllocation( |
| 32 | UINT32 count, // IN: count of return |
| 33 | TPML_PCR_SELECTION *pcrSelection // OUT: PCR allocation list |
| 34 | ); |
Vadim Bendebury | 8836bc1 | 2015-06-01 12:04:13 -0700 | [diff] [blame] | 35 | void PCRChanged( |
| 36 | TPM_HANDLE pcrHandle // IN: the handle of the PCR that changed. |
| 37 | ); |
Vadim Bendebury | fe7bde4 | 2015-06-01 10:55:46 -0700 | [diff] [blame] | 38 | void PCRComputeCurrentDigest( |
| 39 | TPMI_ALG_HASH hashAlg, // IN: hash algorithm to compute digest |
| 40 | TPML_PCR_SELECTION *selection, // IN/OUT: PCR selection (filtered on |
| 41 | // output) |
| 42 | TPM2B_DIGEST *digest // OUT: digest |
| 43 | ); |
Vadim Bendebury | 889ec83 | 2015-05-26 17:11:06 -0700 | [diff] [blame] | 44 | TPMI_ALG_HASH PCRGetAuthPolicy( |
| 45 | TPMI_DH_PCR handle, // IN: PCR handle |
| 46 | TPM2B_DIGEST *policy // OUT: policy of PCR |
| 47 | ); |
Vadim Bendebury | bbd7900 | 2015-05-31 14:44:07 -0700 | [diff] [blame] | 48 | TPMI_YES_NO PCRCapGetHandles( |
| 49 | TPMI_DH_PCR handle, // IN: start handle |
| 50 | UINT32 count, // IN: count of returned handle |
| 51 | TPML_HANDLE *handleList // OUT: list of handle |
| 52 | ); |
| 53 | TPMI_YES_NO PCRCapGetProperties( |
| 54 | TPM_PT_PCR property, // IN: the starting PCR property |
| 55 | UINT32 count, // IN: count of returned propertie |
| 56 | TPML_TAGGED_PCR_PROPERTY *select // OUT: PCR select |
| 57 | ); |
Vadim Bendebury | 889ec83 | 2015-05-26 17:11:06 -0700 | [diff] [blame] | 58 | void PCRGetAuthValue( |
| 59 | TPMI_DH_PCR handle, // IN: PCR handle |
| 60 | TPM2B_AUTH *auth // OUT: authValue of PCR |
| 61 | ); |
Vadim Bendebury | b0d692f | 2015-05-29 22:54:52 -0700 | [diff] [blame] | 62 | void PCRExtend( |
| 63 | TPMI_DH_PCR handle, // IN: PCR handle to be extended |
| 64 | TPMI_ALG_HASH hash, // IN: hash algorithm of PCR |
| 65 | UINT32 size, // IN: size of data to be extended |
| 66 | BYTE *data // IN: data to be extended |
| 67 | ); |
Vadim Bendebury | 2a791af | 2015-06-01 19:17:51 -0700 | [diff] [blame] | 68 | void PCRResetDynamics( |
| 69 | void |
| 70 | ); |
| 71 | void PcrDrtm( |
| 72 | const TPMI_DH_PCR pcrHandle, // IN: the index of the PCR to be |
| 73 | // modified |
| 74 | const TPMI_ALG_HASH hash, // IN: the bank identifier |
| 75 | const TPM2B_DIGEST *digest // IN: the digest to modify the PCR |
| 76 | ); |
Vadim Bendebury | 2e00b3e | 2015-06-01 19:17:12 -0700 | [diff] [blame] | 77 | BOOL PcrIsAllocated ( |
| 78 | UINT32 pcr, // IN: The number of the PCR |
| 79 | TPMI_ALG_HASH hashAlg // IN: The PCR algorithm |
| 80 | ); |
Vadim Bendebury | b0d692f | 2015-05-29 22:54:52 -0700 | [diff] [blame] | 81 | BOOL PCRIsExtendAllowed( |
| 82 | TPMI_DH_PCR handle // IN: PCR handle to be extended |
| 83 | ); |
Vadim Bendebury | 8836bc1 | 2015-06-01 12:04:13 -0700 | [diff] [blame] | 84 | BOOL PCRIsResetAllowed( |
| 85 | TPMI_DH_PCR handle // IN: PCR handle to be extended |
| 86 | ); |
Vadim Bendebury | b0d692f | 2015-05-29 22:54:52 -0700 | [diff] [blame] | 87 | BOOL PCRIsStateSaved( |
| 88 | TPMI_DH_PCR handle // IN: PCR handle to be extended |
| 89 | ); |
Vadim Bendebury | 3d5312a | 2015-06-01 18:19:06 -0700 | [diff] [blame] | 90 | BOOL PCRPolicyIsAvailable( |
| 91 | TPMI_DH_PCR handle // IN: PCR handle |
| 92 | ); |
Vadim Bendebury | 3a6b9cb | 2015-06-01 12:02:26 -0700 | [diff] [blame] | 93 | void PCRRead( |
| 94 | TPML_PCR_SELECTION *selection, // IN/OUT: PCR selection (filtered on |
| 95 | // output) |
| 96 | TPML_DIGEST *digest, // OUT: digest |
| 97 | UINT32 *pcrCounter // OUT: the current value of PCR generation |
| 98 | // number |
| 99 | ); |
Vadim Bendebury | 8836bc1 | 2015-06-01 12:04:13 -0700 | [diff] [blame] | 100 | void PCRSetValue( |
| 101 | TPM_HANDLE handle, // IN: the handle of the PCR to set |
| 102 | INT8 initialValue // IN: the value to set |
| 103 | ); |
Vadim Bendebury | 62f9d01 | 2015-05-31 15:54:32 -0700 | [diff] [blame] | 104 | void PCRSimStart( |
| 105 | void |
| 106 | ); |
Vadim Bendebury | 523b0eb | 2015-06-01 18:53:59 -0700 | [diff] [blame] | 107 | void PCRStartup( |
| 108 | STARTUP_TYPE type, // IN: startup type |
| 109 | BYTE locality // IN: startup locality |
| 110 | ); |
Vadim Bendebury | f465318 | 2015-06-01 18:35:25 -0700 | [diff] [blame] | 111 | void PCRStateSave( |
| 112 | TPM_SU type // IN: startup type |
| 113 | ); |
Vadim Bendebury | 889ec83 | 2015-05-26 17:11:06 -0700 | [diff] [blame] | 114 | |
| 115 | #endif // __TPM2_PCR_FP_H |