Blowfish.bf.cycle: def of bend-osdev-legacy-ciphers@0.1.0.0 Import: import bend-osdev-legacy-ciphers@0.1.0.0/blowfish.bend as Blowfish Lines 235-250 of bend-osdev-legacy-ciphers@0.1.0.0/blowfish.bend: https://jend.leeeet.dev/read.txt?path=bend-osdev-legacy-ciphers@0.1.0.0/blowfish.bend&start_line=235&end_line=250 import Base # the key bytes repeated cyclically: n bytes, from the rest of the key ys # (the whole key xs when ys runs out) def bf.cycle(n: Nat, ys: List<&2, U32>, +xs: List<&2, U32>) -> List<&2, U32>: match n: case 0n: Nil{} case 1n+p: match ys: case Con{y, t}: Con{y, bf.cycle(p, t, xs)} case Nil{}: match xs: case Nil{}: Nil{} case Con{x, t}: Con{x, bf.cycle(p, t, xs)} Uses (3): 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=U32