1use crate::tpm_bitflags;
5
6tpm_bitflags! {
7 #[derive(Debug, Default, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
9 pub struct TpmaAlgorithm(u32) {
10 const ASYMMETRIC = 0x0000_0001, "ASYMMETRIC";
11 const SYMMETRIC = 0x0000_0002, "SYMMETRIC";
12 const HASH = 0x0000_0004, "HASH";
13 const OBJECT = 0x0000_0008, "OBJECT";
14 const SIGNING = 0x0000_0100, "SIGNING";
15 const ENCRYPTING = 0x0000_0200, "ENCRYPTING";
16 const METHOD = 0x0000_0400, "METHOD";
17 }
18}
19
20tpm_bitflags! {
21 #[derive(Debug, Default, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
23 pub struct TpmaCc(u32) {
24 const COMMAND_INDEX = 0x0000_FFFF, "COMMAND_INDEX";
25 const NV = 0x0040_0000, "NV";
26 const EXTENSIVE = 0x0080_0000, "EXTENSIVE";
27 const FLUSHED = 0x0100_0000, "FLUSHED";
28 const C_HANDLES = 0x0E00_0000, "C_HANDLES";
29 const R_HANDLE = 0x1000_0000, "R_HANDLE";
30 const V = 0x2000_0000, "V";
31 }
32}
33
34tpm_bitflags! {
35 #[derive(Debug, Default, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
37 pub struct TpmaLocality(u8) {
38 const TPM_LOC_ZERO = 0x01, "LOC_ZERO";
39 const TPM_LOC_ONE = 0x02, "LOC_ONE";
40 const TPM_LOC_TWO = 0x04, "LOC_TWO";
41 const TPM_LOC_THREE = 0x08, "LOC_THREE";
42 const TPM_LOC_FOUR = 0x10, "LOC_FOUR";
43 const EXTENDED = 0xE0, "EXTENDED";
44 }
45}
46
47tpm_bitflags! {
48 #[derive(Debug, Default, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
50 pub struct TpmaNv(u32) {
51 const PPWRITE = 0x0000_0001, "PPWRITE";
52 const OWNERWRITE = 0x0000_0002, "OWNERWRITE";
53 const AUTHWRITE = 0x0000_0004, "AUTHWRITE";
54 const POLICYWRITE = 0x0000_0008, "POLICYWRITE";
55 const TPM_NT_COUNTER = 0x0000_0010, "COUNTER";
56 const TPM_NT_BITS = 0x0000_0020, "BITS";
57 const TPM_NT_EXTEND = 0x0000_0040, "EXTEND";
58 const POLICY_DELETE = 0x0000_0400, "POLICY_DELETE";
59 const WRITELOCKED = 0x0000_0800, "WRITELOCKED";
60 const WRITEALL = 0x0000_1000, "WRITEALL";
61 const WRITEDEFINE = 0x0000_2000, "WRITEDEFINE";
62 const WRITE_STCLEAR = 0x0000_4000, "WRITE_STCLEAR";
63 const GLOBALLOCK = 0x0000_8000, "GLOBALLOCK";
64 const PPREAD = 0x0001_0000, "PPREAD";
65 const OWNERREAD = 0x0002_0000, "OWNERREAD";
66 const AUTHREAD = 0x0004_0000, "AUTHREAD";
67 const POLICYREAD = 0x0008_0000, "POLICYREAD";
68 const NO_DA = 0x0200_0000, "NO_DA";
69 const ORDERLY = 0x0400_0000, "ORDERLY";
70 const CLEAR_STCLEAR = 0x0800_0000, "CLEAR_STCLEAR";
71 const READLOCKED = 0x1000_0000, "READLOCKED";
72 const WRITTEN = 0x2000_0000, "WRITTEN";
73 const PLATFORMCREATE = 0x4000_0000, "PLATFORMCREATE";
74 const READ_STCLEAR = 0x8000_0000, "READ_STCLEAR";
75 }
76}
77
78tpm_bitflags! {
79 #[derive(Debug, Default, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
81 pub struct TpmaNvExp(u64) {
82 const ENCRYPTION = 0x0000_0001_0000_0000, "ENCRYPTION";
83 const INTEGRITY = 0x0000_0002_0000_0000, "INTEGRITY";
84 const ANTIROLLBACK = 0x0000_0004_0000_0000, "ANTIROLLBACK";
85 }
86}
87
88tpm_bitflags! {
89 #[derive(Debug, Default, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
91 pub struct TpmaObject(u32) {
92 const FIXED_TPM = 0x0000_0002, "FIXED_TPM";
93 const ST_CLEAR = 0x0000_0004, "ST_CLEAR";
94 const FIXED_PARENT = 0x0000_0010, "FIXED_PARENT";
95 const SENSITIVE_DATA_ORIGIN = 0x0000_0020, "SENSITIVE_DATA_ORIGIN";
96 const USER_WITH_AUTH = 0x0000_0040, "USER_WITH_AUTH";
97 const ADMIN_WITH_POLICY = 0x0000_0080, "ADMIN_WITH_POLICY";
98 const NO_DA = 0x0000_0400, "NO_DA";
99 const ENCRYPTED_DUPLICATION = 0x0000_0800, "ENCRYPTED_DUPLICATION";
100 const RESTRICTED = 0x0001_0000, "RESTRICTED";
101 const DECRYPT = 0x0002_0000, "DECRYPT";
102 const SIGN_ENCRYPT = 0x0004_0000, "SIGN_ENCRYPT";
103 }
104}
105
106tpm_bitflags! {
107 #[derive(Debug, Default, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
109 pub struct TpmaSession(u8) {
110 const CONTINUE_SESSION = 0x01, "CONTINUE_SESSION";
111 const AUDIT_EXCLUSIVE = 0x02, "AUDIT_EXCLUSIVE";
112 const AUDIT_RESET = 0x04, "AUDIT_RESET";
113 const DECRYPT = 0x20, "DECRYPT";
114 const ENCRYPT = 0x40, "ENCRYPT";
115 const AUDIT = 0x80, "AUDIT";
116 }
117}