diff --git a/crypto_verify.js b/crypto_verify.js index d4b219d..65a60db 100644 --- a/crypto_verify.js +++ b/crypto_verify.js @@ -1,3 +1,5 @@ +const assert = require('nanoassert') + module.exports = { crypto_verify_16, crypto_verify_32 @@ -16,3 +18,9 @@ function crypto_verify_16(x, xi, y, yi) { function crypto_verify_32(x, xi, y, yi) { return vn(x, xi, y, yi, 32) } + +function sodium_memcmp (a, b) { + assert(a.byteLength = b.byteLength, 'buffers must be the same size') + + return vn(a, 0, b, 0, a.byteLength) +}