Skip to content

Commit

Permalink
more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
paixaop committed Nov 30, 2018
1 parent 53310b3 commit 5117314
Show file tree
Hide file tree
Showing 4 changed files with 1,462 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/onetime-auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,6 @@ module.exports = function OneTimeAuth(secretKey, encoding) {
var tokenBuf = toBuffer(token, encoding);
var messageBuf = toBuffer(message, encoding);

return binding.crypto_onetimeauth_verify(tokenBuf, messageBuf, self.secretKey.get()) ? false : true;
return binding.crypto_onetimeauth_verify(tokenBuf, messageBuf, self.secretKey.get());
};
};
2 changes: 1 addition & 1 deletion test/test_crypto_onetimeauth.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe('OneTimeAuth', function() {
var key = crypto.randomBytes(sodium.crypto_auth_KEYBYTES);
var token = sodium.crypto_onetimeauth(buf, key);
var r = sodium.crypto_onetimeauth_verify(token, buf, key);
assert.equal(r, 0);
assert(r);
done();
});
});
Expand Down
Loading

0 comments on commit 5117314

Please sign in to comment.