poly1305-verify ( message key expected-tag -- ? )
Poly1305 message authentication code

Prev:poly1305-mac ( message key -- tag )


Vocabulary
crypto.poly1305

Inputs
messagea byte-array
key32-byte one-time key
expected-tag16-byte expected tag


Outputs
?t if the tag matches, f otherwise


Word description
Verifies that the expected tag matches the computed Poly1305 tag for the message and key. The comparison is constant-time, and a tag of the wrong length never matches. Returns t if the tag is valid, f otherwise.

Examples
USING: byte-arrays crypto.poly1305 prettyprint ; "Hello" >byte-array B{ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 } B{ 205 107 36 196 87 50 35 27 200 16 3 251 167 240 226 90 } poly1305-verify .
t


Definition