import type { Hasher, MerkleTree } from './tree.js'; import type { MerkleStorage } from './storage.js'; /** * RFC 9162 ยง2.1.1, Merkle Hash Trees. The CT-flavoured SHA-256 hash * function: empty-tree value `MTH({}) = SHA-256()`, leaf prefix `0x00`, * internal-node prefix `0x01`. * * Stateless and reentrant: each method takes the sha2 module fresh, * runs SHA-256 once, and releases. No `dispose()` is needed. */ export declare const Sha256Hasher: Hasher; /** * Stateful SHA-256 Merkle log. Stores leaf hashes and every perfect * aligned internal subtree's hash via the injected `MerkleStorage`; * partial right-edge subtrees are recomputed on demand from the * stored perfect subtrees. * * Constructed empty. `append` is the only mutator and is the leaf-hash * factory; consumers feed leaf bytes, not pre-computed leaf hashes. */ export declare class Sha256Tree implements MerkleTree { readonly hasher: Hasher; private readonly storage; constructor(storage: MerkleStorage); size(): number; rootHash(): Uint8Array; append(leafBytes: Uint8Array): { leafIndex: number; leafHash: Uint8Array; }; getInclusionProof(leafIndex: number, treeSize?: number): Uint8Array[]; getConsistencyProof(oldSize: number, newSize: number): Uint8Array[]; }