@reclaimprotocol/attestor-core
Version:
<div> <div> <img src="https://raw.githubusercontent.com/reclaimprotocol/.github/main/assets/banners/Attestor-Core.png" /> </div> </div>
262 lines (261 loc) • 11.8 kB
TypeScript
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
import { GMESState } from "./state.ts";
export declare const protobufPackage = "confidential_space";
/** Enumerates the supported GPU architecture types. */
export declare const GpuArchitectureType: {
/** GPU_ARCHITECTURE_TYPE_UNSPECIFIED - Unspecified GPU architecture type. */
readonly GPU_ARCHITECTURE_TYPE_UNSPECIFIED: 0;
/** GPU_ARCHITECTURE_TYPE_HOPPER - Hopper GPU architecture type. */
readonly GPU_ARCHITECTURE_TYPE_HOPPER: 8;
/** GPU_ARCHITECTURE_TYPE_BLACKWELL - Blackwell GPU architecture type. */
readonly GPU_ARCHITECTURE_TYPE_BLACKWELL: 10;
readonly UNRECOGNIZED: -1;
};
export type GpuArchitectureType = typeof GpuArchitectureType[keyof typeof GpuArchitectureType];
export declare namespace GpuArchitectureType {
type GPU_ARCHITECTURE_TYPE_UNSPECIFIED = typeof GpuArchitectureType.GPU_ARCHITECTURE_TYPE_UNSPECIFIED;
type GPU_ARCHITECTURE_TYPE_HOPPER = typeof GpuArchitectureType.GPU_ARCHITECTURE_TYPE_HOPPER;
type GPU_ARCHITECTURE_TYPE_BLACKWELL = typeof GpuArchitectureType.GPU_ARCHITECTURE_TYPE_BLACKWELL;
type UNRECOGNIZED = typeof GpuArchitectureType.UNRECOGNIZED;
}
export declare function gpuArchitectureTypeFromJSON(object: any): GpuArchitectureType;
export declare function gpuArchitectureTypeToJSON(object: GpuArchitectureType): string;
export interface GpuInfo {
/** The unique identifier of the GPU. */
uuid: string;
/** Driver version obtained from the GPU's attestation report. */
driverVersion: string;
/** VBIOS version obtained from the GPU's attestation report. */
vbiosVersion: string;
/** The architecture type of the GPU. */
gpuArchitectureType: GpuArchitectureType;
/** The verified attestation certificate chain for the GPU device. */
attestationCertificateChain: Uint8Array;
/**
* This field contains SPDM request/response defined in
* https://www.dmtf.org/sites/default/files/standards/documents/DSP0274_1.1.0.pdf
*/
attestationReport: Uint8Array;
}
/**
* An Nvidia attestation report for GPU and NVSwitch devices.
* Contains necessary attestation evidence that the client collects for
* verification.
*/
export interface NvidiaAttestationReport {
/** Single GPU Passthrough (SPT) attestation. */
spt?: NvidiaAttestationReport_SinglePassthroughAttestation | undefined;
/** Multi-GPU Secure Passthrough (MPT) attestation. */
mpt?: NvidiaAttestationReport_MultiGpuSecurePassthroughAttestation | undefined;
/** The nonce used for GPU attestation. */
nonce: Uint8Array;
}
/** Single GPU Passthrough (SPT) attestation. */
export interface NvidiaAttestationReport_SinglePassthroughAttestation {
/** Single GPU quote. */
gpuQuote: GpuInfo | undefined;
}
/**
* MultiGpuSecurePassthroughAttestation contains the attestation evidence
* for a Multi-GPU Secure Passthrough (MPT) attestation.
*/
export interface NvidiaAttestationReport_MultiGpuSecurePassthroughAttestation {
/** A list of GPU quotes. */
gpuQuotes: GpuInfo[];
}
export interface DeviceAttestationReport {
/** An Nvidia attestation report for GPU and NVSwitch devices. */
nvidiaReport?: NvidiaAttestationReport | undefined;
}
export interface TdxCcelQuote {
/**
* The CCEL event log. Formatted as described in the UEFI 2.10.
* Contains events for guest OS boot.
*/
ccelBootEventLog: Uint8Array;
/**
* Formatted as a Canonical Event Log.
* The event log containing Attested COS launcher events.
*/
celLaunchEventLog: Uint8Array;
/**
* The TDX attestation quote from the guest. A serialized Quote
* from https://github.com/google/go-tdx-guest/blob/main/proto/tdx.proto
*/
tdQuote: Uint8Array;
}
export interface VmAttestationQuote {
/** A TDX with CCEL and RTMR Attestation Quote. */
tdxCcelQuote?: TdxCcelQuote | undefined;
/** A standalone vTPM Attestation Quote. */
tpmQuote?: TpmQuote | undefined;
}
/** Represents an attestation over a challenge provided by the workload. */
export interface VmAttestation {
/** Chosen by WSD. */
label: Uint8Array;
/** Provided by the workload. */
challenge: Uint8Array;
/** Optional, provided by WSD. */
extraData: Uint8Array;
/** report_data is `SHA512(label || SHA512(challenge || SHA512(extra_data)))` */
quote: VmAttestationQuote | undefined;
/** Runtime attestations for attached devices. */
deviceReports: DeviceAttestationReport[];
}
export interface KeyAttestation {
/**
* label is "KEY_ATTESTATION" (defined as KeyAttestationLabel constant).
* extra_data is a binary-serialized instance of KeyClaims.
*/
attestation: VmAttestation | undefined;
}
/** Container for keys whose protection mechanism is KEY_PROTECTION_VM. */
export interface VmProtectedKeyEndorsement {
/** Contains a VmProtectionBindingClaims. */
bindingKeyAttestation: KeyAttestation | undefined;
/** Contains a VmProtectionKeyClaims. */
protectedKeyAttestation: KeyAttestation | undefined;
}
/** Container message for endorsing keys with various levels of protection. */
export interface KeyEndorsement {
vmProtectedKeyEndorsement?: VmProtectedKeyEndorsement | undefined;
}
/** Host and vTPM attestation evidence */
export interface TpmAttestationEndorsement {
/** An attestation key (AK) certificate and cert chain. */
akCertEndorsement?: TpmAttestationEndorsement_AkCertEndorsement | undefined;
/** Endorsement certificate chain for the Titan chip. */
titanEndorsement?: TpmAttestationEndorsement_TitanEndorsement | undefined;
}
/** An attestation key (AK) certificate and cert chain. */
export interface TpmAttestationEndorsement_AkCertEndorsement {
/** An attestation key (AK) certificate. */
akCert: Uint8Array;
/**
* List of DER-encoded X.509 certificates which, together with the ak_cert,
* chain back to a trusted Root Certificate.
*/
akCertChain: Uint8Array[];
}
export interface TpmAttestationEndorsement_TitanEndorsement {
/**
* Certificate signed by Titan's DICE alias key over the EK used to generate
* the quotes. On Titan, the EK is a signing key that can be used directly.
*/
ekCert: Uint8Array;
/** Certificate chain rooted by Titan's DeviceID public key. */
diceCertChain: Uint8Array;
}
export interface TpmQuote {
/** Generated by calling TPM2_Quote on each PCR bank. */
quotes: TpmQuote_SignedQuote[];
/**
* The binary TCG Event Log containing events measured into the TPM by the
* platform firmware and operating system. Formatted as described in the
* "TCG PC Client Platform Firmware Profile Specification" as a series of
* TCG_PCR_EVENT2 entries.
*/
pcclientBootEventLog: Uint8Array;
/**
* Formatted as a Canonical Event Log.
* The event log containing Attested COS launcher events.
*/
celLaunchEventLog: Uint8Array;
/** Endorsement for the TPM attestation. */
endorsement: TpmAttestationEndorsement | undefined;
}
export interface TpmQuote_SignedQuote {
/** Encoded as a TPM_ALG_ID. */
hashAlgorithm: number;
/** Raw binary values of each PCR being quoted. */
pcrValues: {
[]: Uint8Array;
};
/** Contains a TPMS_QUOTE_INFO. */
tpmsAttest: Uint8Array;
/** Contains the signature. */
tpmtSignature: Uint8Array;
}
export interface TpmQuote_SignedQuote_PcrValuesEntry {
key: number;
value: Uint8Array;
}
/**
* Provides attestations for values not present in PCRs. For example, the Titan
* TPM on certain platforms is electrically integrated such that it can report,
* via reserved NV index, the number of warm resets the CPU has undergone since
* the last power cycle.
*
* Each signature within this message can be verified using the TpmQuote's
* `endorsement` field.
*/
export interface TpmAuxiliaryAttestation {
/** The signed attestations over the NV indices. */
signedNvs: TpmAuxiliaryAttestation_SignedNvCertify[];
}
export interface TpmAuxiliaryAttestation_SignedNvCertify {
/** Used to compute the Name of the NV index. */
tpmsNvPublic: Uint8Array;
/** Contains a TPMS_NV_CERTIFY_INFO. */
tpmsAttest: Uint8Array;
/** Contains the signature. */
tpmtSignature: Uint8Array;
}
export interface HostAttestation {
/** Shall be "HOST_ATTESTATION" (defined as HostAttestationLabel constant). */
label: Uint8Array;
/** Provided by the workload. */
challenge: Uint8Array;
/** Shall be empty (set by WSD, present for future expansion). */
extraData: Uint8Array;
/**
* Within each of the below fields, the TPMS_ATTEST's extraData contains
* `SHA256(label || SHA256(challenge || SHA256(extra_data)))`
*/
tpmQuote: TpmQuote | undefined;
/** Auxiliary information not stored in PCRs, such as warm reset data. */
auxAttestation: TpmAuxiliaryAttestation | undefined;
}
export interface HostACOSState {
/** The Google Measurement State of the host machine. */
gmes: GMESState | undefined;
/** The TDX CPU PIID. */
cpuPiid: Uint8Array;
/** Number of warm resets since the last power cycle. */
warmResetCount: bigint;
}
export declare const GpuInfo: MessageFns<GpuInfo>;
export declare const NvidiaAttestationReport: MessageFns<NvidiaAttestationReport>;
export declare const NvidiaAttestationReport_SinglePassthroughAttestation: MessageFns<NvidiaAttestationReport_SinglePassthroughAttestation>;
export declare const NvidiaAttestationReport_MultiGpuSecurePassthroughAttestation: MessageFns<NvidiaAttestationReport_MultiGpuSecurePassthroughAttestation>;
export declare const DeviceAttestationReport: MessageFns<DeviceAttestationReport>;
export declare const TdxCcelQuote: MessageFns<TdxCcelQuote>;
export declare const VmAttestationQuote: MessageFns<VmAttestationQuote>;
export declare const VmAttestation: MessageFns<VmAttestation>;
export declare const KeyAttestation: MessageFns<KeyAttestation>;
export declare const VmProtectedKeyEndorsement: MessageFns<VmProtectedKeyEndorsement>;
export declare const KeyEndorsement: MessageFns<KeyEndorsement>;
export declare const TpmAttestationEndorsement: MessageFns<TpmAttestationEndorsement>;
export declare const TpmAttestationEndorsement_AkCertEndorsement: MessageFns<TpmAttestationEndorsement_AkCertEndorsement>;
export declare const TpmAttestationEndorsement_TitanEndorsement: MessageFns<TpmAttestationEndorsement_TitanEndorsement>;
export declare const TpmQuote: MessageFns<TpmQuote>;
export declare const TpmQuote_SignedQuote: MessageFns<TpmQuote_SignedQuote>;
export declare const TpmQuote_SignedQuote_PcrValuesEntry: MessageFns<TpmQuote_SignedQuote_PcrValuesEntry>;
export declare const TpmAuxiliaryAttestation: MessageFns<TpmAuxiliaryAttestation>;
export declare const TpmAuxiliaryAttestation_SignedNvCertify: MessageFns<TpmAuxiliaryAttestation_SignedNvCertify>;
export declare const HostAttestation: MessageFns<HostAttestation>;
export declare const HostACOSState: MessageFns<HostACOSState>;
type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;
export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
[]?: DeepPartial<T[K]>;
} : Partial<T>;
export interface MessageFns<T> {
encode(message: T, writer?: BinaryWriter): BinaryWriter;
decode(input: BinaryReader | Uint8Array, length?: number): T;
fromJSON(object: any): T;
toJSON(message: T): unknown;
create(base?: DeepPartial<T>): T;
fromPartial(object: DeepPartial<T>): T;
}
export {};