/** * cSHAKE128, customizable SHAKE128 (SP 800-185 §3). * * Holds exclusive access to the `sha3` WASM module from construction until * `dispose()`. Constructing any other sha3 user (SHAKE128/256, SHA3_*, * KMAC*, CSHAKE*) while this instance is live throws. */ export declare class CSHAKE128 { private readonly x; private readonly _rate; private readonly _prefix; private _squeezing; private _block; private _blockPos; private _tok; constructor(customization: Uint8Array); reset(): this; absorb(msg: Uint8Array): this; squeeze(n: number): Uint8Array; hash(msg: Uint8Array, outputLength: number): Uint8Array; dispose(): void; } /** * cSHAKE256, customizable SHAKE256 (SP 800-185 §3). * * Holds exclusive access to the `sha3` WASM module from construction until * `dispose()`. */ export declare class CSHAKE256 { private readonly x; private readonly _rate; private readonly _prefix; private _squeezing; private _block; private _blockPos; private _tok; constructor(customization: Uint8Array); reset(): this; absorb(msg: Uint8Array): this; squeeze(n: number): Uint8Array; hash(msg: Uint8Array, outputLength: number): Uint8Array; dispose(): void; } /** * KMAC128, keyed Keccak MAC, fixed-output (SP 800-185 §4). * * Bound to a specific output length at construction (the spec's right_encode(L) * suffix is a function of L). Use `KMACXOF128` for arbitrary-length output. * * Holds exclusive access to the `sha3` WASM module from construction until * `dispose()`. */ export declare class KMAC128 { private readonly x; private readonly _rate; private readonly _outLen; private _finalized; private _tok; constructor(key: Uint8Array, outLen: number, customization: Uint8Array); update(chunk: Uint8Array): this; finalize(): Uint8Array; mac(msg: Uint8Array): Uint8Array; dispose(): void; /** * Constant-time tag verification. Throws `AuthenticationError('kmac128')` * on mismatch (matches the lib's AEAD pattern). Returns `true` on success. * * Atomic, does not hold the sha3 module beyond the internal compute. */ static verify(tag: Uint8Array, key: Uint8Array, msg: Uint8Array, customization: Uint8Array): true; } /** * KMAC256, 256-bit-strength keyed Keccak MAC, fixed-output (SP 800-185 §4). */ export declare class KMAC256 { private readonly x; private readonly _rate; private readonly _outLen; private _finalized; private _tok; constructor(key: Uint8Array, outLen: number, customization: Uint8Array); update(chunk: Uint8Array): this; finalize(): Uint8Array; mac(msg: Uint8Array): Uint8Array; dispose(): void; static verify(tag: Uint8Array, key: Uint8Array, msg: Uint8Array, customization: Uint8Array): true; } /** * KMACXOF128, XOF variant of KMAC128 (SP 800-185 §4.3.1). Output length * is caller-chosen per squeeze; the spec's right_encode(0) suffix marks the * XOF mode. */ export declare class KMACXOF128 { private readonly x; private readonly _rate; private _squeezing; private _block; private _blockPos; private _tok; constructor(key: Uint8Array, customization: Uint8Array); update(chunk: Uint8Array): this; squeeze(n: number): Uint8Array; mac(msg: Uint8Array, outLen: number): Uint8Array; dispose(): void; } /** * KMACXOF256, XOF variant of KMAC256 (SP 800-185 §4.3.1). */ export declare class KMACXOF256 { private readonly x; private readonly _rate; private _squeezing; private _block; private _blockPos; private _tok; constructor(key: Uint8Array, customization: Uint8Array); update(chunk: Uint8Array): this; squeeze(n: number): Uint8Array; mac(msg: Uint8Array, outLen: number): Uint8Array; dispose(): void; }