def cipher
import bend-collections-laws-crypto@1.0.0.0/src/crypto/aes/aes.bend as Aesimport Base
import bend-collections-laws-crypto@1.0.0.0/src/crypto/aes/types.bend as T
65def cipher(+nr: Nat, s: T.State, ks: List<&2, T.State>) -> T.State:
66 match ks:
67 case k <> rest:
68 rounds(Nat.sub(nr, 1n), add_round_key(s, k), rest)
69 case Nil{}:
70 s