def cast5.rks
import bend-osdev-legacy-ciphers@0.1.0.0/cast5.bend as Cast5import Base
479# the round keys of n rounds from round i, Km from kms and Kr from krs
480def cast5.rks(n: Nat, +i: Nat, +t: LcCastTabs, kms: List<&2, U32>, krs: List<&2, U32>) -> List<&2, LcCast5Rk>:
481 match n:
482 case 0n:
483 Nil{}
484 case 1n+p:
485 match kms krs:
486 case Con{km, kt} Con{kr, rt}:
487 Con{LcCast5Rk{cast5.ty(i), km, U32.and(31, kr), t}, cast5.rks(p, Nat.add(i, 1n), t, kt, rt)}
488 case _ _:
489 Nil{}