PROOF.pcbc_rt.twofish: def of bend-osdev-crypto@0.1.0.0 Import: import bend-osdev-crypto@0.1.0.0/PROOF.bend as PROOF Lines 1137-1145 of bend-osdev-crypto@0.1.0.0/PROOF.bend: https://jend.leeeet.dev/read.txt?path=bend-osdev-crypto@0.1.0.0/PROOF.bend&start_line=1137&end_line=1145 import Base import bend-osdev-cipher-modes@0.1.0.0/cipher_modes.bend as M import bend-osdev-legacy-ciphers@0.1.0.0/twofish.bend as Tf import bend-osdev-legacy-ciphers@0.1.0.0/LAWS.bend as LL import bend-osdev-crypto@0.1.0.0/pcbc.bend as Pc import bend-osdev-crypto@0.1.0.0/inst_cm.bend as CM def pcbc_rt.twofish(+k: Tf.LcTwofishKey, bs: List<&2, M.CmBlock>, +iv: M.CmBlock) -> {bs == Pc.cr.pcbc.dec(~Tf.LcTwofishKey, ~M.CmBlock, ~Tf.LcTwofish.decrypt, ~CM.CrBlk128.xor, k, Pc.cr.pcbc.enc(~Tf.LcTwofishKey, ~M.CmBlock, ~Tf.LcTwofish.encrypt, ~CM.CrBlk128.xor, k, bs, iv), iv) : List<&2, M.CmBlock>}: match bs: case Nil{}: {==} case Con{+p, t}: %Equal.sym(M.CmBlock, Tf.LcTwofish.decrypt(k, Tf.LcTwofish.encrypt(k, CM.CrBlk128.xor(p, iv))), CM.CrBlk128.xor(p, iv), LL.twofish_round_trip(k, CM.CrBlk128.xor(p, iv))) : {Con{p, t} == Con{CM.CrBlk128.xor(_, iv), Pc.cr.pcbc.dec(~Tf.LcTwofishKey, ~M.CmBlock, ~Tf.LcTwofish.decrypt, ~CM.CrBlk128.xor, k, Pc.cr.pcbc.enc(~Tf.LcTwofishKey, ~M.CmBlock, ~Tf.LcTwofish.encrypt, ~CM.CrBlk128.xor, k, t, CM.CrBlk128.xor(p, Tf.LcTwofish.encrypt(k, CM.CrBlk128.xor(p, iv)))), CM.CrBlk128.xor(CM.CrBlk128.xor(_, iv), Tf.LcTwofish.encrypt(k, CM.CrBlk128.xor(p, iv))))} : List<&2, M.CmBlock>} %cmblock_xx(p, iv) : {Con{p, t} == Con{_, Pc.cr.pcbc.dec(~Tf.LcTwofishKey, ~M.CmBlock, ~Tf.LcTwofish.decrypt, ~CM.CrBlk128.xor, k, Pc.cr.pcbc.enc(~Tf.LcTwofishKey, ~M.CmBlock, ~Tf.LcTwofish.encrypt, ~CM.CrBlk128.xor, k, t, CM.CrBlk128.xor(p, Tf.LcTwofish.encrypt(k, CM.CrBlk128.xor(p, iv)))), CM.CrBlk128.xor(_, Tf.LcTwofish.encrypt(k, CM.CrBlk128.xor(p, iv))))} : List<&2, M.CmBlock>} %pcbc_rt.twofish(k, t, CM.CrBlk128.xor(p, Tf.LcTwofish.encrypt(k, CM.CrBlk128.xor(p, iv)))) : {Con{p, t} == Con{p, _} : List<&2, M.CmBlock>} {==} Uses (11): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Equal.sym https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=bend-osdev-cipher-modes@0.1.0.0/cipher_modes.bend&name=CmBlock https://jend.leeeet.dev/definition.txt?path=bend-osdev-crypto@0.1.0.0/PROOF.bend&name=cmblock_xx https://jend.leeeet.dev/definition.txt?path=bend-osdev-crypto@0.1.0.0/inst_cm.bend&name=CrBlk128.xor https://jend.leeeet.dev/definition.txt?path=bend-osdev-crypto@0.1.0.0/pcbc.bend&name=cr.pcbc.dec https://jend.leeeet.dev/definition.txt?path=bend-osdev-crypto@0.1.0.0/pcbc.bend&name=cr.pcbc.enc https://jend.leeeet.dev/definition.txt?path=bend-osdev-legacy-ciphers@0.1.0.0/LAWS.bend&name=twofish_round_trip https://jend.leeeet.dev/definition.txt?path=bend-osdev-legacy-ciphers@0.1.0.0/twofish.bend&name=LcTwofish.decrypt https://jend.leeeet.dev/definition.txt?path=bend-osdev-legacy-ciphers@0.1.0.0/twofish.bend&name=LcTwofish.encrypt https://jend.leeeet.dev/definition.txt?path=bend-osdev-legacy-ciphers@0.1.0.0/twofish.bend&name=LcTwofishKey