/** * Entanglement Layer * * Implements the cryptographic binding that makes kMOSAIC's three problems inseparable. * - Information-theoretic secret sharing (XOR-based 3-of-3) * - Cross-component binding using hash commitments * - NIZK proofs of correct construction * * Security Properties: * - Secret sharing: Information-theoretic security (n-1 shares reveal nothing) * - Commitments: Computationally hiding and binding (SHA3-256 based) * - NIZK: Zero-knowledge via Fiat-Shamir with domain separation */ /** * Split a secret into n shares where all n are required to reconstruct (n-of-n XOR sharing) * * Security: Information-theoretic - any n-1 shares reveal no information about the secret. * This is because each share (except the last) is uniformly random. * * @param secret - Secret to split * @param n - Number of shares * @returns Array of shares */ export declare function secretShare(secret: Uint8Array, n: number): Uint8Array[]; /** * Reconstruct secret from n shares (all required) * * Note: This is constant-time in the share values but not in the number of shares. * * @param shares - Array of shares * @returns Reconstructed secret */ export declare function secretReconstruct(shares: Uint8Array[]): Uint8Array; /** * Deterministic secret sharing from seed (for re-encryption verification) * * Security: Shares are pseudorandom (computational security) rather than * truly random (information-theoretic). Use only when determinism is required. * * @param secret - Secret to split * @param n - Number of shares * @param seed - Random seed * @returns Array of shares */ export declare function secretShareDeterministic(secret: Uint8Array, n: number, seed: Uint8Array): Uint8Array[]; export interface BindingCommitment { commitment: Uint8Array; opening: Uint8Array; } /** * Create a binding commitment to data * * Security: Based on SHA3-256 with domain separation. * - Hiding: Computationally hiding (opening is random) * - Binding: Computationally binding (collision resistance of SHA3) * * @param data - Data to commit to * @returns Commitment and opening */ export declare function createCommitment(data: Uint8Array): BindingCommitment; /** * Verify a binding commitment * * Constant-time comparison to prevent timing attacks. * * @param data - Data to verify * @param commitment - Commitment hash * @param opening - Opening value * @returns True if valid */ export declare function verifyCommitment(data: Uint8Array, commitment: Uint8Array, opening: Uint8Array): boolean; /** * Compute cross-component binding hash * * This creates the circular dependency that entangles all three problems. * An attacker must break ALL components simultaneously since modifying * any component changes the binding hash. * * Security: Domain separation ensures independence from other hash uses. * * @param slssData - SLSS component data * @param tddData - TDD component data * @param egrwData - EGRW component data * @returns Binding hash */ export declare function computeBinding(slssData: Uint8Array, tddData: Uint8Array, egrwData: Uint8Array): Uint8Array; export interface NIZKProof { challenge: Uint8Array; responses: Uint8Array[]; commitments: Uint8Array[]; } /** * Generate NIZK proof that ciphertexts are correctly formed * * This is a sigma protocol using Fiat-Shamir transform with strong binding. * The proof demonstrates knowledge of shares that: * 1. XOR to reconstruct the original message * 2. Are correctly encrypted in the corresponding ciphertexts * * Security: * - Zero-knowledge: Responses are masked, revealing nothing about shares * - Soundness: Challenge binds commitments to message and ciphertext hashes * - Non-malleability: Domain separation prevents cross-protocol attacks * * @param message - Original message * @param shares - Message shares * @param ciphertextHashes - Hashes of ciphertexts * @param randomness - Randomness for proof generation * @returns NIZK proof */ export declare function generateNIZKProof(message: Uint8Array, shares: Uint8Array[], ciphertextHashes: Uint8Array[], randomness: Uint8Array): NIZKProof; /** * Verify NIZK proof * * Verifies that the prover knows shares that are correctly committed * and bound to the claimed ciphertexts. * * Security: All comparisons are constant-time to prevent timing attacks. * * @param proof - NIZK proof * @param ciphertextHashes - Hashes of ciphertexts * @param messageHash - Hash of message * @returns True if valid */ export declare function verifyNIZKProof(proof: NIZKProof, ciphertextHashes: Uint8Array[], message: Uint8Array): boolean; /** * Serialize NIZK proof * * @param proof - NIZK proof * @returns Serialized bytes */ export declare function serializeNIZKProof(proof: NIZKProof): Uint8Array; /** * Deserialize NIZK proof * * Security: Strict validation of all bounds and expected structure * * @param data - Serialized bytes * @returns NIZK proof */ export declare function deserializeNIZKProof(data: Uint8Array): NIZKProof; //# sourceMappingURL=index.d.ts.map