package core:crypto/hmac
Overview
package hmac implements the HMAC MAC algorithm.
See: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.198-1.pdf
Types
Context ¶
Context :: struct { _o_hash: crypto_hash.Context, // H(k ^ ipad) (not finalized) _i_hash: crypto_hash.Context, // H(k ^ opad) (not finalized) _tag_sz: int, _is_initialized: bool, }
Context is a concrete instantiation of HMAC with a specific hash algorithm.
Related Procedures With Parameters
Constants
This section is empty.
Variables
This section is empty.
Procedures
algorithm ¶
algorithm returns the Algorithm used by a Context instance.
final ¶
final finalizes the Context, writes the tag to dst, and calls reset on the Context.
init ¶
init initializes a Context with a specific hash Algorithm and key.
reset ¶
reset :: proc(ctx: ^Context) {…}
reset sanitizes the Context. The Context must be re-initialized to be used again.
sum ¶
sum will compute the HMAC with the specified algorithm and key over msg, and write the computed tag to dst. It requires that the dst buffer is the tag size.
tag_size ¶
tag_size returns the tag size of a Context instance in bytes.
verify ¶
verify will verify the HMAC tag computed with the specified algorithm and key over msg and return true iff the tag is valid. It requires that the tag is correctly sized.
Procedure Groups
This section is empty.
Source Files
Generation Information
Generated with odin version dev-2024-12 (vendor "odin") Windows_amd64 @ 2024-12-17 21:11:00.939633300 +0000 UTC