UNPKG

@reclaimprotocol/attestor-core

Version:

<div> <div> <img src="https://raw.githubusercontent.com/reclaimprotocol/.github/main/assets/banners/Attestor-Core.png" /> </div> </div>

25 lines (24 loc) 1 kB
/** * TEE OPRF Verification and Replacement * Verifies OPRF proofs and replaces ranges in reconstructed plaintext */ import type { OPRFVerificationData } from '../../proto/tee-bundle.ts'; import type { TeeBundleData } from '../../server/utils/tee-verification.ts'; import type { Logger } from '../../types/general.ts'; export interface OprfVerificationResult { position: number; length: number; output: Uint8Array; isMPC?: boolean; } /** * Verifies all OPRF proofs in the bundle and returns replacement data */ export declare function verifyOprfProofs(bundleData: TeeBundleData & { oprfVerifications?: OPRFVerificationData[]; }, logger: Logger): Promise<OprfVerificationResult[]>; /** * Replaces OPRF ranges in the reconstructed plaintext with verified outputs. * Properly expands or contracts the transcript to fit replacement hashes. */ export declare function replaceOprfRanges(plaintext: Uint8Array, oprfResults: OprfVerificationResult[], logger: Logger): Uint8Array;