def m64.cbc.dec

bend-osdev-legacy-ciphers@0.1.0.0 · modes64.bend:38

import bend-osdev-legacy-ciphers@0.1.0.0/modes64.bend as Modes64
import Base
import bend-osdev-legacy-ciphers@0.1.0.0/legacy_ciphers.bend as L

38# P_1 = D(C_1) xor IV, P_j = D(C_j) xor C_(j-1)
39def m64.cbc.dec(~K: Data, ~dec: K -> L.LcBlock64 -> L.LcBlock64, +k: K, bs: List<&2, L.LcBlock64>, iv: L.LcBlock64) -> List<&2, L.LcBlock64>:
40  match bs:
41    case Nil{}:
42      Nil{}
43    case Con{+c, t}:
44      Con{L.LcBlock64.xor(iv, dec(k, c)), m64.cbc.dec(~K, ~dec, k, t, c)}

Uses (3)

Used by (5)