def ks_go_ref

bend-osdev-crypto@0.1.0.0 · PROOF.bend:166

import bend-osdev-crypto@0.1.0.0/PROOF.bend as PROOF
import Base
import bend-osdev-bytes@0.1.0.0/bytes.bend as B
import bend-osdev-crypto@0.1.0.0/stream.bend as St

166# the loop, for every list and state, is the structural output reversed onto
167# what it had
168def ks_go_ref(~S: Data, ~next: S -> St.CrKsStep<S>, ys: List<&2, U32>, +s: S, +acc: List<&2, U32>) -> {St.cr.ks.go(~S, ~next, ys, s, acc) == St.CrKsRun{St.cr.ks.after(~S, ~next, ys, s), St.cr.rev_onto(St.cr.ks.xs(~S, ~next, ys, s), acc)} : St.CrKsRun<S>}:
169  match ys:
170    case Nil{}:
171      {==}
172    case Con{x, t}:
173      ks_go_ref(~S, ~next, t, St.CrKsStep.st(~S, next(s)), Con{B.byte(U32.xor(x, St.CrKsStep.k(~S, next(s)))), acc})

Uses (12)

Used by (1)