def ecb_rt.serpent

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

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/serpent.bend as Sp
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

1032def ecb_rt.serpent(+k: Sp.LcSerpentKey, bs: List<&2, M.CmBlock>) -> {bs == Md.cr.ecb(~Sp.LcSerpentKey, ~M.CmBlock, ~Sp.LcSerpent.decrypt, k, Md.cr.ecb(~Sp.LcSerpentKey, ~M.CmBlock, ~Sp.LcSerpent.encrypt, k, bs)) : List<&2, M.CmBlock>}:
1033  match bs:
1034    case Nil{}:
1035      {==}
1036    case Con{b, t}:
1037      %Equal.sym(M.CmBlock, Sp.LcSerpent.decrypt(k, Sp.LcSerpent.encrypt(k, b)), b, LL.serpent_round_trip(k, b)) : {Con{b, t} == Con{_, Md.cr.ecb(~Sp.LcSerpentKey, ~M.CmBlock, ~Sp.LcSerpent.decrypt, k, Md.cr.ecb(~Sp.LcSerpentKey, ~M.CmBlock, ~Sp.LcSerpent.encrypt, k, t))} : List<&2, M.CmBlock>}
1038      %ecb_rt.serpent(k, t) : {Con{b, t} == Con{b, _} : List<&2, M.CmBlock>}
1039      {==}

Uses (8)

Used by (1)