def bf.op

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

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

176def bf.op(o: LcBfOp, b: L.LcBlock64) -> L.LcBlock64:
177  match o:
178    case LcBfRound{p, t}:
179      match b:
180        case L.LcBlock64{l, r}:
181          +a = U32.xor(l, p)
182          L.LcBlock64{U32.xor(r, bf.f(t, a)), a}
183    case LcBfFinal{p17, p18}:
184      match b:
185        case L.LcBlock64{l, r}:
186          L.LcBlock64{U32.xor(r, p18), U32.xor(l, p17)}

Uses (4)

Used by (4)