Poly1305.poly1305_mac: def of bend-collections@1.0.0.0 Import: import bend-collections@1.0.0.0/spec/crypto/poly1305.bend as Poly1305 Lines 113-118 of bend-collections@1.0.0.0/spec/crypto/poly1305.bend: https://jend.leeeet.dev/read.txt?path=bend-collections@1.0.0.0/spec/crypto/poly1305.bend&start_line=113&end_line=118 import Base # poly1305_mac(msg, key): r = clamp(key[0..16]), s = key[16..32]; # a = 0, absorb every block, a += s; the tag is num_to_16_le_bytes(a). def poly1305_mac(+key: List<&2, U32>, +msg: List<&2, U32>) -> List<&2, U32>: +r = le_num(clamp(prefix(16n, key))) +s = le_num(prefix(16n, suffix(16n, key))) le_bytes(16n, Nat.add(absorb(blocks(List.length(&2, U32, msg), msg), r, 0n), s)) Uses (11): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.length https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/spec/crypto/poly1305.bend&name=absorb https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/spec/crypto/poly1305.bend&name=blocks https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/spec/crypto/poly1305.bend&name=clamp https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/spec/crypto/poly1305.bend&name=le_bytes https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/spec/crypto/poly1305.bend&name=le_num https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/spec/crypto/poly1305.bend&name=prefix https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/spec/crypto/poly1305.bend&name=suffix