import type { Address } from 'viem'; import type { AttestedComputeRequest, AttestedComputeResponse, AttestedDecryptResponse, AttestedRevealResponse, EListAttestedDecryptResponse, EListAttestedRevealResponse, DecryptionAttestation as ProtoDecryptionAttestation } from '../generated/es/inco/kms/lite/v1/kms_service_pb.js'; import type { XwingKeypair } from '../lite/xwing.js'; /** * Computes a canonical key for a single attestation. * For plaintext/reencryption+keypair, the key is handle:hex(value). * For reencryption without a keypair (XWing ciphertexts are non-deterministic), * falls back to handle:op-type as a structural stand-in. */ export declare function computeAttestationKey(att: ProtoDecryptionAttestation, reencryptKeypair?: XwingKeypair): Promise; /** * Validates that all responses in a winning bucket have the same attestation * count and types as the quorum-elected reference (bucket[0]). */ export declare function validateDecryptResponseStructure(bucket: Array<{ response: T; signer: Address; }>): void; /** * Validates that all responses in a winning bucket have a decryption * attestation with the same case as the quorum-elected reference (bucket[0]), * and that the case is consistent with the request's reencryptPubKey. */ export declare function validateComputeResponseStructure(bucket: Array<{ response: AttestedComputeResponse; signer: Address; }>, request?: AttestedComputeRequest): void; /** * Verifies decrypt/reveal response consistency using hash-bucket voting. * Collects all N responses, buckets them by content key, and returns the * winning bucket (the first one with >= threshold votes). * * This is robust against a faulty first-responding node: even if responses[0] * disagrees, a quorum of agreeing responses will form a winning bucket. */ export declare function verifyDecryptResponseConsistency(allResults: Array<{ response: T; signer: Address; }>, threshold: number, reencryptKeypair?: XwingKeypair): Promise<{ reference: T; winningResults: Array<{ response: T; signer: Address; }>; }>; type EListResponse = EListAttestedDecryptResponse | EListAttestedRevealResponse; /** * Validates that all elist responses in a winning bucket have the same * number of values and matching indices. */ export declare function validateEListResponseStructure(bucket: Array<{ response: T; signer: Address; }>): void; /** * Verifies elist response consistency using hash-bucket voting. * Works for both EListAttestedDecryptResponse and EListAttestedRevealResponse. */ export declare function verifyEListResponseConsistency(allResults: Array<{ response: T; signer: Address; }>, threshold: number, reencryptKeypair?: XwingKeypair): Promise<{ reference: T; winningResults: Array<{ response: T; signer: Address; }>; }>; /** * Verifies compute response consistency using hash-bucket voting. */ export declare function verifyComputeResponseConsistency(allResults: Array<{ response: AttestedComputeResponse; signer: Address; }>, threshold: number, request?: AttestedComputeRequest, reencryptKeypair?: XwingKeypair): Promise<{ reference: AttestedComputeResponse; winningResults: Array<{ response: AttestedComputeResponse; signer: Address; }>; }>; export {};