core/crypto/hmac
hmac
Types
1Constants
1Procedures
9algorithm
algorithm :: proc(ctx: ^Context) -> (hash.Algorithm)Sourcealgorithm returns the Algorithm used by a Context instance.
clone
clone :: proc(ctx: ^Context, other: ^Context)Sourceclone clones the Context other into ctx.
final
final :: proc(ctx: ^Context, dst: []u8)Sourcefinal finalizes the Context, writes the tag to dst, and calls reset on the Context.
init
init :: proc(ctx: ^Context, algorithm: hash.Algorithm, key: []u8)Sourceinit initializes a Context with a specific hash Algorithm and key.
reset
reset :: proc(ctx: ^Context)Sourcereset sanitizes the Context. The Context must be re-initialized to be used again.
sum
sum :: proc(algorithm: hash.Algorithm, dst: []u8, msg: []u8, key: []u8)Sourcesum 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 :: proc(ctx: ^Context) -> (int)Sourcetag_size returns the tag size of a Context instance in bytes.
update
update :: proc(ctx: ^Context, data: []u8)Sourceupdate adds more data to the Context.
verify
verify :: proc(algorithm: hash.Algorithm, tag: []u8, msg: []u8, key: []u8) -> (bool)Sourceverify will verify the HMAC tag computed with the specified algorithm and key over msg and return true if and only if (⟺) the tag is valid. It requires that the tag is correctly sized.