def sm4.step

bend-osdev-legacy-ciphers@0.1.0.0 · sm4.bend:60

import bend-osdev-legacy-ciphers@0.1.0.0/sm4.bend as Sm4
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

60def sm4.step(+tab: L.LcTab, rk: U32, s: M.CmBlock) -> M.CmBlock:
61  match s:
62    case M.CmBlock{x0, +x1, +x2, +x3}:
63      M.CmBlock{x1, x2, x3, U32.xor(x0, sm4.t(tab, U32.xor(U32.xor(U32.xor(x1, x2), x3), rk)))}

Uses (5)

Used by (4)