Expand description
§TPM 2.0 Protocol
A library for marshaling and unmarshaling TCG TPM 2.0 protocol messages.
§Constraints
allocis disallowed.- Dependencies are disallowed.
- Developer dependencies are disallowed.
- Panics are disallowed.
§Design Goals
- The crate must compile with GNU make and rustc without any external dependencies.
§Zero-Copy Contract
Read-side protocol APIs operate on caller-owned byte slices and return borrowed wire views into those slices. Implementations must not copy payload bytes to inspect frames or nested TPM values. Scalar fields may be read by value from their big-endian wire representation.
Validation must prove all exposed borrowed views are bounded by the original
input slice. Any malformed length, tag, selector, or trailing byte condition
must be reported as TpmError instead of panicking.
The crate does not use the external zerocopy crate.
Modules§
Macros§
Structs§
- TpmError
Value - Additional structured data for a TPM protocol error.
- TpmWire
- A byte-backed TPM wire view.
- TpmWire
Bytes - A byte-backed TPM wire view with a fixed byte length.
- TpmWriter
- Builds TPM wire bytes into a caller-provided mutable byte slice.
Enums§
- TpmError
- TPM frame marshaling and unmarshaling error type.
Traits§
- TpmCast
- Casts caller-owned bytes into a TPM wire view.
- TpmCast
Mut - Casts caller-owned mutable bytes into a mutable TPM wire view.
- TpmField
- Reads one field from a TPM wire structure.
- TpmMarshal
- TpmSized
- Provides two ways to determine the size of an oBject: a compile-time maximum and a runtime exact size.
- TpmTagged
Field - Reads a union field selected by a previously-read tag.