def gctr

bend-collections@1.0.0.0 · src/crypto/aes/gcm.bend:133

import bend-collections@1.0.0.0/src/crypto/aes/gcm.bend as Gcm
import Base
import bend-collections@1.0.0.0/src/crypto/aes/types.bend as T
import bend-collections@1.0.0.0/src/crypto/aes/aes.bend as A

133def gctr(+sched: A.Schedule, +xs: List<&2, U32>, +n0: T.Quad, +n1: T.Quad, +n2: T.Quad, +c: U32) -> List<&2, U32>:
134  match xs:
135    case x0 <> x1 <> x2 <> x3 <> x4 <> x5 <> x6 <> x7 <> x8 <> x9 <> x10 <> x11 <> x12 <> x13 <> x14 <> x15 <> rest:
136      List.append(&2, U32, xor_bytes([x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15], keystream(sched, n0, n1, n2, c)),
137        gctr(sched, rest, n0, n1, n2, U32.inc(c)))
138    case _:
139      xor_bytes(xs, keystream(sched, n0, n1, n2, c))

Uses (8)

Used by (3)