def cr.oct.xorl

bend-osdev-crypto@0.1.0.0 · octets.bend:6

import bend-osdev-crypto@0.1.0.0/octets.bend as Octets
import Base

6# xs xor ys, element by element, over xs's length (a missing element of ys
7# counts as 0)
8def cr.oct.xorl(xs: List<&2, U32>, ys: List<&2, U32>) -> List<&2, U32>:
9  match xs:
10    case Nil{}:
11      Nil{}
12    case Con{x, xt}:
13      match ys:
14        case Nil{}:
15          Con{U32.xor(x, 0), cr.oct.xorl(xt, Nil{})}
16        case Con{y, yt}:
17          Con{U32.xor(x, y), cr.oct.xorl(xt, yt)}

Uses (3)

Used by (1)