Skip to main content

Crate tpm2_protocol

Crate tpm2_protocol 

Source
Expand description

§TPM 2.0 Protocol

A library for marshaling and unmarshaling TCG TPM 2.0 protocol messages.

§Constraints

  • alloc is 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§

basic
constant
data
frame
macro

Macros§

integer
tpm2b
tpm2b_struct
tpm_bitflags
tpm_bool
tpm_dispatch
tpm_enum
tpm_struct
tpml

Structs§

TpmErrorValue
Additional structured data for a TPM protocol error.
TpmWire
A byte-backed TPM wire view.
TpmWireBytes
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.
TpmCastMut
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.
TpmTaggedField
Reads a union field selected by a previously-read tag.

Type Aliases§

TpmResult