tpm2_protocol/frame/
data.rs

1// SPDX-License-Identifier: MIT OR Apache-2.0
2// Copyright (c) 2025 Opinsys Oy
3// Copyright (c) 2024-2025 Jarkko Sakkinen
4
5use crate::{
6    data::{
7        Tpm2bAttest, Tpm2bAuth, Tpm2bCreationData, Tpm2bData, Tpm2bDigest, Tpm2bEccParameter,
8        Tpm2bEccPoint, Tpm2bEncryptedSecret, Tpm2bEvent, Tpm2bIdObject, Tpm2bIv, Tpm2bMaxBuffer,
9        Tpm2bMaxNvBuffer, Tpm2bName, Tpm2bNonce, Tpm2bNvPublic, Tpm2bPrivate, Tpm2bPublic,
10        Tpm2bPublicKeyRsa, Tpm2bSensitive, Tpm2bSensitiveCreate, Tpm2bSensitiveData, Tpm2bTemplate,
11        Tpm2bTimeout, TpmAlgId, TpmAt, TpmCap, TpmCc, TpmClockAdjust, TpmEccCurve, TpmEo, TpmRh,
12        TpmSe, TpmSu, TpmaLocality, TpmiAlgCipherMode, TpmiAlgHash, TpmiEccKeyExchange, TpmiYesNo,
13        TpmlAcCapabilities, TpmlAlg, TpmlCc, TpmlDigest, TpmlDigestValues, TpmlPcrSelection,
14        TpmsAcOutput, TpmsAlgorithmDetailEcc, TpmsCapabilityData, TpmsContext, TpmsTimeInfo,
15        TpmtHa, TpmtKdfScheme, TpmtPublicParms, TpmtRsaDecrypt, TpmtSignature, TpmtSymDef,
16        TpmtSymDefObject, TpmtTkAuth, TpmtTkCreation, TpmtTkHashcheck, TpmtTkVerified,
17    },
18    frame::TpmHeader,
19    tpm_struct, TpmHandle,
20};
21use core::fmt::Debug;
22
23tpm_struct! {
24    #[derive(Debug, PartialEq, Eq, Clone)]
25    kind: Command,
26    name: TpmAcGetCapabilityCommand,
27    cc: TpmCc::AcGetCapability,
28    handles: 1,
29    parameters: {
30        pub capability: TpmAt,
31        pub count: u32,
32    }
33}
34
35tpm_struct! {
36    #[derive(Debug, PartialEq, Eq, Clone)]
37    kind: Response,
38    name: TpmAcGetCapabilityResponse,
39    cc: TpmCc::AcGetCapability,
40    handles: 0,
41    parameters: {
42        pub more_data: TpmiYesNo,
43        pub capabilities_data: TpmlAcCapabilities,
44    }
45}
46
47tpm_struct! {
48    #[derive(Debug, PartialEq, Eq, Clone)]
49    kind: Command,
50    name: TpmAcSendCommand,
51    cc: TpmCc::AcSend,
52    handles: 3,
53    parameters: {
54        pub ac_data_in: Tpm2bMaxBuffer,
55    }
56}
57
58tpm_struct! {
59    #[derive(Debug, PartialEq, Eq, Clone)]
60    kind: Response,
61    name: TpmAcSendResponse,
62    cc: TpmCc::AcSend,
63    handles: 0,
64    parameters: {
65        pub ac_data_out: TpmsAcOutput,
66    }
67}
68
69tpm_struct! {
70    #[derive(Debug, PartialEq, Eq, Clone)]
71    kind: Command,
72    name: TpmActivateCredentialCommand,
73    cc: TpmCc::ActivateCredential,
74    handles: 2,
75    parameters: {
76        pub credential_blob: Tpm2bIdObject,
77        pub secret: Tpm2bEncryptedSecret,
78    }
79}
80
81tpm_struct! {
82    #[derive(Debug, PartialEq, Eq, Clone)]
83    kind: Response,
84    name: TpmActivateCredentialResponse,
85    cc: TpmCc::ActivateCredential,
86    handles: 0,
87    parameters: {
88        pub cert_info: Tpm2bDigest,
89    }
90}
91
92tpm_struct! {
93    #[derive(Debug, PartialEq, Eq, Copy, Clone)]
94    kind: Command,
95    name: TpmActSetTimeoutCommand,
96    cc: TpmCc::ActSetTimeout,
97    handles: 1,
98    parameters: {
99        pub start_timeout: u32,
100    }
101}
102
103tpm_struct! {
104    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
105    kind: Response,
106    name: TpmActSetTimeoutResponse,
107    cc: TpmCc::ActSetTimeout,
108    handles: 0,
109    parameters: {}
110}
111
112tpm_struct! {
113    #[derive(Debug, PartialEq, Eq, Clone, Copy)]
114    kind: Command,
115    name: TpmChangeEpsCommand,
116    cc: TpmCc::ChangeEps,
117    handles: 1,
118    parameters: {}
119}
120
121tpm_struct! {
122    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
123    kind: Response,
124    name: TpmChangeEpsResponse,
125    cc: TpmCc::ChangeEps,
126    handles: 0,
127    parameters: {}
128}
129
130tpm_struct! {
131    #[derive(Debug, PartialEq, Eq, Clone, Copy)]
132    kind: Command,
133    name: TpmChangePpsCommand,
134    cc: TpmCc::ChangePps,
135    handles: 1,
136    parameters: {}
137}
138
139tpm_struct! {
140    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
141    kind: Response,
142    name: TpmChangePpsResponse,
143    cc: TpmCc::ChangePps,
144    handles: 0,
145    parameters: {}
146}
147
148tpm_struct! {
149    #[derive(Debug, PartialEq, Eq, Clone)]
150    kind: Command,
151    name: TpmCertifyCommand,
152    cc: TpmCc::Certify,
153    handles: 2,
154    parameters: {
155        pub qualifying_data: Tpm2bData,
156        pub in_scheme: TpmtSignature,
157    }
158}
159
160tpm_struct! {
161    #[derive(Debug, PartialEq, Eq, Clone)]
162    kind: Response,
163    name: TpmCertifyResponse,
164    cc: TpmCc::Certify,
165    handles: 0,
166    parameters: {
167        pub certify_info: Tpm2bAttest,
168        pub signature: TpmtSignature,
169    }
170}
171
172tpm_struct! {
173    #[derive(Debug, PartialEq, Eq, Clone)]
174    kind: Command,
175    name: TpmCertifyCreationCommand,
176    cc: TpmCc::CertifyCreation,
177    handles: 2,
178    parameters: {
179        pub qualifying_data: Tpm2bData,
180        pub creation_hash: Tpm2bDigest,
181        pub in_scheme: TpmtSignature,
182        pub creation_ticket: TpmtTkCreation,
183    }
184}
185
186tpm_struct! {
187    #[derive(Debug, PartialEq, Eq, Clone)]
188    kind: Response,
189    name: TpmCertifyCreationResponse,
190    cc: TpmCc::CertifyCreation,
191    handles: 0,
192    parameters: {
193        pub certify_info: Tpm2bAttest,
194        pub signature: TpmtSignature,
195    }
196}
197
198tpm_struct! {
199    #[derive(Debug, PartialEq, Eq, Clone, Copy)]
200    kind: Command,
201    name: TpmClearCommand,
202    cc: TpmCc::Clear,
203    handles: 1,
204    parameters: {}
205}
206
207tpm_struct! {
208    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
209    kind: Response,
210    name: TpmClearResponse,
211    cc: TpmCc::Clear,
212    handles: 0,
213    parameters: {}
214}
215
216tpm_struct! {
217    #[derive(Debug, PartialEq, Eq, Clone, Copy)]
218    kind: Command,
219    name: TpmClearControlCommand,
220    cc: TpmCc::ClearControl,
221    handles: 1,
222    parameters: {
223        pub disable: TpmiYesNo,
224    }
225}
226
227tpm_struct! {
228    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
229    kind: Response,
230    name: TpmClearControlResponse,
231    cc: TpmCc::ClearControl,
232    handles: 0,
233    parameters: {}
234}
235
236tpm_struct! {
237    #[derive(Debug, PartialEq, Eq, Clone, Copy)]
238    kind: Command,
239    name: TpmClockRateAdjustCommand,
240    cc: TpmCc::ClockRateAdjust,
241    handles: 1,
242    parameters: {
243        pub rate_adjust: TpmClockAdjust,
244    }
245}
246
247tpm_struct! {
248    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
249    kind: Response,
250    name: TpmClockRateAdjustResponse,
251    cc: TpmCc::ClockRateAdjust,
252    handles: 0,
253    parameters: {}
254}
255
256tpm_struct! {
257    #[derive(Debug, PartialEq, Eq, Copy, Clone)]
258    kind: Command,
259    name: TpmClockSetCommand,
260    cc: TpmCc::ClockSet,
261    handles: 1,
262    parameters: {
263        pub new_time: u64,
264    }
265}
266
267tpm_struct! {
268    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
269    kind: Response,
270    name: TpmClockSetResponse,
271    cc: TpmCc::ClockSet,
272    handles: 0,
273    parameters: {}
274}
275
276tpm_struct! {
277    #[derive(Debug, PartialEq, Eq, Clone, Copy)]
278    kind: Command,
279    name: TpmCommitCommand,
280    cc: TpmCc::Commit,
281    handles: 1,
282    parameters: {
283        pub p1: Tpm2bEccPoint,
284        pub s2: Tpm2bSensitiveData,
285        pub y2: Tpm2bEccParameter,
286    }
287}
288
289tpm_struct! {
290    #[derive(Debug, PartialEq, Eq, Clone, Copy)]
291    kind: Response,
292    name: TpmCommitResponse,
293    cc: TpmCc::Commit,
294    handles: 0,
295    parameters: {
296        pub k: Tpm2bEccPoint,
297        pub l: Tpm2bEccPoint,
298        pub e: Tpm2bEccPoint,
299        pub counter: u16,
300    }
301}
302
303tpm_struct! {
304    #[derive(Debug, PartialEq, Eq, Clone)]
305    kind: Command,
306    name: TpmContextLoadCommand,
307    cc: TpmCc::ContextLoad,
308    handles: 0,
309    parameters: {
310        pub context: TpmsContext,
311    }
312}
313
314tpm_struct! {
315    #[derive(Debug, PartialEq, Eq, Clone)]
316    kind: Response,
317    name: TpmContextLoadResponse,
318    cc: TpmCc::ContextLoad,
319    handles: 1,
320    parameters: {}
321}
322
323tpm_struct! {
324    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
325    kind: Command,
326    name: TpmContextSaveCommand,
327    cc: TpmCc::ContextSave,
328    handles: 1,
329    parameters: {}
330}
331
332tpm_struct! {
333    #[derive(Debug, PartialEq, Eq, Clone)]
334    kind: Response,
335    name: TpmContextSaveResponse,
336    cc: TpmCc::ContextSave,
337    handles: 0,
338    parameters: {
339        pub context: TpmsContext,
340    }
341}
342
343tpm_struct! {
344    #[derive(Debug, PartialEq, Eq, Clone)]
345    kind: Command,
346    name: TpmCreateCommand,
347    cc: TpmCc::Create,
348    handles: 1,
349    parameters: {
350        pub in_sensitive: Tpm2bSensitiveCreate,
351        pub in_public: Tpm2bPublic,
352        pub outside_info: Tpm2bData,
353        pub creation_pcr: TpmlPcrSelection,
354    }
355}
356
357tpm_struct! {
358    #[derive(Debug, PartialEq, Eq, Clone)]
359    kind: Response,
360    name: TpmCreateResponse,
361    cc: TpmCc::Create,
362    handles: 0,
363    parameters: {
364        pub out_private: Tpm2bPrivate,
365        pub out_public: Tpm2bPublic,
366        pub creation_data: Tpm2bCreationData,
367        pub creation_hash: Tpm2bDigest,
368        pub creation_ticket: TpmtTkCreation,
369    }
370}
371
372tpm_struct! {
373    #[derive(Debug, PartialEq, Eq, Clone)]
374    kind: Command,
375    name: TpmCreateLoadedCommand,
376    cc: TpmCc::CreateLoaded,
377    handles: 1,
378    parameters: {
379        pub in_sensitive: Tpm2bSensitiveCreate,
380        pub in_public: Tpm2bTemplate,
381    }
382}
383
384tpm_struct! {
385    #[derive(Debug, PartialEq, Eq, Clone)]
386    kind: Response,
387    name: TpmCreateLoadedResponse,
388    cc: TpmCc::CreateLoaded,
389    handles: 1,
390    parameters: {
391        pub out_private: Tpm2bPrivate,
392        pub out_public: Tpm2bPublic,
393        pub name: Tpm2bName,
394    }
395}
396
397tpm_struct! {
398    #[derive(Debug, Default, PartialEq, Eq, Clone)]
399    kind: Command,
400    name: TpmCreatePrimaryCommand,
401    cc: TpmCc::CreatePrimary,
402    handles: 1,
403    parameters: {
404        pub in_sensitive: Tpm2bSensitiveCreate,
405        pub in_public: Tpm2bPublic,
406        pub outside_info: Tpm2bData,
407        pub creation_pcr: TpmlPcrSelection,
408    }
409}
410
411tpm_struct! {
412    #[derive(Debug, PartialEq, Eq, Clone)]
413    kind: Response,
414    name: TpmCreatePrimaryResponse,
415    cc: TpmCc::CreatePrimary,
416    handles: 1,
417    parameters: {
418        pub out_public: Tpm2bPublic,
419        pub creation_data: Tpm2bCreationData,
420        pub creation_hash: Tpm2bDigest,
421        pub creation_ticket: TpmtTkCreation,
422        pub name: Tpm2bName,
423    }
424}
425
426tpm_struct! {
427    #[derive(Debug, PartialEq, Eq, Copy, Clone)]
428    kind: Command,
429    name: TpmDictionaryAttackLockResetCommand,
430    cc: TpmCc::DictionaryAttackLockReset,
431    handles: 1,
432    parameters: {}
433}
434
435tpm_struct! {
436    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
437    kind: Response,
438    name: TpmDictionaryAttackLockResetResponse,
439    cc: TpmCc::DictionaryAttackLockReset,
440    handles: 0,
441    parameters: {}
442}
443
444tpm_struct! {
445    #[derive(Debug, PartialEq, Eq, Clone, Copy)]
446    kind: Command,
447    name: TpmDictionaryAttackParametersCommand,
448    cc: TpmCc::DictionaryAttackParameters,
449    handles: 1,
450    parameters: {
451        pub new_max_tries: u32,
452        pub new_recovery_time: u32,
453        pub lockout_recovery: u32,
454    }
455}
456
457tpm_struct! {
458    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
459    kind: Response,
460    name: TpmDictionaryAttackParametersResponse,
461    cc: TpmCc::DictionaryAttackParameters,
462    handles: 0,
463    parameters: {}
464}
465
466tpm_struct! {
467    #[derive(Debug, PartialEq, Eq, Clone)]
468    kind: Command,
469    name: TpmDuplicateCommand,
470    cc: TpmCc::Duplicate,
471    handles: 2,
472    parameters: {
473        pub encryption_key_in: Tpm2bData,
474        pub symmetric_alg: TpmtSymDefObject,
475    }
476}
477
478tpm_struct! {
479    #[derive(Debug, PartialEq, Eq, Clone)]
480    kind: Response,
481    name: TpmDuplicateResponse,
482    cc: TpmCc::Duplicate,
483    handles: 0,
484    parameters: {
485        pub encryption_key_out: Tpm2bData,
486        pub duplicate: Tpm2bPrivate,
487        pub out_sym_seed: Tpm2bEncryptedSecret,
488    }
489}
490
491tpm_struct! {
492    #[derive(Debug, PartialEq, Eq, Clone, Copy)]
493    kind: Command,
494    name: TpmEccDecryptCommand,
495    cc: TpmCc::EccDecrypt,
496    handles: 1,
497    parameters: {
498        pub c1: Tpm2bEccPoint,
499        pub c2: crate::data::Tpm2bMaxBuffer,
500        pub c3: crate::data::Tpm2bDigest,
501        pub in_scheme: TpmtKdfScheme,
502    }
503}
504
505tpm_struct! {
506    #[derive(Debug, PartialEq, Eq, Clone)]
507    kind: Response,
508    name: TpmEccDecryptResponse,
509    cc: TpmCc::EccDecrypt,
510    handles: 0,
511    parameters: {
512        pub plaintext: crate::data::Tpm2bMaxBuffer,
513    }
514}
515
516tpm_struct! {
517    #[derive(Debug, PartialEq, Eq, Clone, Copy)]
518    kind: Command,
519    name: TpmEcEphemeralCommand,
520    cc: TpmCc::EcEphemeral,
521    handles: 0,
522    parameters: {
523        pub curve_id: TpmEccCurve,
524    }
525}
526
527tpm_struct! {
528    #[derive(Debug, PartialEq, Eq, Clone, Copy)]
529    kind: Response,
530    name: TpmEcEphemeralResponse,
531    cc: TpmCc::EcEphemeral,
532    handles: 0,
533    parameters: {
534        pub q: Tpm2bEccPoint,
535        pub counter: u16,
536    }
537}
538
539tpm_struct! {
540    #[derive(Debug, PartialEq, Eq, Clone)]
541    kind: Command,
542    name: TpmEccEncryptCommand,
543    cc: TpmCc::EccEncrypt,
544    handles: 1,
545    parameters: {
546        pub plaintext: Tpm2bMaxBuffer,
547        pub in_scheme: TpmtKdfScheme,
548    }
549}
550
551tpm_struct! {
552    #[derive(Debug, PartialEq, Eq, Clone)]
553    kind: Response,
554    name: TpmEccEncryptResponse,
555    cc: TpmCc::EccEncrypt,
556    handles: 0,
557    parameters: {
558        pub c1: Tpm2bEccPoint,
559        pub c2: crate::data::Tpm2bMaxBuffer,
560        pub c3: crate::data::Tpm2bDigest,
561    }
562}
563
564tpm_struct! {
565    #[derive(Debug, PartialEq, Eq, Copy, Clone)]
566    kind: Command,
567    name: TpmEccParametersCommand,
568    cc: TpmCc::EccParameters,
569    handles: 0,
570    parameters: {
571        pub curve_id: TpmEccCurve,
572    }
573}
574
575tpm_struct! {
576    #[derive(Debug, PartialEq, Eq, Clone)]
577    kind: Response,
578    name: TpmEccParametersResponse,
579    cc: TpmCc::EccParameters,
580    handles: 0,
581    parameters: {
582        pub parameters: TpmsAlgorithmDetailEcc,
583    }
584}
585
586tpm_struct! {
587    #[derive(Debug, PartialEq, Eq, Copy, Clone)]
588    kind: Command,
589    name: TpmEcdhKeyGenCommand,
590    cc: TpmCc::EcdhKeyGen,
591    handles: 1,
592    parameters: {}
593}
594
595tpm_struct! {
596    #[derive(Debug, PartialEq, Eq, Clone)]
597    kind: Response,
598    name: TpmEcdhKeyGenResponse,
599    cc: TpmCc::EcdhKeyGen,
600    handles: 0,
601    parameters: {
602        pub z_point: Tpm2bEccPoint,
603        pub pub_point: Tpm2bEccPoint,
604    }
605}
606
607tpm_struct! {
608    #[derive(Debug, PartialEq, Eq, Clone, Copy)]
609    kind: Command,
610    name: TpmEcdhZGenCommand,
611    cc: TpmCc::EcdhZGen,
612    handles: 1,
613    parameters: {
614        pub in_point: Tpm2bEccPoint,
615    }
616}
617
618tpm_struct! {
619    #[derive(Debug, PartialEq, Eq, Clone)]
620    kind: Response,
621    name: TpmEcdhZGenResponse,
622    cc: TpmCc::EcdhZGen,
623    handles: 0,
624    parameters: {
625        pub out_point: Tpm2bEccPoint,
626    }
627}
628
629tpm_struct! {
630    #[derive(Debug, PartialEq, Eq, Clone)]
631    kind: Command,
632    name: TpmEncryptDecryptCommand,
633    cc: TpmCc::EncryptDecrypt,
634    handles: 1,
635    parameters: {
636        pub decrypt: TpmiYesNo,
637        pub mode: TpmiAlgCipherMode,
638        pub iv_in: Tpm2bIv,
639        pub in_data: Tpm2bMaxBuffer,
640    }
641}
642
643tpm_struct! {
644    #[derive(Debug, PartialEq, Eq, Clone)]
645    kind: Response,
646    name: TpmEncryptDecryptResponse,
647    cc: TpmCc::EncryptDecrypt,
648    handles: 0,
649    parameters: {
650        pub out_data: Tpm2bMaxBuffer,
651        pub iv_out: Tpm2bIv,
652    }
653}
654
655tpm_struct! {
656    #[derive(Debug, PartialEq, Eq, Clone)]
657    kind: Command,
658    name: TpmEncryptDecrypt2Command,
659    cc: TpmCc::EncryptDecrypt2,
660    handles: 1,
661    parameters: {
662        pub in_data: Tpm2bMaxBuffer,
663        pub decrypt: TpmiYesNo,
664        pub mode: TpmAlgId,
665        pub iv_in: Tpm2bIv,
666    }
667}
668
669tpm_struct! {
670    #[derive(Debug, PartialEq, Eq, Clone)]
671    kind: Response,
672    name: TpmEncryptDecrypt2Response,
673    cc: TpmCc::EncryptDecrypt2,
674    handles: 0,
675    parameters: {
676        pub out_data: Tpm2bMaxBuffer,
677        pub iv_out: Tpm2bIv,
678    }
679}
680
681tpm_struct! {
682    #[derive(Debug, PartialEq, Eq, Clone)]
683    kind: Command,
684    name: TpmEventSequenceCompleteCommand,
685    cc: TpmCc::EventSequenceComplete,
686    handles: 2,
687    parameters: {
688        pub buffer: Tpm2bMaxBuffer,
689    }
690}
691
692tpm_struct! {
693    #[derive(Debug, Default, PartialEq, Eq, Clone)]
694    kind: Response,
695    name: TpmEventSequenceCompleteResponse,
696    cc: TpmCc::EventSequenceComplete,
697    handles: 0,
698    parameters: {
699        pub results: TpmlDigestValues,
700    }
701}
702
703tpm_struct! {
704    #[derive(Debug, PartialEq, Eq, Clone)]
705    kind: Command,
706    name: TpmEvictControlCommand,
707    cc: TpmCc::EvictControl,
708    handles: 2,
709    parameters: {
710        pub persistent_handle: TpmHandle,
711    }
712}
713
714tpm_struct! {
715    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
716    kind: Response,
717    name: TpmEvictControlResponse,
718    cc: TpmCc::EvictControl,
719    handles: 0,
720    parameters: {}
721}
722
723tpm_struct! {
724    #[derive(Debug, PartialEq, Eq, Clone)]
725    kind: Command,
726    name: TpmFieldUpgradeDataCommand,
727    cc: TpmCc::FieldUpgradeData,
728    handles: 0,
729    parameters: {
730        pub fu_data: crate::data::Tpm2bMaxBuffer,
731    }
732}
733
734tpm_struct! {
735    #[derive(Debug, PartialEq, Eq, Clone)]
736    kind: Response,
737    name: TpmFieldUpgradeDataResponse,
738    cc: TpmCc::FieldUpgradeData,
739    handles: 0,
740    parameters: {
741        pub next_digest: TpmtHa,
742        pub first_digest: TpmtHa,
743    }
744}
745
746tpm_struct! {
747    #[derive(Debug, PartialEq, Eq, Clone)]
748    kind: Command,
749    name: TpmFieldUpgradeStartCommand,
750    cc: TpmCc::FieldUpgradeStart,
751    handles: 2,
752    parameters: {
753        pub fu_digest: Tpm2bDigest,
754        pub manifest_signature: TpmtSignature,
755    }
756}
757
758tpm_struct! {
759    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
760    kind: Response,
761    name: TpmFieldUpgradeStartResponse,
762    cc: TpmCc::FieldUpgradeStart,
763    handles: 0,
764    parameters: {}
765}
766
767tpm_struct! {
768    #[derive(Debug, PartialEq, Eq, Clone, Copy)]
769    kind: Command,
770    name: TpmFirmwareReadCommand,
771    cc: TpmCc::FirmwareRead,
772    handles: 0,
773    parameters: {
774        pub sequence_number: u32,
775    }
776}
777
778tpm_struct! {
779    #[derive(Debug, PartialEq, Eq, Clone)]
780    kind: Response,
781    name: TpmFirmwareReadResponse,
782    cc: TpmCc::FirmwareRead,
783    handles: 0,
784    parameters: {
785        pub fu_data: crate::data::Tpm2bMaxBuffer,
786    }
787}
788
789tpm_struct! {
790    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
791    kind: Command,
792    name: TpmFlushContextCommand,
793    cc: TpmCc::FlushContext,
794    handles: 1,
795    parameters: {}
796}
797
798tpm_struct! {
799    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
800    kind: Response,
801    name: TpmFlushContextResponse,
802    cc: TpmCc::FlushContext,
803    handles: 0,
804    parameters: {}
805}
806
807tpm_struct! {
808    #[derive(Debug, PartialEq, Eq, Clone)]
809    kind: Command,
810    name: TpmGetCapabilityCommand,
811    cc: TpmCc::GetCapability,
812    handles: 0,
813    parameters: {
814        pub cap: TpmCap,
815        pub property: u32,
816        pub property_count: u32,
817    }
818}
819
820tpm_struct! {
821    #[derive(Debug, PartialEq, Eq, Clone)]
822    kind: Response,
823    name: TpmGetCapabilityResponse,
824    cc: TpmCc::GetCapability,
825    handles: 0,
826    parameters: {
827        pub more_data: TpmiYesNo,
828        pub capability_data: TpmsCapabilityData,
829    }
830}
831
832tpm_struct! {
833    #[derive(Debug, PartialEq, Eq, Clone)]
834    kind: Command,
835    name: TpmGetCommandAuditDigestCommand,
836    cc: TpmCc::GetCommandAuditDigest,
837    handles: 2,
838    parameters: {
839        pub qualifying_data: Tpm2bData,
840        pub in_scheme: TpmtSignature,
841    }
842}
843
844tpm_struct! {
845    #[derive(Debug, PartialEq, Eq, Clone)]
846    kind: Response,
847    name: TpmGetCommandAuditDigestResponse,
848    cc: TpmCc::GetCommandAuditDigest,
849    handles: 0,
850    parameters: {
851        pub audit_info: Tpm2bAttest,
852        pub signature: TpmtSignature,
853    }
854}
855
856tpm_struct! {
857    #[derive(Debug, PartialEq, Eq, Copy, Clone)]
858    kind: Command,
859    name: TpmGetRandomCommand,
860    cc: TpmCc::GetRandom,
861    handles: 0,
862    parameters: {
863        pub bytes_requested: u16,
864    }
865}
866
867tpm_struct! {
868    #[derive(Debug, Default, PartialEq, Eq, Clone)]
869    kind: Response,
870    name: TpmGetRandomResponse,
871    cc: TpmCc::GetRandom,
872    handles: 0,
873    parameters: {
874        pub random_bytes: Tpm2bDigest,
875    }
876}
877
878tpm_struct! {
879    #[derive(Debug, PartialEq, Eq, Clone)]
880    kind: Command,
881    name: TpmGetSessionAuditDigestCommand,
882    cc: TpmCc::GetSessionAuditDigest,
883    handles: 3,
884    parameters: {
885        pub qualifying_data: Tpm2bData,
886        pub in_scheme: TpmtSignature,
887    }
888}
889
890tpm_struct! {
891    #[derive(Debug, PartialEq, Eq, Clone)]
892    kind: Response,
893    name: TpmGetSessionAuditDigestResponse,
894    cc: TpmCc::GetSessionAuditDigest,
895    handles: 0,
896    parameters: {
897        pub audit_info: Tpm2bAttest,
898        pub signature: TpmtSignature,
899    }
900}
901
902tpm_struct! {
903    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
904    kind: Command,
905    name: TpmGetTestResultCommand,
906    cc: TpmCc::GetTestResult,
907    handles: 0,
908    parameters: {}
909}
910
911tpm_struct! {
912    #[derive(Debug, PartialEq, Eq, Clone)]
913    kind: Response,
914    name: TpmGetTestResultResponse,
915    cc: TpmCc::GetTestResult,
916    handles: 0,
917    parameters: {
918        pub out_data: Tpm2bMaxBuffer,
919        pub test_result: crate::data::TpmRc,
920    }
921}
922
923tpm_struct! {
924    #[derive(Debug, PartialEq, Eq, Clone)]
925    kind: Command,
926    name: TpmGetTimeCommand,
927    cc: TpmCc::GetTime,
928    handles: 2,
929    parameters: {
930        pub qualifying_data: Tpm2bData,
931        pub in_scheme: TpmtSignature,
932    }
933}
934
935tpm_struct! {
936    #[derive(Debug, PartialEq, Eq, Clone)]
937    kind: Response,
938    name: TpmGetTimeResponse,
939    cc: TpmCc::GetTime,
940    handles: 0,
941    parameters: {
942        pub time_info: Tpm2bAttest,
943        pub signature: TpmtSignature,
944    }
945}
946
947tpm_struct! {
948    #[derive(Debug, PartialEq, Eq, Clone)]
949    kind: Command,
950    name: TpmHashCommand,
951    cc: TpmCc::Hash,
952    handles: 0,
953    parameters: {
954        pub data: Tpm2bMaxBuffer,
955        pub hash_alg: TpmAlgId,
956        pub hierarchy: TpmRh,
957    }
958}
959
960tpm_struct! {
961    #[derive(Debug, PartialEq, Eq, Clone)]
962    kind: Response,
963    name: TpmHashResponse,
964    cc: TpmCc::Hash,
965    handles: 0,
966    parameters: {
967        pub out_hash: Tpm2bDigest,
968        pub validation: TpmtTkHashcheck,
969    }
970}
971
972tpm_struct! {
973    #[derive(Debug, PartialEq, Eq, Clone)]
974    kind: Command,
975    name: TpmHashSequenceStartCommand,
976    cc: TpmCc::HashSequenceStart,
977    handles: 0,
978    parameters: {
979        pub auth: Tpm2bAuth,
980        pub hash_alg: TpmAlgId,
981    }
982}
983
984tpm_struct! {
985    #[derive(Debug, PartialEq, Eq, Clone, Copy)]
986    kind: Response,
987    name: TpmHashSequenceStartResponse,
988    cc: TpmCc::HashSequenceStart,
989    handles: 1,
990    parameters: {}
991}
992
993tpm_struct! {
994    #[derive(Debug, PartialEq, Eq, Clone)]
995    kind: Command,
996    name: TpmHierarchyChangeAuthCommand,
997    cc: TpmCc::HierarchyChangeAuth,
998    handles: 1,
999    parameters: {
1000        pub new_auth: Tpm2bAuth,
1001    }
1002}
1003
1004tpm_struct! {
1005    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
1006    kind: Response,
1007    name: TpmHierarchyChangeAuthResponse,
1008    cc: TpmCc::HierarchyChangeAuth,
1009    handles: 0,
1010    parameters: {}
1011}
1012
1013tpm_struct! {
1014    #[derive(Debug, PartialEq, Eq, Clone, Copy)]
1015    kind: Command,
1016    name: TpmHierarchyControlCommand,
1017    cc: TpmCc::HierarchyControl,
1018    handles: 1,
1019    parameters: {
1020        pub enable: TpmRh,
1021        pub state: TpmiYesNo,
1022    }
1023}
1024
1025tpm_struct! {
1026    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
1027    kind: Response,
1028    name: TpmHierarchyControlResponse,
1029    cc: TpmCc::HierarchyControl,
1030    handles: 0,
1031    parameters: {}
1032}
1033
1034tpm_struct! {
1035    #[derive(Debug, PartialEq, Eq, Clone)]
1036    kind: Command,
1037    name: TpmHmacCommand,
1038    cc: TpmCc::Hmac,
1039    handles: 1,
1040    parameters: {
1041        pub buffer: Tpm2bMaxBuffer,
1042        pub hash_alg: TpmiAlgHash,
1043    }
1044}
1045
1046tpm_struct! {
1047    #[derive(Debug, PartialEq, Eq, Clone)]
1048    kind: Response,
1049    name: TpmHmacResponse,
1050    cc: TpmCc::Hmac,
1051    handles: 0,
1052    parameters: {
1053        pub out_hmac: Tpm2bDigest,
1054    }
1055}
1056
1057tpm_struct! {
1058    #[derive(Debug, PartialEq, Eq, Clone)]
1059    kind: Command,
1060    name: TpmHmacStartCommand,
1061    cc: TpmCc::HmacStart,
1062    handles: 1,
1063    parameters: {
1064        pub auth: Tpm2bAuth,
1065        pub hash_alg: TpmAlgId,
1066    }
1067}
1068
1069tpm_struct! {
1070    #[derive(Debug, PartialEq, Eq, Clone, Copy)]
1071    kind: Response,
1072    name: TpmHmacStartResponse,
1073    cc: TpmCc::HmacStart,
1074    handles: 1,
1075    parameters: {}
1076}
1077
1078tpm_struct! {
1079    #[derive(Debug, PartialEq, Eq, Clone)]
1080    kind: Command,
1081    name: TpmImportCommand,
1082    cc: TpmCc::Import,
1083    handles: 1,
1084    parameters: {
1085        pub encryption_key: Tpm2bData,
1086        pub object_public: Tpm2bPublic,
1087        pub duplicate: Tpm2bPrivate,
1088        pub in_sym_seed: Tpm2bEncryptedSecret,
1089        pub symmetric_alg: TpmtSymDef,
1090    }
1091}
1092
1093tpm_struct! {
1094    #[derive(Debug, Default, PartialEq, Eq, Clone)]
1095    kind: Response,
1096    name: TpmImportResponse,
1097    cc: TpmCc::Import,
1098    handles: 0,
1099    parameters: {
1100        pub out_private: Tpm2bPrivate,
1101    }
1102}
1103
1104tpm_struct! {
1105    #[derive(Debug, PartialEq, Eq, Clone)]
1106    kind: Command,
1107    name: TpmIncrementalSelfTestCommand,
1108    cc: TpmCc::IncrementalSelfTest,
1109    handles: 0,
1110    parameters: {
1111        pub to_test: TpmlAlg,
1112    }
1113}
1114
1115tpm_struct! {
1116    #[derive(Debug, Default, PartialEq, Eq, Clone)]
1117    kind: Response,
1118    name: TpmIncrementalSelfTestResponse,
1119    cc: TpmCc::IncrementalSelfTest,
1120    handles: 0,
1121    parameters: {
1122        pub to_do_list: TpmlAlg,
1123    }
1124}
1125
1126tpm_struct! {
1127    #[derive(Debug, Default, PartialEq, Eq, Clone)]
1128    kind: Command,
1129    name: TpmLoadCommand,
1130    cc: TpmCc::Load,
1131    handles: 1,
1132    parameters: {
1133        pub in_private: Tpm2bPrivate,
1134        pub in_public: Tpm2bPublic,
1135    }
1136}
1137
1138tpm_struct! {
1139    #[derive(Debug, PartialEq, Eq, Clone)]
1140    kind: Response,
1141    name: TpmLoadResponse,
1142    cc: TpmCc::Load,
1143    handles: 1,
1144    parameters: {
1145        pub name: Tpm2bName,
1146    }
1147}
1148
1149tpm_struct! {
1150    #[derive(Debug, PartialEq, Eq, Clone)]
1151    kind: Command,
1152    name: TpmLoadExternalCommand,
1153    cc: TpmCc::LoadExternal,
1154    handles: 0,
1155    parameters: {
1156        pub in_private: Tpm2bSensitive,
1157        pub in_public: Tpm2bPublic,
1158        pub hierarchy: TpmRh,
1159    }
1160}
1161
1162tpm_struct! {
1163    #[derive(Debug, PartialEq, Eq, Clone)]
1164    kind: Response,
1165    name: TpmLoadExternalResponse,
1166    cc: TpmCc::LoadExternal,
1167    handles: 1,
1168    parameters: {
1169        pub name: Tpm2bName,
1170    }
1171}
1172
1173tpm_struct! {
1174    #[derive(Debug, PartialEq, Eq, Clone)]
1175    kind: Command,
1176    name: TpmMakeCredentialCommand,
1177    cc: TpmCc::MakeCredential,
1178    handles: 1,
1179    parameters: {
1180        pub credential: Tpm2bDigest,
1181        pub object_name: Tpm2bName,
1182    }
1183}
1184
1185tpm_struct! {
1186    #[derive(Debug, PartialEq, Eq, Clone)]
1187    kind: Response,
1188    name: TpmMakeCredentialResponse,
1189    cc: TpmCc::MakeCredential,
1190    handles: 0,
1191    parameters: {
1192        pub credential_blob: Tpm2bIdObject,
1193        pub secret: Tpm2bEncryptedSecret,
1194    }
1195}
1196
1197tpm_struct! {
1198    #[derive(Debug, PartialEq, Eq, Clone)]
1199    kind: Command,
1200    name: TpmNvCertifyCommand,
1201    cc: TpmCc::NvCertify,
1202    handles: 3,
1203    parameters: {
1204        pub qualifying_data: Tpm2bData,
1205        pub in_scheme: TpmtSignature,
1206        pub size: u16,
1207        pub offset: u16,
1208    }
1209}
1210
1211tpm_struct! {
1212    #[derive(Debug, PartialEq, Eq, Clone)]
1213    kind: Response,
1214    name: TpmNvCertifyResponse,
1215    cc: TpmCc::NvCertify,
1216    handles: 0,
1217    parameters: {
1218        pub certify_info: Tpm2bAttest,
1219        pub signature: TpmtSignature,
1220    }
1221}
1222
1223tpm_struct! {
1224    #[derive(Debug, PartialEq, Eq, Clone)]
1225    kind: Command,
1226    name: TpmNvChangeAuthCommand,
1227    cc: TpmCc::NvChangeAuth,
1228    handles: 1,
1229    parameters: {
1230        pub new_auth: Tpm2bAuth,
1231    }
1232}
1233
1234tpm_struct! {
1235    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
1236    kind: Response,
1237    name: TpmNvChangeAuthResponse,
1238    cc: TpmCc::NvChangeAuth,
1239    handles: 0,
1240    parameters: {}
1241}
1242
1243tpm_struct! {
1244    #[derive(Debug, PartialEq, Eq, Clone)]
1245    kind: Command,
1246    name: TpmNvDefineSpaceCommand,
1247    cc: TpmCc::NvDefineSpace,
1248    handles: 1,
1249    parameters: {
1250        pub auth: Tpm2bAuth,
1251        pub public_info: Tpm2bNvPublic,
1252    }
1253}
1254
1255tpm_struct! {
1256    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
1257    kind: Response,
1258    name: TpmNvDefineSpaceResponse,
1259    cc: TpmCc::NvDefineSpace,
1260    handles: 0,
1261    parameters: {}
1262}
1263
1264tpm_struct! {
1265    #[derive(Debug, PartialEq, Eq, Clone)]
1266    kind: Command,
1267    name: TpmNvDefineSpace2Command,
1268    cc: TpmCc::NvDefineSpace2,
1269    handles: 1,
1270    parameters: {
1271        pub auth: Tpm2bAuth,
1272        pub public_info: crate::data::Tpm2bNvPublic2,
1273    }
1274}
1275
1276tpm_struct! {
1277    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
1278    kind: Response,
1279    name: TpmNvDefineSpace2Response,
1280    cc: TpmCc::NvDefineSpace2,
1281    handles: 0,
1282    parameters: {}
1283}
1284
1285tpm_struct! {
1286    #[derive(Debug, PartialEq, Eq, Clone)]
1287    kind: Command,
1288    name: TpmNvExtendCommand,
1289    cc: TpmCc::NvExtend,
1290    handles: 2,
1291    parameters: {
1292        pub data: Tpm2bMaxNvBuffer,
1293    }
1294}
1295
1296tpm_struct! {
1297    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
1298    kind: Response,
1299    name: TpmNvExtendResponse,
1300    cc: TpmCc::NvExtend,
1301    handles: 0,
1302    parameters: {}
1303}
1304
1305tpm_struct! {
1306    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
1307    kind: Command,
1308    name: TpmNvGlobalWriteLockCommand,
1309    cc: TpmCc::NvGlobalWriteLock,
1310    handles: 1,
1311    parameters: {}
1312}
1313
1314tpm_struct! {
1315    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
1316    kind: Response,
1317    name: TpmNvGlobalWriteLockResponse,
1318    cc: TpmCc::NvGlobalWriteLock,
1319    handles: 0,
1320    parameters: {}
1321}
1322
1323tpm_struct! {
1324    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
1325    kind: Command,
1326    name: TpmNvIncrementCommand,
1327    cc: TpmCc::NvIncrement,
1328    handles: 2,
1329    parameters: {}
1330}
1331
1332tpm_struct! {
1333    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
1334    kind: Response,
1335    name: TpmNvIncrementResponse,
1336    cc: TpmCc::NvIncrement,
1337    handles: 0,
1338    parameters: {}
1339}
1340
1341tpm_struct! {
1342    #[derive(Debug, PartialEq, Eq, Copy, Clone)]
1343    kind: Command,
1344    name: TpmNvReadCommand,
1345    cc: TpmCc::NvRead,
1346    handles: 2,
1347    parameters: {
1348        pub size: u16,
1349        pub offset: u16,
1350    }
1351}
1352
1353tpm_struct! {
1354    #[derive(Debug, Default, PartialEq, Eq, Clone)]
1355    kind: Response,
1356    name: TpmNvReadResponse,
1357    cc: TpmCc::NvRead,
1358    handles: 0,
1359    parameters: {
1360        pub data: Tpm2bMaxNvBuffer,
1361    }
1362}
1363
1364tpm_struct! {
1365    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
1366    kind: Command,
1367    name: TpmNvReadLockCommand,
1368    cc: TpmCc::NvReadLock,
1369    handles: 2,
1370    parameters: {}
1371}
1372
1373tpm_struct! {
1374    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
1375    kind: Response,
1376    name: TpmNvReadLockResponse,
1377    cc: TpmCc::NvReadLock,
1378    handles: 0,
1379    parameters: {}
1380}
1381
1382tpm_struct! {
1383    #[derive(Debug, PartialEq, Eq, Copy, Clone)]
1384    kind: Command,
1385    name: TpmNvReadPublicCommand,
1386    cc: TpmCc::NvReadPublic,
1387    handles: 1,
1388    parameters: {}
1389}
1390
1391tpm_struct! {
1392    #[derive(Debug, PartialEq, Eq, Clone)]
1393    kind: Response,
1394    name: TpmNvReadPublicResponse,
1395    cc: TpmCc::NvReadPublic,
1396    handles: 0,
1397    parameters: {
1398        pub nv_public: Tpm2bNvPublic,
1399        pub nv_name: Tpm2bName,
1400    }
1401}
1402
1403tpm_struct! {
1404    #[derive(Debug, PartialEq, Eq, Copy, Clone)]
1405    kind: Command,
1406    name: TpmNvReadPublic2Command,
1407    cc: TpmCc::NvReadPublic2,
1408    handles: 1,
1409    parameters: {}
1410}
1411
1412tpm_struct! {
1413    #[derive(Debug, PartialEq, Eq, Clone)]
1414    kind: Response,
1415    name: TpmNvReadPublic2Response,
1416    cc: TpmCc::NvReadPublic2,
1417    handles: 0,
1418    parameters: {
1419        pub nv_public: crate::data::Tpm2bNvPublic2,
1420        pub nv_name: Tpm2bName,
1421    }
1422}
1423
1424tpm_struct! {
1425    #[derive(Debug, PartialEq, Eq, Copy, Clone)]
1426    kind: Command,
1427    name: TpmNvSetBitsCommand,
1428    cc: TpmCc::NvSetBits,
1429    handles: 2,
1430    parameters: {
1431        pub bits: u64,
1432    }
1433}
1434
1435tpm_struct! {
1436    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
1437    kind: Response,
1438    name: TpmNvSetBitsResponse,
1439    cc: TpmCc::NvSetBits,
1440    handles: 0,
1441    parameters: {}
1442}
1443
1444tpm_struct! {
1445    #[derive(Debug, PartialEq, Eq, Copy, Clone)]
1446    kind: Command,
1447    name: TpmNvUndefineSpaceCommand,
1448    cc: TpmCc::NvUndefineSpace,
1449    handles: 2,
1450    parameters: {}
1451}
1452
1453tpm_struct! {
1454    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
1455    kind: Response,
1456    name: TpmNvUndefineSpaceResponse,
1457    cc: TpmCc::NvUndefineSpace,
1458    handles: 0,
1459    parameters: {}
1460}
1461
1462tpm_struct! {
1463    #[derive(Debug, PartialEq, Eq, Copy, Clone)]
1464    kind: Command,
1465    name: TpmNvUndefineSpaceSpecialCommand,
1466    cc: TpmCc::NvUndefineSpaceSpecial,
1467    handles: 2,
1468    parameters: {}
1469}
1470
1471tpm_struct! {
1472    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
1473    kind: Response,
1474    name: TpmNvUndefineSpaceSpecialResponse,
1475    cc: TpmCc::NvUndefineSpaceSpecial,
1476    handles: 0,
1477    parameters: {}
1478}
1479
1480tpm_struct! {
1481    #[derive(Debug, PartialEq, Eq, Clone)]
1482    kind: Command,
1483    name: TpmNvWriteCommand,
1484    cc: TpmCc::NvWrite,
1485    handles: 2,
1486    parameters: {
1487        pub data: Tpm2bMaxNvBuffer,
1488        pub offset: u16,
1489    }
1490}
1491
1492tpm_struct! {
1493    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
1494    kind: Response,
1495    name: TpmNvWriteResponse,
1496    cc: TpmCc::NvWrite,
1497    handles: 0,
1498    parameters: {}
1499}
1500
1501tpm_struct! {
1502    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
1503    kind: Command,
1504    name: TpmNvWriteLockCommand,
1505    cc: TpmCc::NvWriteLock,
1506    handles: 2,
1507    parameters: {}
1508}
1509
1510tpm_struct! {
1511    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
1512    kind: Response,
1513    name: TpmNvWriteLockResponse,
1514    cc: TpmCc::NvWriteLock,
1515    handles: 0,
1516    parameters: {}
1517}
1518
1519tpm_struct! {
1520    #[derive(Debug, Default, PartialEq, Eq, Clone)]
1521    kind: Command,
1522    name: TpmObjectChangeAuthCommand,
1523    cc: TpmCc::ObjectChangeAuth,
1524    handles: 2,
1525    parameters: {
1526        pub new_auth: Tpm2bAuth,
1527    }
1528}
1529
1530tpm_struct! {
1531    #[derive(Debug, Default, PartialEq, Eq, Clone)]
1532    kind: Response,
1533    name: TpmObjectChangeAuthResponse,
1534    cc: TpmCc::ObjectChangeAuth,
1535    handles: 0,
1536    parameters: {
1537        pub out_private: Tpm2bPrivate,
1538    }
1539}
1540
1541tpm_struct! {
1542    #[derive(Debug, PartialEq, Eq, Clone)]
1543    kind: Command,
1544    name: TpmPcrAllocateCommand,
1545    cc: TpmCc::PcrAllocate,
1546    handles: 1,
1547    parameters: {
1548        pub pcr_allocation: TpmlPcrSelection,
1549    }
1550}
1551
1552tpm_struct! {
1553    #[derive(Debug, PartialEq, Eq, Clone, Copy)]
1554    kind: Response,
1555    name: TpmPcrAllocateResponse,
1556    cc: TpmCc::PcrAllocate,
1557    handles: 0,
1558    parameters: {
1559        pub allocation_success: TpmiYesNo,
1560        pub max_pcr: u32,
1561        pub size_needed: u32,
1562        pub size_available: u32,
1563    }
1564}
1565
1566tpm_struct! {
1567    #[derive(Debug, PartialEq, Eq, Copy, Clone)]
1568    kind: Command,
1569    name: TpmPcrEventCommand,
1570    cc: TpmCc::PcrEvent,
1571    handles: 1,
1572    parameters: {
1573        pub event_data: Tpm2bEvent,
1574    }
1575}
1576
1577tpm_struct! {
1578    #[derive(Debug, Default, PartialEq, Eq, Clone)]
1579    kind: Response,
1580    name: TpmPcrEventResponse,
1581    cc: TpmCc::PcrEvent,
1582    handles: 0,
1583    parameters: {
1584        pub digests: TpmlDigestValues,
1585    }
1586}
1587
1588tpm_struct! {
1589    #[derive(Debug, PartialEq, Eq, Clone)]
1590    kind: Command,
1591    name: TpmPcrExtendCommand,
1592    cc: TpmCc::PcrExtend,
1593    handles: 1,
1594    parameters: {
1595        pub digests: TpmlDigestValues,
1596    }
1597}
1598
1599tpm_struct! {
1600    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
1601    kind: Response,
1602    name: TpmPcrExtendResponse,
1603    cc: TpmCc::PcrExtend,
1604    handles: 0,
1605    parameters: {}
1606}
1607
1608tpm_struct! {
1609    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
1610    kind: Command,
1611    name: TpmPcrResetCommand,
1612    cc: TpmCc::PcrReset,
1613    handles: 1,
1614    parameters: {}
1615}
1616
1617tpm_struct! {
1618    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
1619    kind: Response,
1620    name: TpmPcrResetResponse,
1621    cc: TpmCc::PcrReset,
1622    handles: 0,
1623    parameters: {}
1624}
1625
1626tpm_struct! {
1627    #[derive(Debug, PartialEq, Eq, Clone)]
1628    kind: Command,
1629    name: TpmPcrReadCommand,
1630    cc: TpmCc::PcrRead,
1631    handles: 0,
1632    parameters: {
1633        pub pcr_selection_in: TpmlPcrSelection,
1634    }
1635}
1636
1637tpm_struct! {
1638    #[derive(Debug, Default, PartialEq, Eq, Clone)]
1639    kind: Response,
1640    name: TpmPcrReadResponse,
1641    cc: TpmCc::PcrRead,
1642    handles: 0,
1643    parameters: {
1644        pub pcr_update_counter: u32,
1645        pub pcr_selection_out: TpmlPcrSelection,
1646        pub pcr_values: TpmlDigest,
1647    }
1648}
1649
1650tpm_struct! {
1651    #[derive(Debug, PartialEq, Eq, Clone)]
1652    kind: Command,
1653    name: TpmPcrSetAuthPolicyCommand,
1654    cc: TpmCc::PcrSetAuthPolicy,
1655    handles: 1,
1656    parameters: {
1657        pub auth_policy: Tpm2bDigest,
1658        pub hash_alg: TpmAlgId,
1659        pub pcr_num: TpmRh,
1660    }
1661}
1662
1663tpm_struct! {
1664    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
1665    kind: Response,
1666    name: TpmPcrSetAuthPolicyResponse,
1667    cc: TpmCc::PcrSetAuthPolicy,
1668    handles: 0,
1669    parameters: {}
1670}
1671
1672tpm_struct! {
1673    #[derive(Debug, PartialEq, Eq, Clone)]
1674    kind: Command,
1675    name: TpmPcrSetAuthValueCommand,
1676    cc: TpmCc::PcrSetAuthValue,
1677    handles: 1,
1678    parameters: {
1679        pub auth: Tpm2bDigest,
1680    }
1681}
1682
1683tpm_struct! {
1684    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
1685    kind: Response,
1686    name: TpmPcrSetAuthValueResponse,
1687    cc: TpmCc::PcrSetAuthValue,
1688    handles: 0,
1689    parameters: {}
1690}
1691
1692tpm_struct! {
1693    #[derive(Debug, PartialEq, Eq, Clone, Copy)]
1694    kind: Command,
1695    name: TpmPolicyAcSendSelectCommand,
1696    cc: TpmCc::PolicyAcSendSelect,
1697    handles: 1,
1698    parameters: {
1699        pub object_name: Tpm2bName,
1700        pub auth_handle_name: Tpm2bName,
1701        pub ac_name: Tpm2bName,
1702        pub include_object: TpmiYesNo,
1703    }
1704}
1705
1706tpm_struct! {
1707    #[derive(Debug, Default, PartialEq, Eq, Clone, Copy)]
1708    kind: Response,
1709    name: TpmPolicyAcSendSelectResponse,
1710    cc: TpmCc::PolicyAcSendSelect,
1711    handles: 0,
1712    parameters: {}
1713}
1714
1715tpm_struct! {
1716    #[derive(Debug, PartialEq, Eq, Clone)]
1717    kind: Command,
1718    name: TpmPolicyAuthorizeCommand,
1719    cc: TpmCc::PolicyAuthorize,
1720    handles: 1,
1721    parameters: {
1722        pub approved_policy: Tpm2bDigest,
1723        pub policy_ref: Tpm2bNonce,
1724        pub key_sign: Tpm2bName,
1725        pub check_ticket: TpmtTkVerified,
1726    }
1727}
1728
1729tpm_struct! {
1730    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
1731    kind: Response,
1732    name: TpmPolicyAuthorizeResponse,
1733    cc: TpmCc::PolicyAuthorize,
1734    handles: 0,
1735    parameters: {}
1736}
1737
1738tpm_struct! {
1739    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
1740    kind: Command,
1741    name: TpmPolicyAuthorizeNvCommand,
1742    cc: TpmCc::PolicyAuthorizeNv,
1743    handles: 3,
1744    parameters: {}
1745}
1746
1747tpm_struct! {
1748    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
1749    kind: Response,
1750    name: TpmPolicyAuthorizeNvResponse,
1751    cc: TpmCc::PolicyAuthorizeNv,
1752    handles: 0,
1753    parameters: {}
1754}
1755
1756tpm_struct! {
1757    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
1758    kind: Command,
1759    name: TpmPolicyAuthValueCommand,
1760    cc: TpmCc::PolicyAuthValue,
1761    handles: 1,
1762    parameters: {}
1763}
1764
1765tpm_struct! {
1766    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
1767    kind: Response,
1768    name: TpmPolicyAuthValueResponse,
1769    cc: TpmCc::PolicyAuthValue,
1770    handles: 0,
1771    parameters: {}
1772}
1773
1774tpm_struct! {
1775    #[derive(Debug, PartialEq, Eq, Clone)]
1776    kind: Command,
1777    name: TpmPolicyCapabilityCommand,
1778    cc: TpmCc::PolicyCapability,
1779    handles: 1,
1780    parameters: {
1781        pub capability: TpmCap,
1782        pub property: u32,
1783        pub op: TpmEo,
1784        pub operand_b: Tpm2bMaxBuffer,
1785    }
1786}
1787
1788tpm_struct! {
1789    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
1790    kind: Response,
1791    name: TpmPolicyCapabilityResponse,
1792    cc: TpmCc::PolicyCapability,
1793    handles: 0,
1794    parameters: {}
1795}
1796
1797tpm_struct! {
1798    #[derive(Debug, PartialEq, Eq, Clone, Copy)]
1799    kind: Command,
1800    name: TpmPolicyCommandCodeCommand,
1801    cc: TpmCc::PolicyCommandCode,
1802    handles: 1,
1803    parameters: {
1804        pub code: TpmCc,
1805    }
1806}
1807
1808tpm_struct! {
1809    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
1810    kind: Response,
1811    name: TpmPolicyCommandCodeResponse,
1812    cc: TpmCc::PolicyCommandCode,
1813    handles: 0,
1814    parameters: {}
1815}
1816
1817tpm_struct! {
1818    #[derive(Debug, PartialEq, Eq, Clone)]
1819    kind: Command,
1820    name: TpmPolicyCounterTimerCommand,
1821    cc: TpmCc::PolicyCounterTimer,
1822    handles: 1,
1823    parameters: {
1824        pub operand_b: Tpm2bMaxBuffer,
1825        pub offset: u16,
1826        pub operation: TpmEo,
1827    }
1828}
1829
1830tpm_struct! {
1831    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
1832    kind: Response,
1833    name: TpmPolicyCounterTimerResponse,
1834    cc: TpmCc::PolicyCounterTimer,
1835    handles: 0,
1836    parameters: {}
1837}
1838
1839tpm_struct! {
1840    #[derive(Debug, PartialEq, Eq, Clone)]
1841    kind: Command,
1842    name: TpmPolicyCpHashCommand,
1843    cc: TpmCc::PolicyCpHash,
1844    handles: 1,
1845    parameters: {
1846        pub cp_hash_a: Tpm2bDigest,
1847    }
1848}
1849
1850tpm_struct! {
1851    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
1852    kind: Response,
1853    name: TpmPolicyCpHashResponse,
1854    cc: TpmCc::PolicyCpHash,
1855    handles: 0,
1856    parameters: {}
1857}
1858
1859tpm_struct! {
1860    #[derive(Debug, PartialEq, Eq, Clone)]
1861    kind: Command,
1862    name: TpmPolicyDuplicationSelectCommand,
1863    cc: TpmCc::PolicyDuplicationSelect,
1864    handles: 1,
1865    parameters: {
1866        pub object_name: Tpm2bName,
1867        pub new_parent_name: Tpm2bName,
1868        pub include_object: TpmiYesNo,
1869    }
1870}
1871
1872tpm_struct! {
1873    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
1874    kind: Response,
1875    name: TpmPolicyDuplicationSelectResponse,
1876    cc: TpmCc::PolicyDuplicationSelect,
1877    handles: 0,
1878    parameters: {}
1879}
1880
1881tpm_struct! {
1882    #[derive(Debug, Default, PartialEq, Eq, Clone)]
1883    kind: Command,
1884    name: TpmPolicyGetDigestCommand,
1885    cc: TpmCc::PolicyGetDigest,
1886    handles: 1,
1887    parameters: {}
1888}
1889
1890tpm_struct! {
1891    #[derive(Debug, Default, PartialEq, Eq, Clone)]
1892    kind: Response,
1893    name: TpmPolicyGetDigestResponse,
1894    cc: TpmCc::PolicyGetDigest,
1895    handles: 0,
1896    parameters: {
1897        pub policy_digest: Tpm2bDigest,
1898    }
1899}
1900
1901tpm_struct! {
1902    #[derive(Debug, PartialEq, Eq, Copy, Clone)]
1903    kind: Command,
1904    name: TpmPolicyLocalityCommand,
1905    cc: TpmCc::PolicyLocality,
1906    handles: 1,
1907    parameters: {
1908        pub locality: TpmaLocality,
1909    }
1910}
1911
1912tpm_struct! {
1913    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
1914    kind: Response,
1915    name: TpmPolicyLocalityResponse,
1916    cc: TpmCc::PolicyLocality,
1917    handles: 0,
1918    parameters: {}
1919}
1920
1921tpm_struct! {
1922    #[derive(Debug, PartialEq, Eq, Clone)]
1923    kind: Command,
1924    name: TpmPolicyNameHashCommand,
1925    cc: TpmCc::PolicyNameHash,
1926    handles: 1,
1927    parameters: {
1928        pub name_hash: Tpm2bDigest,
1929    }
1930}
1931
1932tpm_struct! {
1933    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
1934    kind: Response,
1935    name: TpmPolicyNameHashResponse,
1936    cc: TpmCc::PolicyNameHash,
1937    handles: 0,
1938    parameters: {}
1939}
1940
1941tpm_struct! {
1942    #[derive(Debug, PartialEq, Eq, Clone)]
1943    kind: Command,
1944    name: TpmPolicyNvCommand,
1945    cc: TpmCc::PolicyNv,
1946    handles: 3,
1947    parameters: {
1948        pub operand_b: Tpm2bMaxBuffer,
1949        pub offset: u16,
1950        pub operation: TpmEo,
1951    }
1952}
1953
1954tpm_struct! {
1955    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
1956    kind: Response,
1957    name: TpmPolicyNvResponse,
1958    cc: TpmCc::PolicyNv,
1959    handles: 0,
1960    parameters: {}
1961}
1962
1963tpm_struct! {
1964    #[derive(Debug, PartialEq, Eq, Copy, Clone)]
1965    kind: Command,
1966    name: TpmPolicyNvWrittenCommand,
1967    cc: TpmCc::PolicyNvWritten,
1968    handles: 1,
1969    parameters: {
1970        pub written_set: TpmiYesNo,
1971    }
1972}
1973
1974tpm_struct! {
1975    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
1976    kind: Response,
1977    name: TpmPolicyNvWrittenResponse,
1978    cc: TpmCc::PolicyNvWritten,
1979    handles: 0,
1980    parameters: {}
1981}
1982
1983tpm_struct! {
1984    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
1985    kind: Command,
1986    name: TpmPolicyOrCommand,
1987    cc: TpmCc::PolicyOr,
1988    handles: 1,
1989    parameters: {
1990        pub p_hash_list: TpmlDigest,
1991    }
1992}
1993
1994tpm_struct! {
1995    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
1996    kind: Response,
1997    name: TpmPolicyOrResponse,
1998    cc: TpmCc::PolicyOr,
1999    handles: 0,
2000    parameters: {}
2001}
2002
2003tpm_struct! {
2004    #[derive(Debug, PartialEq, Eq, Clone)]
2005    kind: Command,
2006    name: TpmPolicyParametersCommand,
2007    cc: TpmCc::PolicyParameters,
2008    handles: 1,
2009    parameters: {
2010        pub p_hash: Tpm2bDigest,
2011    }
2012}
2013
2014tpm_struct! {
2015    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
2016    kind: Response,
2017    name: TpmPolicyParametersResponse,
2018    cc: TpmCc::PolicyParameters,
2019    handles: 0,
2020    parameters: {}
2021}
2022
2023tpm_struct! {
2024    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
2025    kind: Command,
2026    name: TpmPolicyPasswordCommand,
2027    cc: TpmCc::PolicyPassword,
2028    handles: 1,
2029    parameters: {}
2030}
2031
2032tpm_struct! {
2033    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
2034    kind: Response,
2035    name: TpmPolicyPasswordResponse,
2036    cc: TpmCc::PolicyPassword,
2037    handles: 0,
2038    parameters: {}
2039}
2040
2041tpm_struct! {
2042    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
2043    kind: Command,
2044    name: TpmPolicyPhysicalPresenceCommand,
2045    cc: TpmCc::PolicyPhysicalPresence,
2046    handles: 1,
2047    parameters: {}
2048}
2049
2050tpm_struct! {
2051    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
2052    kind: Response,
2053    name: TpmPolicyPhysicalPresenceResponse,
2054    cc: TpmCc::PolicyPhysicalPresence,
2055    handles: 0,
2056    parameters: {}
2057}
2058
2059tpm_struct! (
2060    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
2061    kind: Command,
2062    name: TpmPolicyPcrCommand,
2063    cc: TpmCc::PolicyPcr,
2064    handles: 1,
2065    parameters: {
2066        pub pcr_digest: Tpm2bDigest,
2067        pub pcrs: TpmlPcrSelection,
2068    }
2069);
2070
2071tpm_struct! (
2072    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
2073    kind: Response,
2074    name: TpmPolicyPcrResponse,
2075    cc: TpmCc::PolicyPcr,
2076    handles: 0,
2077    parameters: {}
2078);
2079
2080tpm_struct! {
2081    #[derive(Debug, PartialEq, Eq, Copy, Clone)]
2082    kind: Command,
2083    name: TpmPolicyRestartCommand,
2084    cc: TpmCc::PolicyRestart,
2085    handles: 1,
2086    parameters: {}
2087}
2088
2089tpm_struct! {
2090    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
2091    kind: Response,
2092    name: TpmPolicyRestartResponse,
2093    cc: TpmCc::PolicyRestart,
2094    handles: 0,
2095    parameters: {}
2096}
2097
2098tpm_struct! {
2099    #[derive(Debug, Default, PartialEq, Eq, Clone)]
2100    kind: Command,
2101    name: TpmPolicySecretCommand,
2102    cc: TpmCc::PolicySecret,
2103    handles: 2,
2104    parameters: {
2105        pub nonce_tpm: Tpm2bNonce,
2106        pub cp_hash_a: Tpm2bDigest,
2107        pub policy_ref: Tpm2bNonce,
2108        pub expiration: i32,
2109    }
2110}
2111
2112tpm_struct! {
2113    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
2114    kind: Response,
2115    name: TpmPolicySecretResponse,
2116    cc: TpmCc::PolicySecret,
2117    handles: 0,
2118    parameters: {
2119        pub timeout: Tpm2bTimeout,
2120        pub policy_ticket: TpmtTkAuth,
2121    }
2122}
2123
2124tpm_struct! {
2125    #[derive(Debug, PartialEq, Eq, Clone)]
2126    kind: Command,
2127    name: TpmPolicySignedCommand,
2128    cc: TpmCc::PolicySigned,
2129    handles: 2,
2130    parameters: {
2131        pub nonce_tpm: Tpm2bNonce,
2132        pub cp_hash_a: Tpm2bDigest,
2133        pub policy_ref: Tpm2bNonce,
2134        pub expiration: i32,
2135        pub auth: TpmtSignature,
2136    }
2137}
2138
2139tpm_struct! {
2140    #[derive(Debug, PartialEq, Eq, Clone)]
2141    kind: Response,
2142    name: TpmPolicySignedResponse,
2143    cc: TpmCc::PolicySigned,
2144    handles: 0,
2145    parameters: {
2146        pub timeout: Tpm2bTimeout,
2147        pub policy_ticket: TpmtTkAuth,
2148    }
2149}
2150
2151tpm_struct! {
2152    #[derive(Debug, PartialEq, Eq, Clone)]
2153    kind: Command,
2154    name: TpmPolicyTemplateCommand,
2155    cc: TpmCc::PolicyTemplate,
2156    handles: 1,
2157    parameters: {
2158        pub template_hash: Tpm2bDigest,
2159    }
2160}
2161
2162tpm_struct! {
2163    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
2164    kind: Response,
2165    name: TpmPolicyTemplateResponse,
2166    cc: TpmCc::PolicyTemplate,
2167    handles: 0,
2168    parameters: {}
2169}
2170
2171tpm_struct! {
2172    #[derive(Debug, PartialEq, Eq, Clone)]
2173    kind: Command,
2174    name: TpmPolicyTicketCommand,
2175    cc: TpmCc::PolicyTicket,
2176    handles: 1,
2177    parameters: {
2178        pub timeout: Tpm2bTimeout,
2179        pub cp_hash_a: Tpm2bDigest,
2180        pub policy_ref: Tpm2bNonce,
2181        pub auth_name: Tpm2bName,
2182        pub ticket: TpmtTkAuth,
2183    }
2184}
2185
2186tpm_struct! {
2187    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
2188    kind: Response,
2189    name: TpmPolicyTicketResponse,
2190    cc: TpmCc::PolicyTicket,
2191    handles: 0,
2192    parameters: {}
2193}
2194
2195tpm_struct! {
2196    #[derive(Debug, PartialEq, Eq, Clone)]
2197    kind: Command,
2198    name: TpmPolicyTransportSpdmCommand,
2199    cc: TpmCc::PolicyTransportSpdm,
2200    handles: 1,
2201    parameters: {
2202        pub req_key_name: Tpm2bName,
2203        pub tpm_key_name: Tpm2bName,
2204    }
2205}
2206
2207tpm_struct! {
2208    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
2209    kind: Response,
2210    name: TpmPolicyTransportSpdmResponse,
2211    cc: TpmCc::PolicyTransportSpdm,
2212    handles: 0,
2213    parameters: {}
2214}
2215
2216tpm_struct! {
2217    #[derive(Debug, PartialEq, Eq, Clone)]
2218    kind: Command,
2219    name: TpmPpCommandsCommand,
2220    cc: TpmCc::PpCommands,
2221    handles: 1,
2222    parameters: {
2223        pub set_list: TpmlCc,
2224        pub clear_list: TpmlCc,
2225    }
2226}
2227
2228tpm_struct! {
2229    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
2230    kind: Response,
2231    name: TpmPpCommandsResponse,
2232    cc: TpmCc::PpCommands,
2233    handles: 0,
2234    parameters: {}
2235}
2236
2237tpm_struct! {
2238    #[derive(Debug, PartialEq, Eq, Clone)]
2239    kind: Command,
2240    name: TpmQuoteCommand,
2241    cc: TpmCc::Quote,
2242    handles: 1,
2243    parameters: {
2244        pub qualifying_data: Tpm2bData,
2245        pub in_scheme: TpmtSignature,
2246        pub pcr_select: TpmlPcrSelection,
2247    }
2248}
2249
2250tpm_struct! {
2251    #[derive(Debug, PartialEq, Eq, Clone)]
2252    kind: Response,
2253    name: TpmQuoteResponse,
2254    cc: TpmCc::Quote,
2255    handles: 0,
2256    parameters: {
2257        pub quoted: Tpm2bAttest,
2258        pub signature: TpmtSignature,
2259    }
2260}
2261
2262tpm_struct! {
2263    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
2264    kind: Command,
2265    name: TpmReadClockCommand,
2266    cc: TpmCc::ReadClock,
2267    handles: 0,
2268    parameters: {}
2269}
2270
2271tpm_struct! {
2272    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
2273    kind: Response,
2274    name: TpmReadClockResponse,
2275    cc: TpmCc::ReadClock,
2276    handles: 0,
2277    parameters: {
2278        pub current_time: TpmsTimeInfo,
2279    }
2280}
2281
2282tpm_struct! {
2283    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
2284    kind: Command,
2285    name: TpmReadOnlyControlCommand,
2286    cc: TpmCc::ReadOnlyControl,
2287    handles: 1,
2288    parameters: {
2289        pub state: TpmiYesNo,
2290    }
2291}
2292
2293tpm_struct! {
2294    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
2295    kind: Response,
2296    name: TpmReadOnlyControlResponse,
2297    cc: TpmCc::ReadOnlyControl,
2298    handles: 0,
2299    parameters: {}
2300}
2301
2302tpm_struct! {
2303    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
2304    kind: Command,
2305    name: TpmReadPublicCommand,
2306    cc: TpmCc::ReadPublic,
2307    handles: 1,
2308    parameters: {}
2309}
2310
2311tpm_struct! {
2312    #[derive(Debug, Default, PartialEq, Eq, Clone)]
2313    kind: Response,
2314    name: TpmReadPublicResponse,
2315    cc: TpmCc::ReadPublic,
2316    handles: 0,
2317    parameters: {
2318        pub out_public: Tpm2bPublic,
2319        pub name: Tpm2bName,
2320        pub qualified_name: Tpm2bName,
2321    }
2322}
2323
2324tpm_struct! {
2325    #[derive(Debug, PartialEq, Eq, Clone)]
2326    kind: Command,
2327    name: TpmRewrapCommand,
2328    cc: TpmCc::Rewrap,
2329    handles: 2,
2330    parameters: {
2331        pub in_duplicate: Tpm2bPrivate,
2332        pub name: Tpm2bName,
2333        pub in_sym_seed: Tpm2bEncryptedSecret,
2334    }
2335}
2336
2337tpm_struct! {
2338    #[derive(Debug, PartialEq, Eq, Clone)]
2339    kind: Response,
2340    name: TpmRewrapResponse,
2341    cc: TpmCc::Rewrap,
2342    handles: 0,
2343    parameters: {
2344        pub out_duplicate: Tpm2bPrivate,
2345        pub out_sym_seed: Tpm2bEncryptedSecret,
2346    }
2347}
2348
2349tpm_struct! {
2350    #[derive(Debug, PartialEq, Eq, Clone)]
2351    kind: Command,
2352    name: TpmRsaDecryptCommand,
2353    cc: TpmCc::RsaDecrypt,
2354    handles: 1,
2355    parameters: {
2356        pub cipher_text: Tpm2bPublicKeyRsa,
2357        pub in_scheme: TpmtRsaDecrypt,
2358        pub label: Tpm2bData,
2359    }
2360}
2361
2362tpm_struct! {
2363    #[derive(Debug, PartialEq, Eq, Clone)]
2364    kind: Response,
2365    name: TpmRsaDecryptResponse,
2366    cc: TpmCc::RsaDecrypt,
2367    handles: 0,
2368    parameters: {
2369        pub message: Tpm2bPublicKeyRsa,
2370    }
2371}
2372
2373tpm_struct! {
2374    #[derive(Debug, PartialEq, Eq, Clone)]
2375    kind: Command,
2376    name: TpmRsaEncryptCommand,
2377    cc: TpmCc::RsaEncrypt,
2378    handles: 1,
2379    parameters: {
2380        pub message: Tpm2bPublicKeyRsa,
2381        pub in_scheme: TpmtRsaDecrypt,
2382        pub label: Tpm2bData,
2383    }
2384}
2385
2386tpm_struct! {
2387    #[derive(Debug, PartialEq, Eq, Clone)]
2388    kind: Response,
2389    name: TpmRsaEncryptResponse,
2390    cc: TpmCc::RsaEncrypt,
2391    handles: 0,
2392    parameters: {
2393        pub out_data: Tpm2bPublicKeyRsa,
2394    }
2395}
2396
2397tpm_struct! {
2398    #[derive(Debug, PartialEq, Eq, Clone, Copy)]
2399    kind: Command,
2400    name: TpmSelfTestCommand,
2401    cc: TpmCc::SelfTest,
2402    handles: 0,
2403    parameters: {
2404        pub full_test: TpmiYesNo,
2405    }
2406}
2407
2408tpm_struct! {
2409    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
2410    kind: Response,
2411    name: TpmSelfTestResponse,
2412    cc: TpmCc::SelfTest,
2413    handles: 0,
2414    parameters: {}
2415}
2416
2417tpm_struct! {
2418    #[derive(Debug, PartialEq, Eq, Clone)]
2419    kind: Command,
2420    name: TpmSequenceCompleteCommand,
2421    cc: TpmCc::SequenceComplete,
2422    handles: 1,
2423    parameters: {
2424        pub buffer: Tpm2bMaxBuffer,
2425        pub hierarchy: TpmRh,
2426    }
2427}
2428
2429tpm_struct! {
2430    #[derive(Debug, PartialEq, Eq, Clone)]
2431    kind: Response,
2432    name: TpmSequenceCompleteResponse,
2433    cc: TpmCc::SequenceComplete,
2434    handles: 0,
2435    parameters: {
2436        pub result: Tpm2bDigest,
2437        pub validation: TpmtTkHashcheck,
2438    }
2439}
2440
2441tpm_struct! {
2442    #[derive(Debug, PartialEq, Eq, Clone)]
2443    kind: Command,
2444    name: TpmSequenceUpdateCommand,
2445    cc: TpmCc::SequenceUpdate,
2446    handles: 1,
2447    parameters: {
2448        pub buffer: Tpm2bMaxBuffer,
2449    }
2450}
2451
2452tpm_struct! {
2453    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
2454    kind: Response,
2455    name: TpmSequenceUpdateResponse,
2456    cc: TpmCc::SequenceUpdate,
2457    handles: 0,
2458    parameters: {}
2459}
2460
2461tpm_struct! {
2462    #[derive(Debug, PartialEq, Eq, Clone)]
2463    kind: Command,
2464    name: TpmSetAlgorithmSetCommand,
2465    cc: TpmCc::SetAlgorithmSet,
2466    handles: 1,
2467    parameters: {
2468        pub algorithm_set: u32,
2469    }
2470}
2471
2472tpm_struct! {
2473    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
2474    kind: Response,
2475    name: TpmSetAlgorithmSetResponse,
2476    cc: TpmCc::SetAlgorithmSet,
2477    handles: 0,
2478    parameters: {}
2479}
2480
2481tpm_struct! {
2482    #[derive(Debug, PartialEq, Eq, Clone)]
2483    kind: Command,
2484    name: TpmSetCommandCodeAuditStatusCommand,
2485    cc: TpmCc::SetCommandCodeAuditStatus,
2486    handles: 1,
2487    parameters: {
2488        pub audit_alg: TpmiAlgHash,
2489        pub set_list: TpmlCc,
2490        pub clear_list: TpmlCc,
2491    }
2492}
2493
2494tpm_struct! {
2495    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
2496    kind: Response,
2497    name: TpmSetCommandCodeAuditStatusResponse,
2498    cc: TpmCc::SetCommandCodeAuditStatus,
2499    handles: 0,
2500    parameters: {}
2501}
2502
2503tpm_struct! {
2504    #[derive(Debug, PartialEq, Eq, Clone)]
2505    kind: Command,
2506    name: TpmSetPrimaryPolicyCommand,
2507    cc: TpmCc::SetPrimaryPolicy,
2508    handles: 1,
2509    parameters: {
2510        pub auth_policy: Tpm2bDigest,
2511        pub hash_alg: TpmAlgId,
2512    }
2513}
2514
2515tpm_struct! {
2516    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
2517    kind: Response,
2518    name: TpmSetPrimaryPolicyResponse,
2519    cc: TpmCc::SetPrimaryPolicy,
2520    handles: 0,
2521    parameters: {}
2522}
2523
2524tpm_struct! {
2525    #[derive(Debug, PartialEq, Eq, Copy, Clone)]
2526    kind: Command,
2527    name: TpmShutdownCommand,
2528    cc: TpmCc::Shutdown,
2529    handles: 0,
2530    parameters: {
2531        pub shutdown_type: TpmSu,
2532    }
2533}
2534
2535tpm_struct! {
2536    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
2537    kind: Response,
2538    name: TpmShutdownResponse,
2539    cc: TpmCc::Shutdown,
2540    handles: 0,
2541    parameters: {}
2542}
2543
2544tpm_struct! {
2545    #[derive(Debug, PartialEq, Eq, Clone)]
2546    kind: Command,
2547    name: TpmSignCommand,
2548    cc: TpmCc::Sign,
2549    handles: 1,
2550    parameters: {
2551        pub digest: Tpm2bDigest,
2552        pub in_scheme: TpmtSignature,
2553        pub validation: TpmtTkHashcheck,
2554    }
2555}
2556
2557tpm_struct! {
2558    #[derive(Debug, PartialEq, Eq, Clone)]
2559    kind: Response,
2560    name: TpmSignResponse,
2561    cc: TpmCc::Sign,
2562    handles: 0,
2563    parameters: {
2564        pub signature: TpmtSignature,
2565    }
2566}
2567
2568tpm_struct! {
2569    #[derive(Debug, PartialEq, Eq, Clone)]
2570    kind: Command,
2571    name: TpmStartAuthSessionCommand,
2572    cc: TpmCc::StartAuthSession,
2573    handles: 2,
2574    parameters: {
2575        pub nonce_caller: Tpm2bNonce,
2576        pub encrypted_salt: Tpm2bEncryptedSecret,
2577        pub session_type: TpmSe,
2578        pub symmetric: TpmtSymDefObject,
2579        pub auth_hash: TpmAlgId,
2580    }
2581}
2582
2583tpm_struct! {
2584    #[derive(Debug, Default, PartialEq, Eq, Clone)]
2585    kind: Response,
2586    name: TpmStartAuthSessionResponse,
2587    cc: TpmCc::StartAuthSession,
2588    handles: 1,
2589    parameters: {
2590        pub nonce_tpm: Tpm2bNonce,
2591    }
2592}
2593
2594tpm_struct! {
2595    #[derive(Debug, PartialEq, Eq, Copy, Clone)]
2596    kind: Command,
2597    name: TpmStartupCommand,
2598    cc: TpmCc::Startup,
2599    handles: 0,
2600    parameters: {
2601        pub startup_type: TpmSu,
2602    }
2603}
2604
2605tpm_struct! {
2606    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
2607    kind: Response,
2608    name: TpmStartupResponse,
2609    cc: TpmCc::Startup,
2610    handles: 0,
2611    parameters: {}
2612}
2613
2614tpm_struct! {
2615    #[derive(Debug, PartialEq, Eq, Clone)]
2616    kind: Command,
2617    name: TpmStirRandomCommand,
2618    cc: TpmCc::StirRandom,
2619    handles: 0,
2620    parameters: {
2621        pub in_data: Tpm2bSensitiveData,
2622    }
2623}
2624
2625tpm_struct! {
2626    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
2627    kind: Response,
2628    name: TpmStirRandomResponse,
2629    cc: TpmCc::StirRandom,
2630    handles: 0,
2631    parameters: {}
2632}
2633
2634tpm_struct! {
2635    #[derive(Debug, PartialEq, Eq, Clone)]
2636    kind: Command,
2637    name: TpmTestParmsCommand,
2638    cc: TpmCc::TestParms,
2639    handles: 0,
2640    parameters: {
2641        pub parameters: TpmtPublicParms,
2642    }
2643}
2644
2645tpm_struct! {
2646    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
2647    kind: Response,
2648    name: TpmTestParmsResponse,
2649    cc: TpmCc::TestParms,
2650    handles: 0,
2651    parameters: {}
2652}
2653
2654tpm_struct! {
2655    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
2656    kind: Command,
2657    name: TpmUnsealCommand,
2658    cc: TpmCc::Unseal,
2659    handles: 1,
2660    parameters: {}
2661}
2662
2663tpm_struct! {
2664    #[derive(Debug, Default, PartialEq, Eq, Clone)]
2665    kind: Response,
2666    name: TpmUnsealResponse,
2667    cc: TpmCc::Unseal,
2668    handles: 0,
2669    parameters: {
2670        pub out_data: Tpm2bSensitiveData,
2671    }
2672}
2673
2674tpm_struct! {
2675    #[derive(Debug, PartialEq, Eq, Clone)]
2676    kind: Command,
2677    name: TpmVendorTcgTestCommand,
2678    cc: TpmCc::VendorTcgTest,
2679    handles: 0,
2680    parameters: {
2681        pub input_data: Tpm2bData,
2682    }
2683}
2684
2685tpm_struct! {
2686    #[derive(Debug, PartialEq, Eq, Clone)]
2687    kind: Response,
2688    name: TpmVendorTcgTestResponse,
2689    cc: TpmCc::VendorTcgTest,
2690    handles: 0,
2691    parameters: {
2692        pub output_data: Tpm2bData,
2693    }
2694}
2695
2696tpm_struct! {
2697    #[derive(Debug, PartialEq, Eq, Clone)]
2698    kind: Command,
2699    name: TpmVerifySignatureCommand,
2700    cc: TpmCc::VerifySignature,
2701    handles: 1,
2702    parameters: {
2703        pub digest: Tpm2bDigest,
2704        pub signature: TpmtSignature,
2705    }
2706}
2707
2708tpm_struct! {
2709    #[derive(Debug, Default, PartialEq, Eq, Copy, Clone)]
2710    kind: Response,
2711    name: TpmVerifySignatureResponse,
2712    cc: TpmCc::VerifySignature,
2713    handles: 0,
2714    parameters: {
2715        pub validation: TpmtTkVerified,
2716    }
2717}
2718
2719tpm_struct! {
2720    #[derive(Debug, PartialEq, Eq, Clone)]
2721    kind: Command,
2722    name: TpmZGen2PhaseCommand,
2723    cc: TpmCc::ZGen2Phase,
2724    handles: 1,
2725    parameters: {
2726        pub in_qsb: Tpm2bEccPoint,
2727        pub in_qeb: Tpm2bEccPoint,
2728        pub in_scheme: TpmiEccKeyExchange,
2729        pub counter: u16,
2730    }
2731}
2732
2733tpm_struct! {
2734    #[derive(Debug, PartialEq, Eq, Clone)]
2735    kind: Response,
2736    name: TpmZGen2PhaseResponse,
2737    cc: TpmCc::ZGen2Phase,
2738    handles: 0,
2739    parameters: {
2740        pub out_z1: Tpm2bEccPoint,
2741        pub out_z2: Tpm2bEccPoint,
2742    }
2743}