Modes.cr.chunks: def of bend-osdev-crypto@0.1.0.0 Import: import bend-osdev-crypto@0.1.0.0/modes.bend as Modes Lines 111-120 of bend-osdev-crypto@0.1.0.0/modes.bend: https://jend.leeeet.dev/read.txt?path=bend-osdev-crypto@0.1.0.0/modes.bend&start_line=111&end_line=120 import Base # the whole n-byte pieces of xs, last first (cur: the piece being filled, # reversed, i bytes long) def cr.chunks(xs: List<&2, U32>, +n: Nat, +i: Nat, +cur: List<&2, U32>, acc: List<&2, List<&2, U32>>) -> List<&2, List<&2, U32>>: match xs: case Nil{}: acc case Con{x, t}: +c : List<&2, U32> = Con{x, cur} +full = Nat.is_eq(1n+i, n) cr.chunks(t, n, cr.pick_n(full, 1n+i), cr.pick_cur(full, c), cr.pick_acc(full, c, acc)) Uses (7): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List 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_eq https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=bend-osdev-crypto@0.1.0.0/modes.bend&name=cr.pick_acc https://jend.leeeet.dev/definition.txt?path=bend-osdev-crypto@0.1.0.0/modes.bend&name=cr.pick_cur https://jend.leeeet.dev/definition.txt?path=bend-osdev-crypto@0.1.0.0/modes.bend&name=cr.pick_n