import type { SlhDsaExports } from './types.js'; import type { SlhDsaParams } from './params.js'; import { type PreHashAlgorithm } from './prehash.js'; /** * Drive slhSignInternal with caller-built M' bytes plus opt_rand. * * Layout written into INPUT (per src/asm/slhdsa/slh.ts §slhSignInternal): * INPUT = sk (4n) ‖ M' (msgLen) ‖ opt_rand (n) * * `sk` must be exactly `params.skBytes` bytes; `optRand` must be exactly * `params.n` bytes. The caller is responsible for those length contracts * (the public surface validates before this driver runs). * * Returns a fresh `sigBytes`-long Uint8Array sliced out of OUT. The * finally block wipes the INPUT region (which held the secret sk and * potentially-secret opt_rand) and calls `wipeBuffers()` on the WASM * module to zero OUT, STATE, SCRATCH. */ export declare function slhSignInternalTs(x: SlhDsaExports, params: SlhDsaParams, sk: Uint8Array, MPrime: Uint8Array, optRand: Uint8Array): Uint8Array; /** * HashSLH-DSA sign, post-prehash. FIPS 205 §10.2.2 Algorithm 23 lines * 18-25. Builds M' = 0x01 ‖ |ctx| ‖ ctx ‖ OID(algo) ‖ prehash and drives * Sign_internal with the caller-supplied opt_rand. * * The caller owns `prehash` (it may be a slice of WASM memory, a * caller-controlled digest, or an internally-computed PH_M); this helper * never wipes it. The caller also owns `optRand` (hedged: caller wipes a * freshly-generated value; deterministic: optRand = PK.seed slice, no * separate wipe; derand: caller-supplied per FIPS 205 §3.4 contract). * * The 12 approved pre-hash functions (`algo`) and their OIDs are FIPS 205 * §10.2.2's catalog (matches FIPS 204 §5.4.1 byte-for-byte). Domain-sep * byte 0x01 inside the M' construction separates HashSLH-DSA signatures * from pure-SLH-DSA signatures on the same key per the §10.2 narrative. * * signWithPrehash is duplicated from `src/ts/mldsa/sign.ts:signWithPrehash`; * extraction is deferred until a third consumer materialises. */ export declare function signWithPrehash(x: SlhDsaExports, params: SlhDsaParams, sk: Uint8Array, prehash: Uint8Array, algo: PreHashAlgorithm, ctx: Uint8Array, optRand: Uint8Array): Uint8Array;