1 //
2 // Copyright (C) 2015 The Android Open Source Project
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 //      http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #ifndef TRUNKS_TPM_CONSTANTS_H_
18 #define TRUNKS_TPM_CONSTANTS_H_
19 
20 #include "trunks/tpm_generated.h"
21 
22 namespace trunks {
23 
24 // TPM Object Attributes.
25 const TPMA_OBJECT kFixedTPM = 1U << 1;
26 const TPMA_OBJECT kFixedParent = 1U << 4;
27 const TPMA_OBJECT kSensitiveDataOrigin = 1U << 5;
28 const TPMA_OBJECT kUserWithAuth = 1U << 6;
29 const TPMA_OBJECT kAdminWithPolicy = 1U << 7;
30 const TPMA_OBJECT kNoDA = 1U << 10;
31 const TPMA_OBJECT kRestricted = 1U << 16;
32 const TPMA_OBJECT kDecrypt = 1U << 17;
33 const TPMA_OBJECT kSign = 1U << 18;
34 
35 // TPM NV Index Attributes, defined in TPM Spec Part 2 section 13.2.
36 const TPMA_NV TPMA_NV_OWNERWRITE = 1U << 1;
37 const TPMA_NV TPMA_NV_WRITELOCKED = 1U << 11;
38 const TPMA_NV TPMA_NV_WRITEDEFINE = 1U << 13;
39 const TPMA_NV TPMA_NV_AUTHREAD = 1U << 18;
40 const TPMA_NV TPMA_NV_NO_DA = 1U << 25;
41 const TPMA_NV TPMA_NV_WRITTEN = 1U << 29;
42 
43 }  // namespace trunks
44 
45 #endif  // TRUNKS_TPM_CONSTANTS_H_
46