remove redundant return values

This commit is contained in:
Christophe Diederichs 2020-09-15 12:29:40 +02:00
parent fdcd6621a7
commit aba4335983
2 changed files with 1 additions and 4 deletions

View File

@ -23,7 +23,6 @@ function crypto_onetimeauth (mac, msg, key) {
var s = new Poly1305(key) var s = new Poly1305(key)
s.update(msg, 0, msg.byteLength) s.update(msg, 0, msg.byteLength)
s.finish(mac, 0) s.finish(mac, 0)
return true
} }
function crypto_onetimeauth_verify (mac, msg, key) { function crypto_onetimeauth_verify (mac, msg, key) {

View File

@ -37,7 +37,6 @@ function crypto_secretbox (c, m, n, k) {
c.subarray(0, crypto_onetimeauth_KEYBYTES) c.subarray(0, crypto_onetimeauth_KEYBYTES)
) )
c.fill(0, 0, crypto_secretbox_BOXZEROBYTES) c.fill(0, 0, crypto_secretbox_BOXZEROBYTES)
return 0
} }
function crypto_secretbox_open (m, c, n, k) { function crypto_secretbox_open (m, c, n, k) {
@ -94,9 +93,8 @@ function crypto_secretbox_easy (o, msg, n, k) {
const m = new Uint8Array(crypto_secretbox_ZEROBYTES + msg.byteLength) const m = new Uint8Array(crypto_secretbox_ZEROBYTES + msg.byteLength)
const c = new Uint8Array(m.byteLength) const c = new Uint8Array(m.byteLength)
m.set(msg, crypto_secretbox_ZEROBYTES) m.set(msg, crypto_secretbox_ZEROBYTES)
if (crypto_secretbox(c, m, n, k) === false) return false crypto_secretbox(c, m, n, k)
o.set(c.subarray(crypto_secretbox_BOXZEROBYTES)) o.set(c.subarray(crypto_secretbox_BOXZEROBYTES))
return true
} }
function crypto_secretbox_open_easy (msg, box, n, k) { function crypto_secretbox_open_easy (msg, box, n, k) {