def cr.lrw.benc

bend-osdev-crypto@0.1.0.0 · lrw.bend:30

import bend-osdev-crypto@0.1.0.0/lrw.bend as Lrw
import Base

30# one block under a tweak
31def cr.lrw.benc(~K: Data, ~Blk: Data, ~enc: K -> Blk -> Blk, ~bxor: Blk -> Blk -> Blk, +k: K, t: Maybe<&2, Blk>, p: Blk) -> Blk:
32  match t:
33    case None{}:
34      enc(k, p)
35    case Some{+x}:
36      bxor(enc(k, bxor(p, x)), x)

Uses (1)

Used by (9)