import type { TotpOptions } from './types/totp-options'; import type { VerifyOptions } from './types/verify-options'; /** * Time-based One-Time Password (TOTP) implementation per RFC 6238 * * @param secret - Secret key as bytes (minimum 16 bytes) * @param opts - TOTP options including current time * * @returns Promise resolving to the TOTP code */ export declare const totp: (secret: Uint8Array, { algorithm, digits, period, now }?: TotpOptions & { now?: number; }) => Promise; /** * Verify a TOTP code against a secret * * @remarks * Security: Uses constant-time comparison to prevent timing attacks (CWE-208). * Security: Always iterates through all windows to prevent leaking which time step matched. * Security: Validates window size to prevent DoS attacks (CWE-400). * Performance: Parallelizes code generation when window > 0. * * @param secret - Secret key as bytes (minimum 16 bytes) * @param code - Code to verify * @param opts - Verification options * * @throws ({@link InternalError}) - if window is invalid * * @returns Promise resolving to true if code is valid */ export declare const verifyTotp: (secret: Uint8Array, code: string, { algorithm, digits, period, window, now }?: VerifyOptions) => Promise;