throw new Error('bad signature size')\r
if (publicKey.length !== crypto_sign_PUBLICKEYBYTES)\r
throw new Error('bad public key size')\r
- var sm = new Uint8Array(crypto_sign_BYTES + msg.length)\r
- var m = new Uint8Array(crypto_sign_BYTES + msg.length)\r
- var i\r
- for (i = 0; i < crypto_sign_BYTES; i++) sm[i] = sig[i]\r
- for (i = 0; i < msg.length; i++) sm[i + crypto_sign_BYTES] = msg[i]\r
+ const sm = new Uint8Array(crypto_sign_BYTES + msg.length)\r
+ const m = new Uint8Array(crypto_sign_BYTES + msg.length)\r
+ for (let i = 0; i < crypto_sign_BYTES; i++) sm[i] = sig[i]\r
+ for (let i = 0; i < msg.length; i++) sm[i + crypto_sign_BYTES] = msg[i]\r
return (crypto_sign_open(m, sm, sm.length, publicKey) >= 0)\r
}\r
\r