/// import type * as crypto from 'crypto'; declare const cryptoAlgorithmList: ({ readonly name: "aes-256-gcm"; readonly keyLength: number; /** * @see https://scrapbox.io/nwtgck/AES-GCM%E3%81%AE%E5%88%9D%E6%9C%9F%E5%8C%96%E3%83%99%E3%82%AF%E3%83%88%E3%83%ABNONCE%E3%81%AF12%E3%83%90%E3%82%A4%E3%83%88(96%E3%83%93%E3%83%83%E3%83%88)%E3%81%8C%E6%8E%A8%E5%A5%A8 * @see https://crypto.stackexchange.com/a/26787 */ readonly nonceLength: number; readonly createCipher: (key: crypto.CipherKey, nonce: crypto.BinaryLike) => crypto.CipherGCM; readonly createDecipher: (key: crypto.BinaryLike, nonce: crypto.BinaryLike) => crypto.DecipherGCM; } | { readonly name: "chacha20-poly1305"; /** * @see https://tools.ietf.org/html/rfc8103#section-1.1 * @see https://tools.ietf.org/html/rfc7539#section-2.8 */ readonly keyLength: number; /** * @see https://tools.ietf.org/html/rfc8103#section-1.1 * @see https://tools.ietf.org/html/rfc7539#section-2.8 */ readonly nonceLength: number; readonly createCipher: (key: crypto.CipherKey, nonce: crypto.BinaryLike) => crypto.CipherCCM; readonly createDecipher: (key: crypto.BinaryLike, nonce: crypto.BinaryLike) => crypto.DecipherCCM; })[]; export declare type CryptoAlgorithm = (typeof cryptoAlgorithmList)[number]; export declare type CryptoAlgorithmName = CryptoAlgorithm['name']; export declare const cryptoAlgorithmMap: Map<"aes-256-gcm" | "chacha20-poly1305", { readonly name: "aes-256-gcm"; readonly keyLength: number; /** * @see https://scrapbox.io/nwtgck/AES-GCM%E3%81%AE%E5%88%9D%E6%9C%9F%E5%8C%96%E3%83%99%E3%82%AF%E3%83%88%E3%83%ABNONCE%E3%81%AF12%E3%83%90%E3%82%A4%E3%83%88(96%E3%83%93%E3%83%83%E3%83%88)%E3%81%8C%E6%8E%A8%E5%A5%A8 * @see https://crypto.stackexchange.com/a/26787 */ readonly nonceLength: number; readonly createCipher: (key: crypto.CipherKey, nonce: crypto.BinaryLike) => crypto.CipherGCM; readonly createDecipher: (key: crypto.BinaryLike, nonce: crypto.BinaryLike) => crypto.DecipherGCM; } | { readonly name: "chacha20-poly1305"; /** * @see https://tools.ietf.org/html/rfc8103#section-1.1 * @see https://tools.ietf.org/html/rfc7539#section-2.8 */ readonly keyLength: number; /** * @see https://tools.ietf.org/html/rfc8103#section-1.1 * @see https://tools.ietf.org/html/rfc7539#section-2.8 */ readonly nonceLength: number; readonly createCipher: (key: crypto.CipherKey, nonce: crypto.BinaryLike) => crypto.CipherCCM; readonly createDecipher: (key: crypto.BinaryLike, nonce: crypto.BinaryLike) => crypto.DecipherCCM; }>; export declare const defaultCryptoAlgorithmName: CryptoAlgorithmName; export {};