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§
- integer
- tpm2b
- tpm2b_
struct - tpm_
bitflags - tpm_
bool - tpm_
byte_ view - Generates the unchecked reinterpret casts shared by every
repr(transparent)wire view. - tpm_
dispatch - tpm_
enum - tpm_
struct - tpml
Structs§
- 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.
Functions§
- tpm_
offset - Returns the byte offset of a cursor slice inside a base slice.
- tpm_
value - Widens a
usizecount into theu64carried by value-bearing errors.