poly1305-mac ( message key -- tag )
Poly1305 message authentication code

Next:poly1305-verify ( message key expected-tag -- ? )


Vocabulary
crypto.poly1305

Inputs
messagea byte-array
key32-byte one-time key


Outputs
tag16-byte authentication tag


Word description
Computes a Poly1305 authentication tag for the given message using a 32-byte one-time key. The key is split into two 16-byte parts: 'r' (clamped per RFC 8439) and 's'.

Warning
The key MUST be unique for each message. Never reuse a Poly1305 key.


Examples
USING: byte-arrays crypto.poly1305 ; "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 } poly1305-mac
! => B{ 205 107 36 196 87 50 35 27 200 16 3 251 167 240 226 90 }


Definition