/**
 * `@shade/key-transparency` — verifiable prekey distribution (V3.12).
 *
 * Public surface:
 *  - Hash primitives: `leafHash`, `nodeHash`, `computeBundleHash`, `encodeLeafData`.
 *  - Merkle log: `MerkleLog`, `auditPath`, `recomputeRootFromAuditPath`,
 *    `consistencyProof`, `verifyConsistencyProof`.
 *  - Address index: `AddressIndex`, `verifyInclusionProof`, `verifyAbsenceProof`.
 *  - Signed Tree Head: `SignedTreeHead`, `signSth`, `verifySthSignature`,
 *    `canonicalSthBytes`, `computeLogId`, `STHWire`.
 *  - Bundle proofs: `KTProof`, `verifyBundleInclusion`, `verifyBundleAbsence`,
 *    `verifyBundleTombstone`, `ktProofToWire`, `ktProofFromWire`.
 *  - Manager (server-side orchestration): `KTLogManager`.
 *  - Stores: `KTLogStore` interface + `MemoryKTLogStore`.
 *  - Witness: `LightWitness`, `WitnessFetcher`.
 *  - Errors: `KTError` and subclasses.
 */

export {
  DOMAIN_BUNDLE,
  DOMAIN_STH,
  OP_DELETE,
  OP_REGISTER,
  OP_REPLENISH,
  computeBundleHash,
  emptyRootHash,
  encodeLeafData,
  leafHash,
  nodeHash,
} from './hashes.js';

export {
  MerkleLog,
  auditPath,
  consistencyProof,
  mth,
  recomputeRootFromAuditPath,
  verifyConsistencyProof,
} from './log.js';

export {
  AddressIndex,
  compareAddresses,
  computeIndexRoot,
  encodeIndexEntry,
  verifyAbsenceProof,
  verifyInclusionProof,
} from './index-tree.js';
export type {
  AddressIndexEntry,
  IndexAbsenceProof,
  IndexInclusionProof,
  IndexProof,
} from './index-tree.js';

export {
  canonicalSthBytes,
  computeLogId,
  signSth,
  sthFromWire,
  sthToWire,
  verifySthSignature,
} from './sth.js';
export type { SignedTreeHead, STHWire } from './sth.js';

export {
  ktProofFromWire,
  ktProofToWire,
  verifyBundleAbsence,
  verifyBundleInclusion,
  verifyBundleTombstone,
} from './proof.js';
export type {
  KTBundleAbsenceProof,
  KTBundleInclusionProof,
  KTBundleTombstoneProof,
  KTProof,
  KTProofBody,
  KTProofWire,
  KTVerifyOptions,
} from './proof.js';

export { KTLogManager } from './manager.js';
export type { KTLogManagerOptions } from './manager.js';

export { MemoryKTLogStore } from './memory-store.js';
export type { KTLogLeaf, KTLogStore } from './store.js';

export { LightWitness } from './witness.js';
export type { LightWitnessOptions, WitnessFetcher, WitnessObservation } from './witness.js';

export {
  KTError,
  KTLogIdMismatchError,
  KTSplitViewError,
  KTStaleSTHError,
  KTVerificationError,
} from './errors.js';

export { fromBase64 as ktFromBase64, toBase64 as ktToBase64 } from './util.js';
