For two n-bit strings x, y ∈ {0, 1}n, define z := x ⊕ y to be the bitwise XOR of the two strings (that is, if xi, yi, zi denote the i-th bits of x, y, z respectively, then zi = xi + yi mod 2). A function h : {0, 1}n → {0, 1}n is called linear if h(x ⊕ y) = h(x) ⊕ h(y), for every x, y ∈ {0, 1}n. The number of such linear functions for n ≥ 2:
- 2^n
- 2^2n
- 2^(n+1)
- n