def aes.inv_cipher

bend-osdev-aes@0.1.0.0 · aes.bend:169

import bend-osdev-aes@0.1.0.0/aes.bend as Aes
import Base
import bend-collections@1.0.0.0/src/crypto/aes/aes.bend as A
import bend-collections@1.0.0.0/src/crypto/aes/types.bend as T

169# bend-collections' cipher (AddRoundKey with the first round key, then the
170# rounds) undone
171def aes.inv_cipher(+nr: Nat, ks: List<&2, T.State>, c: T.State) -> T.State:
172  match ks:
173    case Con{k, rest}:
174      aes.mask(A.add_round_key(aes.inv_rounds(Nat.sub(nr, 1n), rest, c), k))
175    case Nil{}:
176      aes.mask(c)

Uses (7)

Used by (3)