@reclaimprotocol/attestor-core
Version:
<div> <div> <img src="https://raw.githubusercontent.com/reclaimprotocol/.github/main/assets/banners/Attestor-Core.png" /> </div> </div>
105 lines (104 loc) • 3.85 kB
TypeScript
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
export declare const protobufPackage = "tpm";
/** Enum values come from TCG Algorithm Registry - v1.27 - Table 3 */
export declare const ObjectType: {
readonly OBJECT_INVALID: 0;
readonly RSA: 1;
readonly ECC: 35;
readonly UNRECOGNIZED: -1;
};
export type ObjectType = typeof ObjectType[keyof typeof ObjectType];
export declare namespace ObjectType {
type OBJECT_INVALID = typeof ObjectType.OBJECT_INVALID;
type RSA = typeof ObjectType.RSA;
type ECC = typeof ObjectType.ECC;
type UNRECOGNIZED = typeof ObjectType.UNRECOGNIZED;
}
export declare function objectTypeFromJSON(object: any): ObjectType;
export declare function objectTypeToJSON(object: ObjectType): string;
export declare const HashAlgo: {
readonly HASH_INVALID: 0;
readonly SHA1: 4;
readonly SHA256: 11;
readonly SHA384: 12;
readonly SHA512: 13;
readonly UNRECOGNIZED: -1;
};
export type HashAlgo = typeof HashAlgo[keyof typeof HashAlgo];
export declare namespace HashAlgo {
type HASH_INVALID = typeof HashAlgo.HASH_INVALID;
type SHA1 = typeof HashAlgo.SHA1;
type SHA256 = typeof HashAlgo.SHA256;
type SHA384 = typeof HashAlgo.SHA384;
type SHA512 = typeof HashAlgo.SHA512;
type UNRECOGNIZED = typeof HashAlgo.UNRECOGNIZED;
}
export declare function hashAlgoFromJSON(object: any): HashAlgo;
export declare function hashAlgoToJSON(object: HashAlgo): string;
/**
* SealedBytes stores the result of a TPM2_Seal. The private portion (priv) has
* already been encrypted and is no longer sensitive. The hash algorithm is
* assumed to be SHA256.
*/
export interface SealedBytes {
priv: Uint8Array;
pub: Uint8Array;
pcrs: number[];
hash: HashAlgo;
srk: ObjectType;
certifiedPcrs: PCRs | undefined;
creationData: Uint8Array;
ticket: Uint8Array;
}
export interface ImportBlob {
duplicate: Uint8Array;
encryptedSeed: Uint8Array;
publicArea: Uint8Array;
pcrs: PCRs | undefined;
}
export interface Quote {
/** TPM2 quote, encoded as a TPMS_ATTEST */
quote: Uint8Array;
/** TPM2 signature, encoded as a TPMT_SIGNATURE */
rawSig: Uint8Array;
/** PCR values of the bank being quoted */
pcrs: PCRs | undefined;
}
export interface PCRs {
hash: HashAlgo;
pcrs: {
[key: number]: Uint8Array;
};
}
export interface PCRs_PcrsEntry {
key: number;
value: Uint8Array;
}
/** Contains information corresponding an object certified with TPM2_Certify. */
export interface CertifiedBlob {
/** Public area of certified object, encoded as a TPMT_PUBLIC */
pubArea: Uint8Array;
/** TPM2 certification, encoded as a TPMS_ATTEST */
certifyInfo: Uint8Array;
/** TPM2 signature, encoded as a TPMT_Signature */
rawSig: Uint8Array;
}
export declare const SealedBytes: MessageFns<SealedBytes>;
export declare const ImportBlob: MessageFns<ImportBlob>;
export declare const Quote: MessageFns<Quote>;
export declare const PCRs: MessageFns<PCRs>;
export declare const PCRs_PcrsEntry: MessageFns<PCRs_PcrsEntry>;
export declare const CertifiedBlob: MessageFns<CertifiedBlob>;
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 {} ? {
[K in keyof T]?: 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 {};