def bf_op_unop
bend-osdev-blowfish@0.1.0.0 · PROOF.bend:26
import bend-osdev-blowfish@0.1.0.0/PROOF.bend as PROOF
import Base
import bend-osdev-cipher-core@0.1.0.0/cipher_core.bend as L
import bend-osdev-cipher-core@0.1.0.0/LAWS.bend as CoreL
import bend-osdev-blowfish@0.1.0.0/blowfish.bend as BF
26def bf_op_unop(o: BF.LcBfOp, b: L.LcBlock64) -> {b == BF.bf.op(o, BF.bf.unop(o, b)) : L.LcBlock64}:
27 match o:
28 case BF.LcBfRound{+p, +t}:
29 match b:
30 case L.LcBlock64{+x, +y}:
31 %CoreL.u32_xor_cancel(y, p) : {L.LcBlock64{x, y} == L.LcBlock64{U32.xor(U32.xor(x, BF.bf.f(t, y)), BF.bf.f(t, _)), _} : L.LcBlock64}
32 %CoreL.u32_xor_cancel(x, BF.bf.f(t, y)) : {L.LcBlock64{x, y} == L.LcBlock64{_, y} : L.LcBlock64}
33 {==}
34 case BF.LcBfFinal{+p17, +p18}:
35 match b:
36 case L.LcBlock64{+x, +y}:
37 %CoreL.u32_xor_cancel(x, p18) : {L.LcBlock64{x, y} == L.LcBlock64{_, U32.xor(U32.xor(y, p17), p17)} : L.LcBlock64}
38 %CoreL.u32_xor_cancel(y, p17) : {L.LcBlock64{x, y} == L.LcBlock64{x, _} : L.LcBlock64}
39 {==}