def word_xor_inv
bend-collections-laws-crypto@1.0.0.0 · proofs/crypto/aes/aead.bend:30
import bend-collections-laws-crypto@1.0.0.0/proofs/crypto/aes/aead.bend as Aead
import Base
30def word_xor_inv(+n: Nat, +a: Word(n), +b: Word(n)) -> {Word.xor(n, Word.xor(n, a, b), b) == a : Word(n)}:
31 match n a b:
32 case 0n WNil{} WNil{}:
33 {==}
34 case 1n+p WCon{x, s} WCon{y, t}:
35 %word_xor_inv(p, s, t) : {WCon{Bool.xor(Bool.xor(x, y), y), Word.xor(p, Word.xor(p, s, t), t)} == WCon{x, _} : Word(1n+p)}
36 %bxor_inv(x, y) : {WCon{Bool.xor(Bool.xor(x, y), y), Word.xor(p, Word.xor(p, s, t), t)} == WCon{_, Word.xor(p, Word.xor(p, s, t), t)} : Word(1n+p)}
37 {==}