law xor_involution

bend-osdev-crypto@0.1.0.0 · LAWS.bend:80

import bend-osdev-crypto@0.1.0.0/LAWS.bend as LAWS
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

80# the cipher is its own inverse: from one state, applied twice, the data
81# comes back
82law xor_involution:
83  for ~S: Data
84  for ~next: S -> St.CrKsStep<S>
85  for +s: S
86  for +m: B.Octets
87  {St.CrXor.out_data(~S, St.CrXor.update(~S, ~next, s, St.CrXor.out_data(~S, St.CrXor.update(~S, ~next, s, m)))) == m : B.Octets}

Uses (17)

Used by (1)