import { MtcuteWasmModule, SyncInitInput } from './types.js'; export * from './types.js'; export declare const SIMD_AVAILABLE: boolean; export declare function getWasmUrl(): URL; /** * Init the WASM blob synchronously (e.g. by passing a `WebAssembly.Module` instance) */ export declare function initSync(module: SyncInitInput): void; /** * Deflate some data with zlib headers and max output size * * @returns null if the compressed data is larger than `size`, otherwise the compressed data */ export declare function deflateMaxSize(bytes: Uint8Array, size: number): Uint8Array | null; /** * Try to decompress some data with zlib headers * * @throws Error if the data is invalid * @param defaultCapacity default capacity of the output buffer. Defaults to `bytes.length * 2` */ export declare function gunzip(bytes: Uint8Array): Uint8Array; /** * Pefrorm AES-IGE-256 encryption * * @param data data to encrypt (must be a multiple of 16 bytes) * @param key encryption key (32 bytes) * @param iv initialization vector (32 bytes) */ export declare function ige256Encrypt(data: Uint8Array, key: Uint8Array, iv: Uint8Array): Uint8Array; /** * Pefrorm AES-IGE-256 decryption * * @param data data to decrypt (must be a multiple of 16 bytes) * @param key encryption key (32 bytes) * @param iv initialization vector (32 bytes) */ export declare function ige256Decrypt(data: Uint8Array, key: Uint8Array, iv: Uint8Array): Uint8Array; /** * Create a context for AES-CTR-256 en/decryption * * > **Note**: `freeCtr256` must be called on the returned context when it's no longer needed */ export declare function createCtr256(key: Uint8Array, iv: Uint8Array): number; /** * Release a context for AES-CTR-256 en/decryption */ export declare function freeCtr256(ctx: number): void; /** * Pefrorm AES-CTR-256 en/decryption * * @param ctx context returned by `createCtr256` * @param data data to en/decrypt (must be a multiple of 16 bytes) */ export declare function ctr256(ctx: number, data: Uint8Array): Uint8Array; /** * Calculate a SHA-256 hash * * @param data data to hash */ export declare function sha256(data: Uint8Array): Uint8Array; /** * Calculate a SHA-1 hash * * @param data data to hash */ export declare function sha1(data: Uint8Array): Uint8Array; /** * Get the WASM module instance. * * For debugging and testing purposes only */ export declare function __getWasm(): MtcuteWasmModule;