Creates a streaming HMAC context.
Supported algorithms currently include "md5", "sha1", "sha224",
"sha256", "sha384", "sha512", "sha3_224", "sha3_256",
"sha3_384", and "sha3_512".
@eryx/crypto/hazmat/hmac ModuleHMAC (Hash-based Message Authentication Code).
Computes an authentication tag over streamed data using a secret key
and the chosen hash algorithm. The output length equals the digest size
of the underlying hash.
local hmac = require("@eryx/crypto/hazmat/hmac")
local hex = require("@eryx/encoding/hex")
local key = buffer.fromstring("secret")
local ctx = hmac.new("sha256", key)
ctx:update(buffer.fromstring("hello"))
print(hex.encode(ctx:final()))
Creates a streaming HMAC context.
Supported algorithms currently include "md5", "sha1", "sha224",
"sha256", "sha384", "sha512", "sha3_224", "sha3_256",
"sha3_384", and "sha3_512".
Hash algorithm name.
Secret key (any length).
Streaming HMAC context.