Seqiv.ad.sq.key: def of bend-osdev-aead@0.1.0.0 Import: import bend-osdev-aead@0.1.0.0/seqiv.bend as Seqiv Lines 46-52 of bend-osdev-aead@0.1.0.0/seqiv.bend: https://jend.leeeet.dev/read.txt?path=bend-osdev-aead@0.1.0.0/seqiv.bend&start_line=46&end_line=52 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.sq.key(~KA: Data, ~akey: B.Octets -> Result<&2, &2, Cr.CrError, KA>, +ivlen: Nat, +o: B.Octets) -> Result<&2, &2, Cr.CrError, AdSeqivKey>: +n = B.Octets.len(o) +m = Nat.sub(n, ivlen) do Result<&2, &2, Cr.CrError, AdSeqivKey>: Cr.CrError.check(Nat.is_le(ivlen, n), Cr.CrBadKeyLength{n}) ka : KA <- akey(B.Octets.take(m, o)) return AdSeqivKey{ka, B.Octets.drop(m, o)} Uses (14): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.is_le 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=Base/base.bend&name=Result.bind https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result.pure https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Unit https://jend.leeeet.dev/definition.txt?path=bend-osdev-aead@0.1.0.0/seqiv.bend&name=AdSeqivKey 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 https://jend.leeeet.dev/definition.txt?path=bend-osdev-crypto@0.1.0.0/crypto.bend&name=CrError.check