Low-Level Interface
One-Shot Digests
CryptographicHashFunctions.digest
— Functiondigest(algoid, data[; provider, kwargs...])
Return the digest of data
computed with the hash algorithm algoid
.
digest(algoid, data, len[; provider, kwargs...])
Return the first len
bytes of the digest of data
computed with the XOF algorithm algoid
.
CryptographicHashFunctions.hmac_digest
— Functionhmac_digest(algoid, key, data[; provider, kwargs...])
Return the HMAC of data
keyed with key
computed with the hash algorithm algoid
.
Hash Contexts
CryptographicHashFunctions.HMAC
— TypeHMAC(algoid, key[; provider])
Return a new HMAC object keyed with key
for the hash algorithm algoid
.
CryptographicHashFunctions.context
— Functioncontext(algoid[; provider])
Return a new hash context for the algorithm algoid
.
context(algoid, data[; provider, kwargs...])
Return a new hash context for the algorithm algoid
and initialize it with data
.
CryptographicHashFunctions.reset!
— Functionreset!(ctx)
Reset the state of the hash context ctx
. Afterwards, ctx
can be used in the same way as a freshly created hash context with the same associated algorithm.
CryptographicHashFunctions.update!
— Functionupdate!(obj, data[; provider, kwargs...])
Feed data
into the hash context or HMAC object obj
.
The argument data
can be of type AbstractVector{UInt8}
, AbstractString
, IO
, or any other type that can be collected into a vector of bytes.
When reading data
of type IO
, the buffer size can be set with the optional keyword argument buffersize
.
CryptographicHashFunctions.digest!
— Functiondigest!(obj)
Return the digest for the HMAC object or hash context obj
of a hash algorithm.
Unless reset!
is called before, further calls to update!
or digest!
are not allowed.
digest!(ctx, len)
Return the next len
bytes of the digest for the hash context ctx
of an XOF algorithm.
Unless reset!
is called before, further calls to update!
are not allowed. If the provider does not support streaming, further calls to digest!
are forbidden, too.