import CryptoPort from '../../ports/CryptoPort.ts';
/**
 * Web Crypto API adapter implementing CryptoPort.
 *
 * Uses the standard Web Crypto API (globalThis.crypto.subtle) which is
 * available in browsers, Deno, Bun, and Node.js 22+.
 *
 * All hash and HMAC operations are async because the Web Crypto API
 * is inherently promise-based.
 */
export default class WebCryptoAdapter extends CryptoPort {
    private readonly _subtle;
    constructor(options?: {
        subtle?: SubtleCrypto;
    });
    /**
     * Computes a hex-encoded digest of the given data using the specified hash algorithm.
     */
    hash(algorithm: string, data: string | Uint8Array): Promise<string>;
    /**
     * Computes an HMAC signature for the given data using the specified algorithm and key.
     */
    hmac(algorithm: string, key: string | Uint8Array, data: string | Uint8Array): Promise<Uint8Array>;
    /**
     * Constant-time comparison of two buffers.
     *
     * Uses XOR accumulation with no early exit to prevent timing attacks.
     * This is the standard approach when crypto.timingSafeEqual is unavailable.
     */
    timingSafeEqual(a: Uint8Array, b: Uint8Array): boolean;
}
