Expand description
§TPM 2.0 Protocol
A library for building and parsing TCG TPM 2.0 protocol messages.
§Implementation constraints
- The use of
alloc::*is denied. - Minimize unsafe code but can be used for appropriate reasons.
- Panics are not allowed. For unresolvable scenarios use
TpmError::InternalError. - Only Rustdoc comments, no inline comments allowed. I.e. only comments that are related on generating documentation are allowed.
- SPDX and Copyright lines are required and exempt from this rule.
- Enum variants and struct fields follow idiomatic Rust naming conventions
(e.g.,
PascalCaseandsnake_caserespectively). - The string representation for all enums, used for serialization and
parsing, must strictly follow the TCG specification’s
UPPER_SNAKE_CASEnaming (e.g., “TPM_ALG_SHA256”).
Modules§
Macros§
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§
Constants§
- TPM_
MAX_ COMMAND_ SIZE - The maximum size of a TPM command or response buffer.
Traits§
- TpmBuild
- TpmParse
- TpmParse
Tagged - 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.