def cipher
import bend-collections-laws-crypto@1.0.0.0/spec/crypto/aes/aes.bend as Aesimport Base
import bend-collections-laws-crypto@1.0.0.0/src/crypto/aes/types.bend as T
172def cipher(+nr: Nat, s: T.State, w: List<&2, T.Quad>) -> T.State:
173 match w:
174 case w0 <> w1 <> w2 <> w3 <> rest:
175 rounds(Nat.sub(nr, 1n), add_round_key(s, w0, w1, w2, w3), rest)
176 case _:
177 s