Cts.cr.cts.dec.go: def of bend-osdev-crypto@0.1.0.0 Import: import bend-osdev-crypto@0.1.0.0/cts.bend as Cts Lines 69-90 of bend-osdev-crypto@0.1.0.0/cts.bend: https://jend.leeeet.dev/read.txt?path=bend-osdev-crypto@0.1.0.0/cts.bend&start_line=69&end_line=90 import Base import bend-osdev-bytes@0.1.0.0/bytes.bend as B import bend-osdev-crypto@0.1.0.0/octets.bend as O # Decryption over the pieces from the chaining value v def cr.cts.dec.go(~K: Data, ~Blk: Data, ~bsize: Nat, ~dec: K -> Blk -> Blk, ~blk_of: B.Octets -> Maybe<&2, Blk>, ~blk_to: Blk -> B.Octets, ps: List<&2, List<&2, U32>>, +k: K, +v: B.Octets, acc: List<&2, B.Octets>) -> B.Octets: match ps: case Con{p, t}: match t: case Con{q, u}: match u: case Nil{}: +cn = B.Octets.of_list(p) +xs = B.Octets.of_list(q) +d = B.Octets.len(xs) +z = cr.cts.b(~K, ~Blk, ~dec, ~blk_of, ~blk_to, k, cn) +x = B.Octets.append(xs, B.Octets.drop(d, z)) +pn = O.CrOct.xor(B.Octets.take(d, z), xs) cr.cts.out(Con{pn, Con{O.CrOct.xor(cr.cts.b(~K, ~Blk, ~dec, ~blk_of, ~blk_to, k, x), v), acc}}) case Con{r, w}: +c = B.Octets.of_list(p) cr.cts.dec.go(~K, ~Blk, ~bsize, ~dec, ~blk_of, ~blk_to, Con{q, Con{r, w}}, k, c, Con{O.CrOct.xor(cr.cts.b(~K, ~Blk, ~dec, ~blk_of, ~blk_to, k, c), v), acc}) case Nil{}: cr.cts.out(Con{O.CrOct.xor(cr.cts.b(~K, ~Blk, ~dec, ~blk_of, ~blk_to, k, B.Octets.of_list(p)), v), acc}) case Nil{}: cr.cts.out(acc) Uses (13): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=bend-osdev-bytes@0.1.1.1/bytes.bend&name=Octets https://jend.leeeet.dev/definition.txt?path=bend-osdev-bytes@0.1.1.1/bytes.bend&name=Octets.append https://jend.leeeet.dev/definition.txt?path=bend-osdev-bytes@0.1.1.1/bytes.bend&name=Octets.drop https://jend.leeeet.dev/definition.txt?path=bend-osdev-bytes@0.1.1.1/bytes.bend&name=Octets.len https://jend.leeeet.dev/definition.txt?path=bend-osdev-bytes@0.1.1.1/bytes.bend&name=Octets.of_list https://jend.leeeet.dev/definition.txt?path=bend-osdev-bytes@0.1.1.1/bytes.bend&name=Octets.take https://jend.leeeet.dev/definition.txt?path=bend-osdev-crypto@0.1.0.0/cts.bend&name=cr.cts.b https://jend.leeeet.dev/definition.txt?path=bend-osdev-crypto@0.1.0.0/cts.bend&name=cr.cts.out https://jend.leeeet.dev/definition.txt?path=bend-osdev-crypto@0.1.0.0/octets.bend&name=CrOct.xor