Chacha20poly1305.mac_data: def of bend-collections-laws-crypto@1.0.0.0 Import: import bend-collections-laws-crypto@1.0.0.0/spec/crypto/chacha20poly1305.bend as Chacha20poly1305 Lines 29-33 of bend-collections-laws-crypto@1.0.0.0/spec/crypto/chacha20poly1305.bend: https://jend.leeeet.dev/read.txt?path=bend-collections-laws-crypto@1.0.0.0/spec/crypto/chacha20poly1305.bend&start_line=29&end_line=33 import Base # mac_data = aad | pad16(aad) | ciphertext | pad16(ciphertext) # | num_to_8_le_bytes(aad.length) | num_to_8_le_bytes(ciphertext.length) def mac_data(+aad: List<&2, U32>, +ct: List<&2, U32>) -> List<&2, U32>: List.append(&2, U32, aad, List.append(&2, U32, pad16(aad), List.append(&2, U32, ct, List.append(&2, U32, pad16(ct), List.append(&2, U32, le8(8n, List.length(&2, U32, aad)), le8(8n, List.length(&2, U32, ct))))))) Uses (6): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.append https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.length https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/spec/crypto/chacha20poly1305.bend&name=le8 https://jend.leeeet.dev/definition.txt?path=bend-collections-laws-crypto@1.0.0.0/spec/crypto/chacha20poly1305.bend&name=pad16