def ecb_rt.sm4

bend-osdev-crypto@0.1.0.0 · PROOF.bend:880

import bend-osdev-crypto@0.1.0.0/PROOF.bend as PROOF
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/sm4.bend as S
import bend-osdev-legacy-ciphers@0.1.0.0/LAWS.bend as LL
import bend-osdev-crypto@0.1.0.0/modes.bend as Md

880def ecb_rt.sm4(+k: S.LcSm4Key, bs: List<&2, M.CmBlock>) -> {bs == Md.cr.ecb(~S.LcSm4Key, ~M.CmBlock, ~S.LcSm4.decrypt, k, Md.cr.ecb(~S.LcSm4Key, ~M.CmBlock, ~S.LcSm4.encrypt, k, bs)) : List<&2, M.CmBlock>}:
881  match bs:
882    case Nil{}:
883      {==}
884    case Con{b, t}:
885      %Equal.sym(M.CmBlock, S.LcSm4.decrypt(k, S.LcSm4.encrypt(k, b)), b, LL.sm4_round_trip(k, b)) : {Con{b, t} == Con{_, Md.cr.ecb(~S.LcSm4Key, ~M.CmBlock, ~S.LcSm4.decrypt, k, Md.cr.ecb(~S.LcSm4Key, ~M.CmBlock, ~S.LcSm4.encrypt, k, t))} : List<&2, M.CmBlock>}
886      %ecb_rt.sm4(k, t) : {Con{b, t} == Con{b, _} : List<&2, M.CmBlock>}
887      {==}

Uses (8)

Used by (1)