blob: 8d1d4552d8092390e877ffead5cc362fb7952138 [file] [log] [blame]
Vadim Bendebury889ec832015-05-26 17:11:06 -07001/*
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 Bendeburyf788ffb2015-06-05 12:57:27 -070010TPM_RC PCRAllocate(TPML_PCR_SELECTION *allocate, // IN: required allocation
11 UINT32 *maxPCR, // OUT: Maximum number of PCR
12 UINT32 *sizeNeeded, // OUT: required space
13 UINT32 *sizeAvailable // OUT: available space
14 );
15BOOL PCRBelongsAuthGroup(TPMI_DH_PCR handle, // IN: handle of PCR
16 UINT32 *groupIndex // OUT: group index if PCR belongs
17 // a group that allows authValue.
18 // If PCR does not belong to an
19 // auth group, the value in this
20 // parameter is invalid
21 );
22BOOL PCRBelongsPolicyGroup(TPMI_DH_PCR handle, // IN: handle of PCR
23 UINT32 *groupIndex // OUT: group index if PCR
24 // belongs a group that allows
25 // policy. If PCR does not belong
26 // to a policy group, the value
27 // in this parameter is invalid
28 );
Vadim Bendeburybbd79002015-05-31 14:44:07 -070029TPMI_YES_NO PCRCapGetAllocation(
Vadim Bendeburyf788ffb2015-06-05 12:57:27 -070030 UINT32 count, // IN: count of return
31 TPML_PCR_SELECTION *pcrSelection // OUT: PCR allocation list
32 );
33void PCRChanged(TPM_HANDLE pcrHandle // IN: the handle of the PCR that changed.
34 );
Vadim Bendeburyfe7bde42015-06-01 10:55:46 -070035void PCRComputeCurrentDigest(
Vadim Bendeburyf788ffb2015-06-05 12:57:27 -070036 TPMI_ALG_HASH hashAlg, // IN: hash algorithm to compute digest
37 TPML_PCR_SELECTION *
38 selection, // IN/OUT: PCR selection (filtered on output)
39 TPM2B_DIGEST *digest // OUT: digest
40 );
41TPMI_ALG_HASH PCRGetAuthPolicy(TPMI_DH_PCR handle, // IN: PCR handle
42 TPM2B_DIGEST *policy // OUT: policy of PCR
Vadim Bendebury889ec832015-05-26 17:11:06 -070043 );
Vadim Bendeburyf788ffb2015-06-05 12:57:27 -070044TPMI_YES_NO PCRCapGetHandles(TPMI_DH_PCR handle, // IN: start handle
45 UINT32 count, // IN: count of returned handle
46 TPML_HANDLE *handleList // OUT: list of handle
47 );
Vadim Bendeburybbd79002015-05-31 14:44:07 -070048TPMI_YES_NO PCRCapGetProperties(
Vadim Bendeburyf788ffb2015-06-05 12:57:27 -070049 TPM_PT_PCR property, // IN: the starting PCR property
50 UINT32 count, // IN: count of returned propertie
51 TPML_TAGGED_PCR_PROPERTY *select // OUT: PCR select
52 );
53void PCRGetAuthValue(TPMI_DH_PCR handle, // IN: PCR handle
54 TPM2B_AUTH *auth // OUT: authValue of PCR
Vadim Bendebury889ec832015-05-26 17:11:06 -070055 );
Vadim Bendeburyf788ffb2015-06-05 12:57:27 -070056void PCRExtend(TPMI_DH_PCR handle, // IN: PCR handle to be extended
57 TPMI_ALG_HASH hash, // IN: hash algorithm of PCR
58 UINT32 size, // IN: size of data to be extended
59 BYTE *data // IN: data to be extended
Vadim Bendeburyb0d692f2015-05-29 22:54:52 -070060 );
Vadim Bendeburyf788ffb2015-06-05 12:57:27 -070061void PCRResetDynamics(void);
Vadim Bendebury2a791af2015-06-01 19:17:51 -070062void PcrDrtm(
Vadim Bendeburyf788ffb2015-06-05 12:57:27 -070063 const TPMI_DH_PCR pcrHandle, // IN: the index of the PCR to be modified
64 const TPMI_ALG_HASH hash, // IN: the bank identifier
65 const TPM2B_DIGEST *digest // IN: the digest to modify the PCR
66 );
67BOOL PcrIsAllocated(UINT32 pcr, // IN: The number of the PCR
68 TPMI_ALG_HASH hashAlg // IN: The PCR algorithm
69 );
70BOOL PCRIsExtendAllowed(TPMI_DH_PCR handle // IN: PCR handle to be extended
Vadim Bendeburyb0d692f2015-05-29 22:54:52 -070071 );
Vadim Bendeburyf788ffb2015-06-05 12:57:27 -070072BOOL PCRIsResetAllowed(TPMI_DH_PCR handle // IN: PCR handle to be extended
73 );
74BOOL PCRIsStateSaved(TPMI_DH_PCR handle // IN: PCR handle to be extended
Vadim Bendeburyb0d692f2015-05-29 22:54:52 -070075 );
Vadim Bendeburyf788ffb2015-06-05 12:57:27 -070076BOOL PCRPolicyIsAvailable(TPMI_DH_PCR handle // IN: PCR handle
77 );
Vadim Bendebury3a6b9cb2015-06-01 12:02:26 -070078void PCRRead(
Vadim Bendeburyf788ffb2015-06-05 12:57:27 -070079 TPML_PCR_SELECTION *
80 selection, // IN/OUT: PCR selection (filtered on output)
81 TPML_DIGEST *digest, // OUT: digest
82 UINT32 *pcrCounter // OUT: the current value of PCR generation number
83 );
84void PCRSetValue(TPM_HANDLE handle, // IN: the handle of the PCR to set
85 INT8 initialValue // IN: the value to set
86 );
87void PCRSimStart(void);
88void PCRStartup(STARTUP_TYPE type, // IN: startup type
89 BYTE locality // IN: startup locality
90 );
91void PCRStateSave(TPM_SU type // IN: startup type
92 );
Vadim Bendebury889ec832015-05-26 17:11:06 -070093
Vadim Bendeburyf788ffb2015-06-05 12:57:27 -070094#endif // __TPM2_PCR_FP_H