def tab.inv

bend-osdev-gf@0.1.1.0 · check.bend:39

import bend-osdev-gf@0.1.1.0/check.bend as Check
import Base
import bend-osdev-gf@0.1.1.0/gf.bend as G
import bend-osdev-gf@0.1.1.0/tables.bend as T

39def tab.inv(n: Nat, +f: G.Gf8Field, r: T.Gf8Tab & U32, +a: U32, bad: Nat) -> Nat:
40  match n:
41    case 0n:
42      bad
43    case 1n+k:
44      (t, +v) = r
45      +a1 = U32.add(a, 1)
46      tab.inv(k, f, T.Gf8Tab.inv(t, a1), a1, tab.count(U32.is_eq(v, G.Gf8.inv(f, a)), bad))

Uses (11)

Used by (1)