import type { Generator, HashFn } from './types.js'; /** * Fortuna CSPRNG, spec §9.3-§9.5 * * Use `Fortuna.create({ generator, hash })` to instantiate. Direct construction is not allowed. */ export declare class Fortuna { private static readonly NUM_POOLS; private static readonly RESEED_LIMIT; private static readonly MS_PER_RESEED; private static readonly NODE_STATS_INTERVAL; private static readonly CRYPTO_INTERVAL; private gen; private hash; private poolHash; private poolEntropy; private genKey; private genCnt; private reseedCnt; private lastReseed; private entropyLevel; private eventId; private active; private disposed; private msPerReseed; private robin; private boundCollectors; private timers; static create(opts: { generator: Generator; hash: HashFn; msPerReseed?: number; entropy?: Uint8Array; }): Promise; private constructor(); /** Get n random bytes. Always returns Uint8Array, instance is guaranteed seeded after create(). */ get(length: number): Uint8Array; /** Add external entropy to the pools. */ addEntropy(entropy: Uint8Array): void; /** Get estimated available entropy in bytes. */ getEntropy(): number; /** Permanently dispose this instance. Wipes key material, stops all collectors. */ stop(): void; /** Get length pseudo-random bytes., spec §9.4 */ private pseudoRandomData; /** Reseed the generator, spec §9.4 */ private reseed; /** Drain pool 0 into a fresh seed and reseed. Used by the deterministic * test factory; production reseeds in get() walk the §9.5.5 schedule * across all pools, not just pool 0. Caller is responsible for any * entropy-threshold check. */ private reseedFromPool0; /** Increment little-endian counter., spec §9.4 */ private incrementCounter; /** Add an event to a pool via hash chaining: poolHash[i] = hash(poolHash[i] ‖ eventId ‖ data). */ private addRandomEvent; private initialize; private startCollectors; private stopCollectors; private throttle; private collectorKeyboard; private collectorMouse; private collectorClick; private collectorTouch; private collectorScroll; private collectorMotion; private collectorTime; private collectorDom; private collectorCryptoRandom; private captureHrtime; private collectNodeStats; }