# Why do the boolean functions used in cryptographic hashfunctions have 3 inputs (and not more)?

I'm learning about cryptographic hash functions and know why certain boolean functions were chosen to be used in the compression function of cryptographic hash functions (older question).

Hash functions like MD5, SHA-1 and SHA-2 all use boolean function with three inputs. However, SHA-2 uses two functions per round.

SHA-2 uses the following functions in every round:

$f_{1}(B,C,D)=(B\wedge C)\lor(D\wedge \lnot B)$

$f_{2}(B,C,D)=(B\wedge C)\oplus(B\wedge D)\oplus(C\wedge D)$

I do not understand why boolean functions with three inputs are used. Why not use a boolean function with 4, 5 or 6 inputs? Why does SHA-2 use two three valued functions per round, why not one six valued function? If the functions are balanced, good for diffusion and not fully linear, it should not make a difference.

• Strictly speaking these are vector boolean functions (vector input, vector output) of the form $$f:\mathbb{F}_2^{3m}\rightarrow \mathbb{F}_2^m,$$ where $m=32.$ One plausible reason may be the difficulty of analysing vector boolean functions more than three inputs. Dec 5, 2016 at 7:05
• This question should be closed, because there is no clear answer why this and not a different design was chosen (thus making it opinion-based).
– tylo
Dec 5, 2016 at 13:29
• This question is not almost entirely based on opinions, but instead requires facts, references, or specific expertise. Just because my question might not have a clear answer, does not mean it is opinion-based. Dec 5, 2016 at 16:59
• Agreed. The question is clear and objective, even if clear and objective answers may be difficult.
– otus
Dec 6, 2016 at 7:10