def sm4_step_unstep
bend-osdev-legacy-ciphers@0.1.0.0 · PROOF.bend:245
import bend-osdev-legacy-ciphers@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/legacy_ciphers.bend as L
import bend-osdev-legacy-ciphers@0.1.0.0/sm4.bend as S
245def sm4_step_unstep(+tab: L.LcTab, +rk: U32, s: M.CmBlock) -> {s == S.sm4.step(tab, rk, S.sm4.unstep(tab, rk, s)) : M.CmBlock}:
246 match s:
247 case M.CmBlock{+y0, +y1, +y2, y3}:
248 %u32_xx(y3, S.sm4.t(tab, U32.xor(U32.xor(U32.xor(y0, y1), y2), rk))) : {M.CmBlock{y0, y1, y2, y3} == M.CmBlock{y0, y1, y2, _} : M.CmBlock}
249 {==}