Chacha20poly1305.open_tag: def of bend-collections@1.0.0.0 Import: import bend-collections@1.0.0.0/spec/crypto/chacha20poly1305.bend as Chacha20poly1305 Lines 44-49 of bend-collections@1.0.0.0/spec/crypto/chacha20poly1305.bend: https://jend.leeeet.dev/read.txt?path=bend-collections@1.0.0.0/spec/crypto/chacha20poly1305.bend&start_line=44&end_line=49 import Base import bend-collections@1.0.0.0/spec/crypto/chacha.bend as CH # Decryption: the tag is recomputed over the received ciphertext and the # plaintext released only when it matches. def open_tag(ok: Bool, +key: List<&2, U32>, +nonce: List<&2, U32>, +ct: List<&2, U32>) -> Maybe<&2, List<&2, U32>>: match ok: case True{}: Some{CH.encrypt(key, 1, nonce, ct)} case False{}: None{} Uses (5): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe 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/chacha.bend&name=encrypt