def bf.ops
import bend-osdev-legacy-ciphers@0.1.0.0/blowfish.bend as Blowfishimport Base
215# the steps from a P-array of 18 words (n = 16 rounds, then the final)
216def bf.ops(n: Nat, ps: List<&2, U32>, +t: LcBfTabs) -> List<&2, LcBfOp>:
217 match n:
218 case 0n:
219 match ps:
220 case Con{p17, Con{p18, rest}}:
221 [LcBfFinal{p17, p18}]
222 case _:
223 Nil{}
224 case 1n+m:
225 match ps:
226 case Con{p, rest}:
227 Con{LcBfRound{p, t}, bf.ops(m, rest, t)}
228 case Nil{}:
229 Nil{}