UNPKG

501 BJavaScriptView Raw
1import { naclSecretboxOpen } from './tweetnacl.js';
2/**
3 * @name naclDecrypt
4 * @summary Decrypts a message using the supplied secretKey and nonce
5 * @description
6 * Returns an decrypted message, using the `secret` and `nonce`.
7 * @example
8 * <BR>
9 *
10 * ```javascript
11 * import { naclDecrypt } from '@polkadot/util-crypto';
12 *
13 * naclDecrypt([...], [...], [...]); // => [...]
14 * ```
15 */
16export function naclDecrypt(encrypted, nonce, secret) {
17 return naclSecretboxOpen(encrypted, nonce, secret);
18}