# Are SHA-2's $\mathit{Maj}$ and $\mathit{Ch}$ functions non-linear?

SHA-2 has two functions:

$\mathit{Maj}(x, y, z) = (x \land y) \oplus (y \land z) \oplus (x \land z)$

$\mathit{Ch}(x, y, z) = (x \land y) \lor (\neg x \land z)$

Are these two functions non-linear? Can they be used in place of S-boxes in block ciphers?

• Write them out as arithmetic in GF(2): $x \land y = x \cdot y$ (since $(0, 0) \mapsto 0$, $(0, 1) \mapsto 0$, $(1, 0) \mapsto 0$, $(1, 1) \mapsto 1$), $a \oplus b = a + b$, etc. Does that help answer your question? – Squeamish Ossifrage Dec 10 '17 at 18:49
• @SqueamishOssifrage No. – Melab Dec 10 '17 at 19:09

## 1 Answer

Theses are the "Majority" and "Choose" Boolean functions, respectively; they are linear functions by definition. Since there is no multiplicative or exponential element in the formulae then any linear combination of these would also be linear.

As for their applicability to S-Block "Substitution" block ciphers, if you design an algorithm using the functions to generate ciphertext characters based upon plaintext, keycode and substitution alphabet inputs then, yes, they could be used.