def rc4_mask_xs

bend-osdev-legacy-ciphers@0.1.0.0 · PROOF.bend:8448

import bend-osdev-legacy-ciphers@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-legacy-ciphers@0.1.0.0/rc4.bend as R

8448def rc4_mask_xs(ys: List<&2, U32>, +st: R.LcRc4State) -> {R.rc4.xs(ys, st) == R.rc4.xs(B.mask(ys), st) : List<&2, U32>}:
8449  match ys:
8450    case Nil{}:
8451      {==}
8452    case Con{+h, +t}:
8453      %byte_xor_byte(h, R.rc4.step.k(R.rc4.next(st))) : {Con{B.byte(U32.xor(h, R.rc4.step.k(R.rc4.next(st)))), R.rc4.xs(t, R.rc4.step.st(R.rc4.next(st)))} == Con{_, R.rc4.xs(B.mask(t), R.rc4.step.st(R.rc4.next(st)))} : List<&2, U32>}
8454      %rc4_mask_xs(t, R.rc4.step.st(R.rc4.next(st))) : {Con{B.byte(U32.xor(h, R.rc4.step.k(R.rc4.next(st)))), R.rc4.xs(t, R.rc4.step.st(R.rc4.next(st)))} == Con{B.byte(U32.xor(h, R.rc4.step.k(R.rc4.next(st)))), _} : List<&2, U32>}
8455      {==}

Uses (11)

Used by (1)