def next_word
import bend-collections@1.0.0.0/src/crypto/aes/aes.bend as Aesimport Base
import bend-collections@1.0.0.0/src/crypto/aes/types.bend as T
125# history is the words so far, the newest first.
126def next_word(+nk: Nat, +i: Nat, +history: List<&2, T.Quad>) -> T.Quad:
127 xor_word(get_word(history, Nat.sub(nk, 1n)),
128 schedule_core(Nat.mod(i, nk), Nat.is_lt(6n, nk), Nat.div(i, nk), get_word(history, 0n)))