`Poly1305` one-time MAC algorithm. See: - [[ https://datatracker.ietf.org/doc/html/rfc8439 ]]

Collection Info

View Source
Collection
core
Path
crypto/poly1305
Entries
9

Source Files

Constants

2

KEY_SIZE #

Source
KEY_SIZE :: 32

KEY_SIZE is the Poly1305 key size in bytes.

TAG_SIZE #

Source
TAG_SIZE :: 16

TAG_SIZE is the Poly1305 tag size in bytes.

Types

1

Procedures

6

final #

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

final finalizes the Context, writes the tag to dst, and calls reset on the Context.

init #

Source
init :: proc(ctx: ^Context, key: []u8) {…}

init initializes a Context with the specified key. The key SHOULD be unique and MUST be unpredictable for each invocation.

reset #

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

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

sum #

Source
sum :: proc(dst, msg, key: []u8) {…}

sum will compute the Poly1305 MAC with the key over msg, and write the computed tag to dst. It requires that the dst buffer is the tag size. The key SHOULD be unique and MUST be unpredictable for each invocation.

verify #

Source
verify :: proc(tag, msg, key: []u8) -> bool {…}

verify will verify the Poly1305 tag computed with the key over msg and return true if and only if (⟺) the tag is valid. It requires that the tag is correctly sized.