feat: add single PCR read functionality

The `tpm_pcr_read_single` function required the following params:
- PCR index value
- The hash algorithm value (TPM_ALG_<TYPE> as seen in TCG TPM2 structure
  spec)
- `pcr_digest_read` buffer that returns the digest read back from the
  PCR.
- `pcr_digest_read_len` length of the byte buffer passed in to the read
  the digest

Change-Id: I7f37ea58a7578e1d715f16fd8d4977f34a48507d
Signed-off-by: Mudit Sharma <mudit.sharma@arm.com>
3 files changed
tree: 7b8d0519614de47ec8f88daf098ea868dc42cfef
  1. include/
  2. src/
  3. test/
  4. .clang-format
  5. .editorconfig
  6. .gitignore
  7. CMakeLists.txt
  8. dco.txt
  9. LICENSE
  10. README.md
  11. tpm2Config.cmake.in
README.md

libtcg2-tpm

TCG2-compliant TPM library based on the TCG PC Client Platform TPM Profile for TPM 2.0 Specification v1.06.

This library provides a lightweight C interface for interacting with TPM 2.0 devices, specifically targeting platforms compliant with the TCG2 specification.

Prerequisites

  • CMake >= 3.15
  • AArch64 Linux GNU toolchain (for cross-compilation)

Building

Native Build

cmake -B build
cmake --build build

Cross Compilation

CC=aarch64-linux-gnu-gcc cmake -B build -DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY
cmake --build build

License

This project is licensed under the BSD 3-Clause License. See the LICENSE file for more information.