UNPKG

gnablib

Version:

A lean, zero dependency library to provide a useful base for your project.

23 lines (22 loc) 943 B
/*! Copyright 2023-2024 the gnablib contributors MPL-1.1 */ import { IFullCrypt } from '../interfaces/IFullCrypt.js'; declare class ChaCha implements IFullCrypt { #private; readonly blockSize = 64; constructor(key: Uint8Array, nonce: Uint8Array, count: number, rounds: number); private block; decryptInto(plain: Uint8Array, enc: Uint8Array): void; encryptInto(enc: Uint8Array, plain: Uint8Array): void; encryptSize(plainLen: number): number; } declare class XChaCha extends ChaCha { constructor(key: Uint8Array, nonce: Uint8Array, count: number, rounds: number); } export declare class ChaCha20 extends ChaCha { constructor(key: Uint8Array, nonce: Uint8Array, count?: number); } export declare function hChaCha20(output: Uint8Array, key: Uint8Array, input: Uint8Array): void; export declare class XChaCha20 extends XChaCha { constructor(key: Uint8Array, nonce: Uint8Array, count?: number); } export {};