Crate tpm2_protocol

Source
Expand description

§TPM 2.0 Protocol

A library for building and parsing TCG TPM 2.0 protocol messages.

§Implementation constraints

  1. The use of alloc::* is denied.
  2. Minimize unsafe code but can be used for appropriate reasons.
  3. Panics are not allowed. For unresolvable scenarios use TpmError::InternalError.
  4. Only Rustdoc comments, no inline comments allowed. I.e. only comments that are related on generating documentation are allowed.
  5. SPDX and Copyright lines are required and exempt from this rule.
  6. Enum variants and struct fields follow idiomatic Rust naming conventions (e.g., PascalCase and snake_case respectively).
  7. The string representation for all enums, used for serialization and parsing, must strictly follow the TCG specification’s UPPER_SNAKE_CASE naming (e.g., “TPM_ALG_SHA256”).

Modules§

data
macro
message

Macros§

tpm2b
tpm2b_struct
tpm_bitflags
tpm_bool
tpm_dispatch
tpm_enum
tpm_handle
tpm_response
tpm_struct
tpml

Structs§

TpmBuffer
TpmList
TpmParameters
A helper for parsing data from a TPM parameter buffer, which is prefixed with a u32 size.
TpmPersistent
TpmSession
TpmTransient
TpmWriter
Writes into a mutable byte slice.

Enums§

TpmErrorKind

Constants§

TPM_MAX_COMMAND_SIZE
The maximum size of a TPM command or response buffer.

Traits§

TpmBuild
TpmParse
TpmParseTagged
Parses a tagged object from a buffer.
TpmSized
Provides two ways to determine the size of an object: a compile-time maximum and a runtime exact size.
TpmTagged
Types that are composed of a tag and a value e.g., a union.

Functions§

build_tpm2b
Builds a TPM2B sized buffer.
parse_tpm2b
Parses a TPM2B sized buffer.
tpm_hash_size
Returns the size of a hash digest in bytes for a given hash algorithm.

Type Aliases§

TpmResult