import { type AesResult, type KeyPair, type UintKeyPair } from './types'; export type { AesResult, KeyPair }; export declare const ARGON2ID_MEMLIMIT_MIN: BigInt; export declare const ARGON2ID_MEMLIMIT_MAX: BigInt; export declare const ARGON2ID_MEMLIMIT_INTERACTIVE: BigInt; export declare const ARGON2ID_MEMLIMIT_MODERATE: BigInt; export declare const ARGON2ID_MEMLIMIT_SENSITIVE: BigInt; export declare const ARGON2ID_OPSLIMIT_MIN: BigInt; export declare const ARGON2ID_OPSLIMIT_MAX: BigInt; export declare const ARGON2ID_OPSLIMIT_INTERACTIVE: BigInt; export declare const ARGON2ID_OPSLIMIT_MODERATE: BigInt; export declare const ARGON2ID_OPSLIMIT_SENSITIVE: BigInt; export declare const ARGON2ID_SALTBYTES: BigInt; export declare const BOX_PUBLIC_KEY_LENGTH: BigInt; export declare const BOX_SECRET_KEY_LENGTH: BigInt; export declare const BOX_NONCE_LENGTH: BigInt; export declare const BOX_SEED_LENGTH: BigInt; export declare const SECRETBOX_KEY_LENGTH: BigInt; export declare const SECRETBOX_NONCE_LENGTH: BigInt; /** * Encodes a buffer into a base64 string * * @throws when the buffer is not an `Uint8Array` */ export declare function encodeBase64(buffer: Uint8Array): string; /** * Decodes a base64 string into a buffer * * @throws when the given string is not a valid base64 string */ export declare function decodeBase64(toEncode: string): Uint8Array; /** * Encodes a buffer into an hexadecimal string * * @throws when buffer is not an `Uint8Array` */ export declare function encodeHexadecimal(buffer: Uint8Array): string; /** * Decodes an hexadecimal string into an Uint8Array * * @throws when the given string is not a valid hexadecimal string */ export declare function decodeHexadecimal(toDecode: string): Uint8Array; /** * Encodes a buffer into a UTF-8 string * * @throws when buffer is not an `Uint8Array` */ export declare function encodeUtf8(buffer: Uint8Array): string; /** * Decodes a UTF-8 string into an `Uint8Array` */ export declare function decodeUtf8(input: string): Uint8Array; /** * Generates a key to be used with aesEncrypt and aesDecrypt */ export declare function aesGenerateKey(): Uint8Array; /** * Encrypts a message with AES-256-GCM using the given key * * @throws when message is not an `Uint8Array` * @throws when key is not an `Uint8Array` * @throws when key length is incorrect */ export declare function aesEncrypt(message: Uint8Array, key: Uint8Array): Promise; /** * Decrypts a cipher text with AES-256-GCM using the given key and the initialization vector * * @throws when cipherText is not an `Uint8Array` * @throws when key is not an `Uint8Array` * @throws when key length is incorrect * @throws when iv is not an `Uint8Array` * @throws when iv length is not an `Uint8Array` * @throws when the decryption failed */ export declare function aesDecrypt(cipherText: Uint8Array, key: Uint8Array, iv: Uint8Array): Promise; export declare function convertToOutputFormat(input: ArrayBuffer): Uint8Array; export declare function crypto_box_seed_keypair(seed: Uint8Array): UintKeyPair; /** * Generates a key pair to be used with boxSeal and boxOpen */ export declare function boxGenerateKey(): KeyPair; /** * Encrypts a message using the recipient's public key and the sender's secret key * * @throws when message is not an `Uint8Array` * @throws when recipientPublicKey is not an `Uint8Array` * @throws when recipientPublicKey length is incorrect * @throws when senderSecretKey is not an `Uint8Array` * @throws when senderSecretKey length is incorrect * @throws when the encryption didn't succeed successfully */ export declare function boxSeal(message: Uint8Array, recipientPublicKey: Uint8Array, senderSecretKey: Uint8Array): Uint8Array; /** * Verifies and decrypts a ciphertext produced by `boxSeal` * * @throws when cipherText is not an `Uint8Array` * @throws when senderPublicKey is not an `Uint8Array` * @throws when senderPublicKey length is incorrect * @throws when recipientSecretKey is not an `Uint8Array` * @throws when recipientSecretKey length is incorrect * @throws when the verification failed */ export declare function boxOpen(cipherText: Uint8Array, senderPublicKey: Uint8Array, recipientSecretKey: Uint8Array): Uint8Array; /** * Generates a key to be used with secretboxSeal and secretboxOpen */ export declare function secretboxGenerateKey(): Uint8Array; /** * Encrypts a message with the given secret key * * @throws when message is not a `Uint8Array` * @throws when secretKey is not a `Uint8Array` * @throws when secretKey length is incorrect * @throws when the encryption didn't complete successfully */ export declare function secretboxSeal(message: Uint8Array, secretKey: Uint8Array): Uint8Array; /** * Verifies and decrypts a ciphertext produced by `secretboxSeal` * * @throws when cipherText is not an `Uint8Array` * @throws when secretKey is not an `Uint8Array` * @throws when secretKey length is incorrect * @throws when the verification failed */ export declare function secretboxOpen(cipherText: Uint8Array, secretKey: Uint8Array): Uint8Array; /** * Generates a key pair for signing and verifying signatures */ export declare function signGenerateKey(): KeyPair; /** * Signs a message with the given secret key * * @throws when message is not a `Uint8Array` * @throws when secretKey is not a `Uint8Array` * @throws when secretKey length is incorrect */ export declare function signDetached(message: Uint8Array, secretKey: Uint8Array): Uint8Array; /** * Verifies that the signature is valid given the message the public key * * @throws when message is not a `Uint8Array` * @throws when publicKey is not a `Uint8Array` * @throws when publicKey length is incorrect * @throws when signature is not a `Uint8Array` */ export declare function signVerifyDetached(message: Uint8Array, publicKey: Uint8Array, signature: Uint8Array): boolean; /** * Hash a password using the Argon2id algorithm * * @throws when password is not a `Uint8Array` * @throws when the hash computation didn't complete successfully */ export declare function argon2idHash(password: Uint8Array, iterations: BigInt, memoryLimit: BigInt): Promise; /** * Verifies that `hash` is a valid `password` verification string * * @throws when password is not a `Uint8Array` */ export declare function argon2idVerify(hash: string, password: Uint8Array): Promise; /** * Derives a key of the given length * * @throws when password is not a `Uint8Array` * @throws when salt is not a `Uint8Array` or its size is not `ARGON2ID_SALTBYTES` */ export declare function argon2idDeriveKey(password: Uint8Array, salt: Uint8Array, keyLength: number, iterations: BigInt, memoryLimit: BigInt): Promise; /** * Returns a buffer of the given size filled with random bytes * * @throws When the given size is incorrect */ export declare function getRandomBytes(size: number | BigInt): Uint8Array; //# sourceMappingURL=nacl.d.ts.map