def sm4.rev

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

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

85# the reverse transformation R: (A0, A1, A2, A3) -> (A3, A2, A1, A0)
86def sm4.rev(s: M.CmBlock) -> M.CmBlock:
87  match s:
88    case M.CmBlock{a, b, c, d}:
89      M.CmBlock{d, c, b, a}

Uses (1)

Used by (4)