/** * Argon2id Key Derivation * * Modern memory-hard key derivation using Argon2id. * Requires the argon2-browser package for WASM implementation. * Issue #1649 */ import type { Argon2idConfig, KdfResult } from "./types"; /** * Argon2 type constants * These match the values from argon2-browser's ArgonType enum */ export declare const ARGON2_TYPE: { readonly Argon2d: 0; readonly Argon2i: 1; readonly Argon2id: 2; }; type Argon2Module = { hash: (options: { pass: string | Uint8Array; salt: Uint8Array; type: number; time: number; mem: number; parallelism: number; hashLen: number; }) => Promise<{ hash: Uint8Array; encoded: string; }>; ArgonType?: { Argon2d: number; Argon2i: number; Argon2id: number; }; }; /** * Set the Argon2 module reference * * This must be called before using deriveArgon2id. * The module is passed in from packages/client where argon2-browser is imported. * * @param module - The argon2-browser module */ export declare function setArgon2Module(module: Argon2Module): void; /** * Check if Argon2 module is available */ export declare function isArgon2Available(): boolean; /** * Derive a key using Argon2id * * @param password - User's password (will be normalized) * @param config - Argon2id configuration from Cognito attributes * @returns KdfResult containing the derived 32-byte key * @throws Error if argon2 module is not available */ export declare function deriveArgon2id(password: string, config: Argon2idConfig): Promise; /** * Create a new Argon2id configuration * * @param salt - Base64 encoded salt (optional, will generate if not provided) * @param params - Optional custom parameters * @returns Argon2idConfig ready for storage */ export declare function createArgon2idConfig(salt: string, params?: Partial>): Argon2idConfig; export {};