`TupleHash` and `TupleHashXOF` algorithms. See: - [[ https://nvlpubs.nist.gov/nistpubs/specialpublications/nist.sp.800-185.pdf ]]

Collection Info

View Source
Collection
core
Path
crypto/tuplehash
Entries
8

Source Files

Types

1

Procedures

7

final #

Source
final :: proc(ctx: ^Context, hash: []u8, finalize_clone: bool = false) {…}

final finalizes the Context, writes the digest to hash, and calls reset on the Context. If and only if (⟺) finalize_clone is set, final will work on a copy of the Context, which is useful for for calculating rolling digests.

init_128 #

Source
init_128 :: proc(ctx: ^Context, domain_sep: []u8) {…}

init_128 initializes a Context for TupleHash128 or TupleHashXOF128.

init_256 #

Source
init_256 :: proc(ctx: ^Context, domain_sep: []u8) {…}

init_256 initializes a Context for TupleHash256 or TupleHashXOF256.

read #

Source
read :: proc(ctx: ^Context, dst: []u8) {…}

read reads output from the TupleHashXOF instance. There is no practical upper limit to the amount of data that can be read from TupleHashXOF. After read has been called one or more times, further calls to write_element will panic.

reset #

Source
reset :: proc(ctx: ^Context) {…}

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

write_element #

Source
write_element :: proc(ctx: ^Context, data: []u8) {…}

write_element writes a tuple element into the TupleHash or TupleHashXOF instance. This MUST not be called after any reads have been done, and any attempts to do so will panic.