def bf.unop

bend-osdev-legacy-ciphers@0.1.0.0 · blowfish.bend:188

import bend-osdev-legacy-ciphers@0.1.0.0/blowfish.bend as Blowfish
import Base
import bend-osdev-legacy-ciphers@0.1.0.0/legacy_ciphers.bend as L

188def bf.unop(o: LcBfOp, b: L.LcBlock64) -> L.LcBlock64:
189  match o:
190    case LcBfRound{p, t}:
191      match b:
192        case L.LcBlock64{x, +y}:
193          L.LcBlock64{U32.xor(y, p), U32.xor(x, bf.f(t, y))}
194    case LcBfFinal{p17, p18}:
195      match b:
196        case L.LcBlock64{x, y}:
197          L.LcBlock64{U32.xor(y, p17), U32.xor(x, p18)}

Uses (4)

Used by (4)