blob: 065b5f5823727ff94737a8def8130f249c0708ec [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 Bendebury5b7b2ca2015-06-01 11:14:54 -070010TPM_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 Bendebury025269a2015-06-01 12:15:52 -070016BOOL 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 Bendeburyf0a510e2015-06-01 12:11:58 -070024BOOL 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 Bendeburybbd79002015-05-31 14:44:07 -070031TPMI_YES_NO PCRCapGetAllocation(
32 UINT32 count, // IN: count of return
33 TPML_PCR_SELECTION *pcrSelection // OUT: PCR allocation list
34);
Vadim Bendebury8836bc12015-06-01 12:04:13 -070035void PCRChanged(
36 TPM_HANDLE pcrHandle // IN: the handle of the PCR that changed.
37 );
Vadim Bendeburyfe7bde42015-06-01 10:55:46 -070038void 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 Bendebury889ec832015-05-26 17:11:06 -070044TPMI_ALG_HASH PCRGetAuthPolicy(
45 TPMI_DH_PCR handle, // IN: PCR handle
46 TPM2B_DIGEST *policy // OUT: policy of PCR
47 );
Vadim Bendeburybbd79002015-05-31 14:44:07 -070048TPMI_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);
53TPMI_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 Bendebury889ec832015-05-26 17:11:06 -070058void PCRGetAuthValue(
59 TPMI_DH_PCR handle, // IN: PCR handle
60 TPM2B_AUTH *auth // OUT: authValue of PCR
61 );
Vadim Bendeburyb0d692f2015-05-29 22:54:52 -070062void 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 Bendebury2a791af2015-06-01 19:17:51 -070068void PCRResetDynamics(
69 void
70 );
71void 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 Bendebury2e00b3e2015-06-01 19:17:12 -070077BOOL PcrIsAllocated (
78 UINT32 pcr, // IN: The number of the PCR
79 TPMI_ALG_HASH hashAlg // IN: The PCR algorithm
80);
Vadim Bendeburyb0d692f2015-05-29 22:54:52 -070081BOOL PCRIsExtendAllowed(
82 TPMI_DH_PCR handle // IN: PCR handle to be extended
83 );
Vadim Bendebury8836bc12015-06-01 12:04:13 -070084BOOL PCRIsResetAllowed(
85 TPMI_DH_PCR handle // IN: PCR handle to be extended
86 );
Vadim Bendeburyb0d692f2015-05-29 22:54:52 -070087BOOL PCRIsStateSaved(
88 TPMI_DH_PCR handle // IN: PCR handle to be extended
89 );
Vadim Bendebury3d5312a2015-06-01 18:19:06 -070090BOOL PCRPolicyIsAvailable(
91 TPMI_DH_PCR handle // IN: PCR handle
92 );
Vadim Bendebury3a6b9cb2015-06-01 12:02:26 -070093void 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 Bendebury8836bc12015-06-01 12:04:13 -0700100void PCRSetValue(
101 TPM_HANDLE handle, // IN: the handle of the PCR to set
102 INT8 initialValue // IN: the value to set
103 );
Vadim Bendebury62f9d012015-05-31 15:54:32 -0700104void PCRSimStart(
105 void
106 );
Vadim Bendebury523b0eb2015-06-01 18:53:59 -0700107void PCRStartup(
108 STARTUP_TYPE type, // IN: startup type
109 BYTE locality // IN: startup locality
110 );
Vadim Bendeburyf4653182015-06-01 18:35:25 -0700111void PCRStateSave(
112 TPM_SU type // IN: startup type
113 );
Vadim Bendebury889ec832015-05-26 17:11:06 -0700114
115#endif // __TPM2_PCR_FP_H