def aes.inv.go

bend-osdev-cipher-modes@0.1.0.0 · aes.bend:31

import bend-osdev-cipher-modes@0.1.0.0/aes.bend as Aes
import Base

31# a := a^2 * x, n times: from a = x, six times gives x^127
32def aes.inv.go(n: Nat, a: U32, +x: U32) -> U32:
33  match n:
34    case 0n:
35      a
36    case 1n+q:
37      +s = a
38      aes.inv.go(q, aes.gmul(aes.gmul(s, s), x), x)

Uses (3)

Used by (1)