Aead.ad.split.pick: def of bend-osdev-aead@0.1.0.0 Import: import bend-osdev-aead@0.1.0.0/aead.bend as Aead Lines 19-25 of bend-osdev-aead@0.1.0.0/aead.bend: https://jend.leeeet.dev/read.txt?path=bend-osdev-aead@0.1.0.0/aead.bend&start_line=19&end_line=25 import Base import bend-osdev-bytes@0.1.0.0/bytes.bend as B import bend-osdev-crypto@0.1.0.0/crypto.bend as Cr def ad.split.pick(short: Bool, +tlen: Nat, +o: B.Octets) -> Result<&2, &2, Cr.CrError, AdSplit>: match short: case True{}: Fail{Cr.CrTooShort{B.Octets.len(o)}} case False{}: +n = Nat.sub(B.Octets.len(o), tlen) Done{AdSplit{B.Octets.take(n, o), B.Octets.drop(n, o)}} Uses (10): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.sub https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result https://jend.leeeet.dev/definition.txt?path=bend-osdev-aead@0.1.0.0/aead.bend&name=AdSplit https://jend.leeeet.dev/definition.txt?path=bend-osdev-bytes@0.1.1.0/bytes.bend&name=Octets https://jend.leeeet.dev/definition.txt?path=bend-osdev-bytes@0.1.1.0/bytes.bend&name=Octets.drop https://jend.leeeet.dev/definition.txt?path=bend-osdev-bytes@0.1.1.0/bytes.bend&name=Octets.len https://jend.leeeet.dev/definition.txt?path=bend-osdev-bytes@0.1.1.0/bytes.bend&name=Octets.take https://jend.leeeet.dev/definition.txt?path=bend-osdev-crypto@0.1.0.0/crypto.bend&name=CrError