crypto_auth_hmacsha256()
function authenticates a message in
whose length is inlen
using the secret key k
whose length is crypto_auth_hmacsha256_KEYBYTES
, and puts the authenticator into out
(crypto_auth_hmacsha256_BYTES
bytes).crypto_auth_hmacsha256_verify()
function verifies in constant time that h
is a correct authenticator for the message in
whose length is inlen
under a secret key k
(crypto_auth_hmacsha256_KEYBYTES
bytes).-1
if the verification fails, and 0
on success.crypto_auth_hmacsha256()
:keylen
.h(key)
.k
.randombytes_buf()
but improves code clarity and can prevent misuse by ensuring that the provided key length is always be correct.crypto_auth_hmacsha256_*()
set of functions, the crypto_auth_hmacsha512_*()
set of functions implements HMAC-SHA512:crypto_auth_hmacsha256_BYTES
crypto_auth_hmacsha256_KEYBYTES
crypto_auth_hmacsha512_BYTES
crypto_auth_hmacsha512_KEYBYTES
crypto_auth_hmacsha512256_BYTES
crypto_auth_hmacsha512256_KEYBYTES
crypto_auth_hmacsha256_state
crypto_auth_hmacsha512_state
crypto_auth_hmacsha512256_state
crypto_auth_hmacsha*_init()
before updating or finalizing it. After crypto_auth_hmacsha*_final()
returns, the state should not be used any more, unless it is reinitialized using crypto_auth_hmacsha*_init()
.crypto_auth_hmacsha256_*()
can be used to create AWS HMAC-SHA256 request signatures.crypto_auth()
/crypto_auth_verify()
or crypto_generichash_*()
instead.