How this calculation works
Transform a Boolean truth table into algebraic normal form and its Walsh spectrum. The result includes algebraic degree, balance and nonlinearity, with an exact Parseval check on the spectrum. The input order is explicit: truth-table index bits identify variables, with the lowest bit corresponding to x0. These transforms describe a Boolean function rather than minimizing an ordinary sum-of-products expression.
ANF coefficients use the Boolean Möbius transform; W_f(u)=Σ_x (−1)^(f(x)+u·x).A worked example
Truth table 0,0,0,1 is the two-input AND function. Its ANF is x0 x1, algebraic degree two, and Walsh spectrum 2,2,2,−2. Maximum Walsh magnitude two gives nonlinearity one; the function is not balanced.
Good to know
2^n binary values for 1–8 variables. Input bit i is x_i, with x0 least significant. Integer ANF/Walsh calculations and Parseval check. These structural measures do not certify cryptographic security.
Fixing the truth-table order
The table length must be a power of two, and each entry must be zero or one. Index i represents the binary assignment whose least significant bit is x0.
Changing that convention permutes variables and can change the printed expression even when the function is intended to be the same. Keep the variable order with any exported truth table. A missing row or a duplicated assignment cannot be repaired by the transform itself.
Analyzes an entire Boolean function rather than applying an operation to two fixed words. The Boolean expression minimizer from minterms and dont cares offers a complementary calculation under its own stated assumptions.
Algebraic normal form uses XOR
ANF is a sum of squarefree monomials over the two-element field. Addition is XOR, so two equal terms cancel rather than reinforce.
Multiplication is logical AND on Boolean inputs. The coefficient indexed by a bit mask belongs to the product of the variables selected by that mask; the zero mask is the constant term. This differs from an ordinary OR of AND terms, even though both can be written using similar-looking symbols.
Worked example and mathematical rule
Truth table 0,0,0,1 is the two-input AND function. Its ANF is x0 x1, algebraic degree two, and Walsh spectrum 2,2,2,−2. Maximum Walsh magnitude two gives nonlinearity one; the function is not balanced.
ANF coefficients use the Boolean Möbius transform; W_f(u)=Σ_x (−1)^(f(x)+u·x).
Degree and affine functions
The algebraic degree is the largest number of variables in a monomial with coefficient one. Affine functions have degree at most one, but high degree alone does not establish cryptographic strength.
The identically zero function is assigned the displayed degree convention rather than an extended negative-infinity value. Variable permutations preserve degree and nonlinearity. Complementing the output changes the constant ANF coefficient and signs of Walsh values without changing nonlinearity.
Walsh coefficients measure correlation
A Walsh coefficient sums plus or minus one contributions comparing the Boolean function with a linear parity function. Large absolute coefficients indicate strong correlation with some affine function.
The spectrum is computed by an exact integer butterfly transform, and the sum of squared coefficients is checked against the squared table length. Parseval conservation catches important transform mistakes, but it does not certify that the original truth table represents the intended real-world logic.
Balance and nonlinearity
Balance means exactly half the truth-table entries are one. The zero-frequency Walsh coefficient detects that property.
Nonlinearity is the minimum Hamming distance from all affine Boolean functions and is obtained from the largest absolute Walsh coefficient. It is not the same as algebraic degree, number of ANF terms or a fitted regression residual. Two functions can share these summary statistics while having different spectra and different other combinatorial properties.
Using the output beyond a toy example
Verify an ANF by evaluating its monomials with XOR at several assignments, especially the all-zero row and single-variable rows. The tool does not assess differential uniformity, algebraic immunity, implementation side channels or a full cipher design.
A favorable nonlinearity number alone is not a security certification. For logic work, remember that ANF can be compact for parity-rich functions but verbose for others; an OR-based minimizer answers a different representation question.
A few questions, answered
Is ANF addition ordinary OR?
No. It is XOR over the field with two elements.
Which variable changes fastest in the table?
x0, corresponding to the least significant index bit.
Is nonlinearity the same as degree?
No. It measures distance from affine functions, while degree measures monomial size.
Does a good Walsh spectrum certify a secure cipher?
No. Many other mathematical and implementation properties matter.