core/crypto/kmac

kmac

Types

1

Constants

3

MIN_TAG_SIZE

MIN_TAG_SIZE :: 32 / 8Source

MIN_TAG_SIZE is the absolute minimum tag size for KMAC in bytes (8.4.2). Most callers SHOULD use at least 128-bits if not 256-bits for the tag size.

Procedures

8

final

final :: proc(ctx: ^Context, dst: []u8)Source

final finalizes the Context, writes the tag to dst, and calls reset on the Context. This routine will panic if the dst length is less than MIN_TAG_SIZE.

init_128

init_128 :: proc(ctx: ^Context, key: []u8, domain_sep: []u8)Source

init_128 initializes a Context for KMAC28. This routine will panic if the key length is less than MIN_KEY_SIZE_128.

init_256

init_256 :: proc(ctx: ^Context, key: []u8, domain_sep: []u8)Source

init_256 initializes a Context for KMAC256. This routine will panic if the key length is less than MIN_KEY_SIZE_256.

reset

reset :: proc(ctx: ^Context)Source

reset sanitizes the Context. The Context must be re-initialized to be used again.

sum

sum :: proc(sec_strength: int, dst: []u8, msg: []u8, key: []u8, domain_sep: []u8)Source

sum will compute the KMAC with the specified security strength, key, and domain separator over msg, and write the computed digest to dst.

verify

verify :: proc( sec_strength: int, tag: []u8, msg: []u8, key: []u8, domain_sep: []u8, allocator: _ = context.temp_allocator, ) -> (bool)Source

verify will verify the KMAC tag computed with the specified security strength, key and domain separator over msg and return true if and only if (⟺) the tag is valid.

Reference search

Find anything

Documentation preferences

Settings

System theme variants

Used only while Theme is set to System.