Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var sodium = require('chloride')
var scalarmult = sodium.crypto_scalarmult
var box = sodium.crypto_box_easy
var secretbox = sodium.crypto_secretbox_easy
var secretbox_open = sodium.crypto_secretbox_open_easy
var keypair = sodium.crypto_box_keypair
var concat = Buffer.concat
function randombytes(n) {
var b = new Buffer(n)
sodium.randombytes(b)
return b
}
function setMax (m) {
m = m || DEFAULT_MAX
if (m < 1 || m > 255)
throw new Error('max recipients must be between 0 and 255.')