mirror of
https://github.com/pezkuwichain/pezkuwi-common.git
synced 2026-04-22 09:08:03 +00:00
19 lines
500 B
JavaScript
19 lines
500 B
JavaScript
import { naclSecretboxOpen } from './tweetnacl.js';
|
|
/**
|
|
* @name naclDecrypt
|
|
* @summary Decrypts a message using the supplied secretKey and nonce
|
|
* @description
|
|
* Returns an decrypted message, using the `secret` and `nonce`.
|
|
* @example
|
|
* <BR>
|
|
*
|
|
* ```javascript
|
|
* import { naclDecrypt } from '@pezkuwi/util-crypto';
|
|
*
|
|
* naclDecrypt([...], [...], [...]); // => [...]
|
|
* ```
|
|
*/
|
|
export function naclDecrypt(encrypted, nonce, secret) {
|
|
return naclSecretboxOpen(encrypted, nonce, secret);
|
|
}
|