tpm-rs
About
TPM 2.0 Implementation in Rust
Status
This is an early development environment and is currently very unstable - Everything is subject to change, perhaps on a daily basis.
Building & Testing
Building and testing tpm-rs is the same as other Cargo projects:
# Just build the project
cargo build
# Run most of the tests (excluding simulator tests)
cargo test
Simulator Tests
Simulator tests use the TPM simulator provided by TCG to test the TPM client against a running simulation. This depends on having the TPM simulator built.
There is a Dockerfile that can build this for you, making the process easier:
# Build the simulator, and run only the simulator tests
cd client && docker compose run --rm simulator_tests
Contributing
- You can explore the code by viewing the autogenerated documentation for the main branch here.
- You can read our detailed coding style and contribution guide here.
- Please file suggestions, issues, or designs to the issues page.
- If you wish to work on an issue but have not seen much activity on it, just comment on the issue to see what would be needed to get started.
- You can see good first issues for a list of issues that may be good for beginners.
Test-Driven PRs
Good test coverage is key to code velocity and reliability. The easiest way to maintain good test coverage is to require it from the beginning. Since we are starting from a green field, we treat test coverage as a first-class feature that underpins all others.
Hence, any PR for code needs meaningful tests, and those tests need to be integrated into our CI pipeline.