Documentation
¶
Overview ¶
Package register contains measurement register-specific implementations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( HashSHA1 = HashAlg(tpm2.AlgSHA1) HashSHA256 = HashAlg(tpm2.AlgSHA256) HashSHA384 = HashAlg(tpm2.AlgSHA384) )
Valid hash algorithms.
Functions ¶
This section is empty.
Types ¶
type FakeMR ¶ added in v0.0.2
FakeMR encapsulates the value of a FakeMR at a point in time.
type FakeMRBank ¶ added in v0.0.2
FakeMRBank is a bank of FakeMRs that all correspond to the same hash algorithm.
func (FakeMRBank) CryptoHash ¶ added in v0.0.2
func (f FakeMRBank) CryptoHash() (crypto.Hash, error)
CryptoHash returns the crypto.Hash algorithm related to the FakeMR bank.
func (FakeMRBank) MRs ¶ added in v0.0.2
func (f FakeMRBank) MRs() []MR
MRs returns a slice of MR from the PCR implementation.
type FakeROT ¶ added in v0.0.2
type FakeROT struct {
// contains filtered or unexported fields
}
FakeROT implements a fake root-of-trust for measurement for test.
func CreateFakeRot ¶ added in v0.0.2
CreateFakeRot creates a fake root-of-trust with banks corresponding to the given hash algorithms, each of size numIdxs.
func (FakeROT) Digest ¶ added in v0.0.2
Digest returns the current digest for the given measurement register indicated by FakeMR.
type HashAlg ¶
type HashAlg uint8
HashAlg identifies a hashing Algorithm. Included for backcompat with the go-attestation API.
func (HashAlg) CryptoHash ¶
CryptoHash turns the hash algo into a crypto.Hash
type MRBank ¶
MRBank is a generic interface for a collection of measurement registers associated with the same hash algorithm.
type PCR ¶
type PCR struct { Index int Digest []byte DigestAlg crypto.Hash // contains filtered or unexported fields }
PCR encapsulates the value of a PCR at a point in time.
func (*PCR) QuoteVerified ¶
QuoteVerified returns true if the value of this PCR was previously verified against a Quote, in a call to AKPublic.Verify or AKPublic.VerifyAll. NOT for use in go-eventlog. Included for backcompat with the go-attestation API.
func (*PCR) SetQuoteVerified ¶
func (p *PCR) SetQuoteVerified()
SetQuoteVerified sets that the quote verified is true. NOT for use in go-eventlog. Included for backcompat with the go-attestation API.
type PCRBank ¶
PCRBank is a bank of PCRs that all correspond to the same hash algorithm.
func (PCRBank) CryptoHash ¶
CryptoHash returns the crypto.Hash algorithm related to the PCR bank.
type RTMR ¶
type RTMR struct { // The RTMR Index, not the CC MR Index. e.g., for RTMR[1], put 1, not 2. Index int Digest []byte }
RTMR encapsulates the value of a TDX runtime measurement register at a point in time. The given RTMR must always have a SHA-384 digest.
func (RTMR) Idx ¶
Idx gives the CC Measurement Register index. This value is the one used in Confidential Computing event logs. Confusingly, MRTD uses CC Measurement Register Index 0, so RTMR0 uses 1. RTMR1 uses 2, and so on. https://cdrdv2-public.intel.com/726792/TDX%20Guest-Hypervisor%20Communication%20Interface_1.5_348552_004%20-%2020230317.pdf https://github.com/cc-api/cc-trusted-vmsdk/issues/50
type RTMRBank ¶
type RTMRBank struct {
RTMRs []RTMR
}
RTMRBank is a bank of RTMRs that all correspond to the SHA-384 algorithm.
func (RTMRBank) CryptoHash ¶
CryptoHash returns the crypto.Hash algorithm related to the RTMR bank.