Authentication
Bindings for the crypto_auth API. See the libsodium crypto_auth docs for more information.
Constants
Buffer lengths (integer)
crypto_auth_BYTES
crypto_auth_KEYBYTES
String constants (string)
crypto_auth_PRIMITIVE
crypto_auth
sodium.crypto_auth(out, in, k)
Creates an authentication token.
out
should be abuffer
of lengthcrypto_auth_BYTES
in
should be abuffer
of any sizek
should be abuffer
of lengthcrypto_auth_KEYBYTES
The generated token is stored in out
.
crypto_auth_verify
var bool = sodium.crypto_auth_verify(out, in, k)
Verifies a token.
out
should be abuffer
of lengthcrypto_auth_BYTES
in
should be abuffer
of any sizek
should be abuffer
of lengthcrypto_auth_KEYBYTES
Returns true
if the token could be verified. Otherwise false
.