/** * Unlock-derivation parameters, one variant per KDF family: Argon2id * (memory-hard) stretches a low-entropy passphrase; HKDF expands * already-uniform key material (e.g. a passkey PRF output). Each unlock method * pins its own parameter set -- and its own salt, so two methods can never * derive the same unlock identity. The `version` is one counter per unlock * method, recording which parameter set produced that method's derivation; * the keyring record's own `version` is stamped separately. * * The Argon2id arm carries no `hash` member: Argon2 fixes Blake2b internally. * `memory` is in KiB (RFC 9106's and noble's unit); the RFC's `m` / `t` / `p` * are named `memory` / `passes` / `parallelism`. */ export type UnlockKdf = { version: number; algorithm: 'Argon2id'; memory: number; passes: number; parallelism: number; salt: string; } | { version: number; algorithm: 'HKDF'; hash: string; salt: string; info: string; }; /** * Argon2id parameters for the passphrase unlock derivation * (`unlockSeed = Argon2id(passphrase)`): 64 MiB of memory, 3 passes, * parallelism 1, a 32-byte tag. The memory and pass counts are those of RFC * 9106 section 4's second recommended option (m = 64 MiB, t = 3, p = 4); the * parallelism is a deliberate departure from that option's four lanes. It * stays 1 because noble is single-threaded, so a higher value changes the * bytes and buys no speed. Passphrase version 2 pins exactly * these parameters; version 1 was PBKDF2-600k over SHA-256 under the salt * `freewallet/keyring/unlock/v1`, and it was replaced outright rather than * kept beside this set, so a passphrase bound under it no longer addresses * its unlock Space. The KDF's own `version` is what records the parameter * set: the keyring record's frame version is unchanged, since a record cannot * be read before its derivation has already succeeded, so a version inside it * could never steer a lookup. The salt is a fixed app-wide constant -- login * stays passphrase-only, with no email (or other) input mixed into the * derivation. Every unlock method's KDF carries a distinct salt, so two * methods can never derive the same unlock Space. */ export declare const KEYRING_KDF: UnlockKdf; /** * Derives the 32-byte unlock seed from an unlock secret, branching on the KDF * family: Argon2id stretches a passphrase, HKDF expands already-uniform key * material such as a passkey PRF output. * * Exported for the standing-credential derivation (`unlock/standingClient`): * a standing unlock method expands its client identity and binding MAC key * from this same seed under distinct HKDF salts, so the expensive stretch * runs once per typed secret. * * @param options {object} * @param options.secret {string | Uint8Array} * @param options.kdf {UnlockKdf} * @returns {Promise} */ export declare function deriveUnlockSeed({ secret, kdf }: { secret: string | Uint8Array; kdf: UnlockKdf; }): Promise; //# sourceMappingURL=kdf.d.ts.map