UNPKG

@hazae41/chacha20poly1305

Version:

ChaCha20Poly1305 adapter for WebAssembly and JS implementations

28 lines (25 loc) 1.39 kB
import { ChaCha20Poly1305Wasm, ChaCha20Poly1305Cipher } from '@hazae41/chacha20poly1305.wasm'; import { BytesOrCopiable } from '../../libs/copiable/index.js'; declare function fromWasm(wasm: typeof ChaCha20Poly1305Wasm): { Cipher: { new (inner: ChaCha20Poly1305Cipher): { readonly inner: ChaCha20Poly1305Cipher; encryptOrThrow(message: BytesOrCopiable, nonce: BytesOrCopiable<12>): ChaCha20Poly1305Wasm.Memory; decryptOrThrow(message: BytesOrCopiable, nonce: BytesOrCopiable<12>): ChaCha20Poly1305Wasm.Memory; [Symbol.dispose](): void; }; create(inner: ChaCha20Poly1305Cipher): { readonly inner: ChaCha20Poly1305Cipher; encryptOrThrow(message: BytesOrCopiable, nonce: BytesOrCopiable<12>): ChaCha20Poly1305Wasm.Memory; decryptOrThrow(message: BytesOrCopiable, nonce: BytesOrCopiable<12>): ChaCha20Poly1305Wasm.Memory; [Symbol.dispose](): void; }; importOrThrow(key: BytesOrCopiable<32>): { readonly inner: ChaCha20Poly1305Cipher; encryptOrThrow(message: BytesOrCopiable, nonce: BytesOrCopiable<12>): ChaCha20Poly1305Wasm.Memory; decryptOrThrow(message: BytesOrCopiable, nonce: BytesOrCopiable<12>): ChaCha20Poly1305Wasm.Memory; [Symbol.dispose](): void; }; }; }; export { fromWasm };