def sp.op

bend-osdev-legacy-ciphers@0.1.0.0 · serpent.bend:244

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

244def sp.op(o: LcSpOp, s: M.CmBlock) -> M.CmBlock:
245  match o:
246    case LcSpBswap{}:
247      match s:
248        case M.CmBlock{a, b, c, d}:
249          M.CmBlock{L.lc.bswap.bits(a), L.lc.bswap.bits(b), L.lc.bswap.bits(c), L.lc.bswap.bits(d)}
250    case LcSpKey{k}:
251      M.CmBlock.xor(s, k)
252    case LcSpS{b}:
253      sp.sop(b, False{}, s)
254    case LcSpLt{}:
255      sp.lt(s)

Uses (7)

Used by (6)