/** * Compute the leaf hash for a log entry (RFC 6962 §2.1). * leafHash(entry) = SHA-256(0x00 || entry) */ export declare function leafHash(entryBytes: Uint8Array): Uint8Array; /** * Compute the internal node hash (RFC 6962 §2.1). * nodeHash(left, right) = SHA-256(0x01 || left || right) */ export declare function nodeHash(left: Uint8Array, right: Uint8Array): Uint8Array; /** * Compute the Merkle Tree Hash for a list of leaves (RFC 6962 §2.1). * * - Empty tree: throws (no root is defined for an empty tree) * - Single leaf: returns leafHash(leaves[0]) * - n > 1: split at k = largestPowerOfTwoLessThan(n), * recursively compute left = MTH(leaves[0..k-1]) and right = MTH(leaves[k..n-1]), * return nodeHash(left, right) * * The input is raw entry bytes (not pre-hashed leaves). */ export declare function computeRoot(leaves: Uint8Array[]): Uint8Array; /** * Generate an inclusion proof for the leaf at `index` in a tree of `leaves`. * * The proof is an array of sibling hashes from leaf to root. The verifier * re-derives the path using the same tree decomposition and combines each * sibling to reconstruct the root. * * Input is raw entry bytes (not pre-hashed). */ export declare function computeInclusionProof(index: number, leaves: Uint8Array[]): Uint8Array[]; /** * Verify an inclusion proof (RFC 6962 §2.1.3). * * @param index - 0-based leaf index * @param treeSize - total number of leaves in the tree * @param leafHashValue - SHA-256(0x00 || entry), i.e. the pre-computed leaf hash * @param proof - array of sibling hashes from leaf to root * @param expectedRoot - the known-good Merkle root to verify against * * Uses constant-time comparison (bitwise OR accumulation) for the final root * check to resist timing attacks. */ export declare function verifyInclusion(index: number, treeSize: number, leafHashValue: Uint8Array, proof: Uint8Array[], expectedRoot: Uint8Array): boolean; //# sourceMappingURL=merkle.d.ts.map