Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.then((c) => Sodium.crypto_box_open_easy(c,n,alice.pk,bob.sk))
.then((mm) => mm === m))
Sodium.crypto_box_easy(m,nonce,bobpk,alicesk).then((cc) => {
Sodium.crypto_box_open_easy(cc,nonce,alicepk,bobsk).then((mm) => {
this.setState({crypto_box2:(c === cc && m === mm)})
})
})
};