Boolean Functions for Cryptography

Affine Equivalence Classes

Definitions

An affine transform maps a Boolean function $f$ to a function $g$ such that

$$g(x) = f(Dx^{T} + a^{T}) + b \cdot x^{T} + c,$$

where $D$ is an $n \times n$ invertible matrix over $\mathrm{GF}(2)$, $a$ and $b$ are $n$-bit vectors, and $c$ is a binary constant. Two functions related by an affine transform are affine equivalent, and the set of all functions equivalent to a given $f$ forms its affine equivalence class.

Affine transforms preserve the most important cryptographic properties — nonlinearity, algebraic degree, the absolute Walsh–Hadamard spectrum and the absolute autocorrelation spectrum are all invariant across a class. Classifying functions into equivalence classes therefore reduces the study of $2^{2^{n}}$ individual functions to a far smaller set of representatives.

The tables below give, for each class: an example truth table (hex), the algebraic order (ord), the nonlinearity (nl), and the distributions of absolute Walsh–Hadamard (WHT) and absolute autocorrelation (AC) values, written as $\{(\text{value}, \text{multiplicity}), \ldots\}$.

In coding-theory terms

Boolean functions have a natural home in coding theory. The truth tables of all functions of degree at most $r$ form the binary Reed–Muller code $\mathrm{RM}(r,n)$, and the affine functions are exactly $\mathrm{RM}(1,n)$. Collecting a function together with all of its affine offsets gives a coset of $\mathrm{RM}(1,n)$, and the affine equivalence classes are the orbits of these cosets under invertible affine changes of variable — the maps $x \mapsto \mathcal{D}x \oplus a$ with $\mathcal{D} \in \mathrm{GL}(n, \mathrm{GF}(2))$. This is the viewpoint from which J. A. Maiorana first enumerated the 150,357 classes of $\mathcal{B}_6$ in 1991.

The same language describes the cryptographic measures directly: the nonlinearity of $f$ is its Hamming distance to $\mathrm{RM}(1,n)$, and the bent functions — the maximum-nonlinearity classes, which exist only for even $n$ — attain the covering radius of $\mathrm{RM}(1,n)$. More generally, the distance from $f$ to $\mathrm{RM}(r,n)$ is its $r$-th order nonlinearity.

Equivalence Classes, $n = 3$

The complete set of equivalence classes for $n \le 5$ can be found by exhaustive search. For three input variables there are 3 classes.

classexampleordnlabs. WHT distributionabs. AC distribution
10xaa10{(0,7),(8,1)}{(8,8)}
20xab31{(2,7),(6,1)}{(4,7),(8,1)}
30xac22{(0,4),(4,4)}{(0,6),(8,2)}

Equivalence Classes, $n = 4$

For four input variables there are 8 classes.

classexampleordnlabs. WHT distributionabs. AC distribution
10xaa5510{(0,15),(16,1)}{(16,16)}
20xab5541{(2,15),(14,1)}{(12,15),(16,1)}
30xbb5532{(0,8),(4,7),(12,1)}{(8,14),(16,2)}
40xaba543{(2,12),(6,3),(10,1)}{(4,12),(12,3),(16,1)}
50xaaff24{(0,12),(8,4)}{(0,12),(16,4)}
60xaba434{(0,6),(4,8),(8,2)}{(0,9),(8,6),(16,1)}
70xab1245{(2,10),(6,6)}{(4,15),(16,1)}
80xac9026{(4,16)}{(0,15),(16,1)}

Class 8 is bent: it achieves the maximum nonlinearity $2^{n-1} - 2^{n/2-1} = 6$ and has a flat absolute Walsh spectrum.

Equivalence Classes, $n = 5$

For five input variables there are 48 classes.

classexampleordnlabs. WHT distributionabs. AC distribution
10xaa55aa5510{(0,31),(32,1)}{(32,32)}
20xaa55ab5551{(2,31),(30,1)}{(28,31),(32,1)}
30xaa55bb5542{(0,16),(4,15),(28,1)}{(24,30),(32,2)}
40xaa5dbb5553{(2,24),(6,7),(26,1)}{(20,28),(28,3),(32,1)}
50xaaddbb5534{(0,24),(8,7),(24,1)}{(16,28),(32,4)}
60xaa5dbb5144{(0,12),(4,16),(8,3),(24,1)}{(16,25),(24,6),(32,1)}
70x2a5dbb5155{(2,20),(6,10),(10,1),(22,1)}{(12,21),(20,10),(32,1)}
80xaaddbb5155{(2,24),(6,4),(10,3),(22,1)}{(12,24),(20,4),(28,3),(32,1)}
90x2a5dbf5136{(4,30),(12,1),(20,1)}{(8,16),(16,15),(32,1)}
100x6a5dbb5146{(0,10),(4,15),(8,6),(20,1)}{(8,16),(16,15),(32,1)}
110x2addbb5146{(0,12),(4,14),(8,4),(12,1),(20,1)}{(8,19),(16,9),(24,3),(32,1)}
120xa8ddbb5146{(0,16),(4,12),(12,3),(20,1)}{(8,24),(24,6),(32,2)}
130xaeddda5157{(2,15),(6,15),(10,1),(18,1)}{(4,10),(12,21),(32,1)}
140x0a5dbf5157{(2,18),(6,12),(14,1),(18,1)}{(4,16),(12,9),(20,6),(32,1)}
150x8addda5157{(2,19),(6,9),(10,3),(18,1)}{(4,13),(12,15),(20,3),(32,1)}
160xa8dd9b5157{(2,22),(6,6),(10,2),(14,1),(18,1)}{(4,18),(12,6),(20,6),(28,1),(32,1)}
170x88ddbb5157{(2,28),(14,3),(18,1)}{(4,24),(28,7),(32,1)}
180x88ddbb1128{(0,28),(16,4)}{(0,24),(32,8)}
190x8c5dda5138{(0,19),(8,12),(16,1)}{(0,9),(8,16),(16,6),(32,1)}
200xa89d9b5138{(0,22),(8,8),(16,2)}{(0,18),(16,12),(32,2)}
210x8eddda5148{(0,7),(4,16),(8,8),(16,1)}{(0,6),(8,22),(16,3),(32,1)}
220xaefdda5148{(0,9),(4,15),(8,6),(12,1),(16,1)}{(0,9),(8,16),(16,6),(32,1)}
230x025dbf5148{(0,10),(4,16),(8,4),(16,2)}{(0,16),(8,4),(16,9),(24,2),(32,1)}
240x88ddda5148{(0,11),(4,14),(8,4),(12,2),(16,1)}{(0,11),(8,13),(16,6),(24,1),(32,1)}
250x88dd9b5148{(0,14),(4,14),(12,2),(16,2)}{(0,17),(8,7),(24,7),(32,1)}
260xceddda5159{(2,15),(6,13),(10,3),(14,1)}{(4,22),(12,9),(32,1)}
270x0eddda5159{(2,15),(6,13),(10,3),(14,1)}{(4,24),(12,6),(20,1),(32,1)}
280x425dbf5159{(2,18),(6,10),(10,2),(14,2)}{(4,20),(12,9),(20,2),(32,1)}
290x8cddda5159{(2,19),(6,7),(10,5),(14,1)}{(4,21),(12,9),(20,1),(32,1)}
300x88dddb5159{(2,21),(6,7),(10,1),(14,3)}{(4,24),(20,7),(32,1)}
310x289d9b5159{(2,22),(6,4),(10,4),(14,2)}{(4,18),(12,12),(28,1),(32,1)}
320x86fdda51310{(4,28),(12,4)}{(0,12),(8,16),(16,3),(32,1)}
330x88dddb71310{(4,28),(12,4)}{(0,24),(16,7),(32,1)}
340xcefdda51410{(0,6),(4,15),(8,10),(12,1)}{(0,15),(8,16),(32,1)}
350x0efdda51410{(0,8),(4,14),(8,8),(12,2)}{(0,15),(8,14),(16,2),(32,1)}
360x288d9b51410{(0,8),(4,14),(8,8),(12,2)}{(0,17),(8,13),(24,1),(32,1)}
370x8cfdda51410{(0,10),(4,13),(8,6),(12,3)}{(0,12),(8,16),(16,3),(32,1)}
380x8cdddb51410{(0,12),(4,12),(8,4),(12,4)}{(0,18),(8,6),(16,7),(32,1)}
390x8ccdda51410{(0,12),(4,12),(8,4),(12,4)}{(0,8),(8,21),(16,1),(24,1),(32,1)}
400x289d9b41410{(0,16),(4,10),(12,6)}{(8,30),(32,2)}
410x488ddb51511{(2,12),(6,16),(10,4)}{(4,28),(12,3),(32,1)}
420xccfdda51511{(2,16),(6,10),(10,6)}{(4,25),(12,6),(32,1)}
430x688d9b51511{(2,16),(6,10),(10,6)}{(4,27),(12,3),(20,1),(32,1)}
440x288d9b41511{(2,16),(6,10),(10,6)}{(4,30),(28,1),(32,1)}
450x288d1b41212{(0,16),(8,16)}{(0,30),(32,2)}
460xdcfdda51312{(0,16),(8,16)}{(0,15),(8,16),(32,1)}
470x68ad9b51312{(0,16),(8,16)}{(0,27),(16,4),(32,1)}
480x688ddb51412{(0,4),(4,16),(8,12)}{(0,24),(8,6),(16,1),(32,1)}

The maximum nonlinearity for $n = 5$ is 12 (classes 45–48); no bent functions exist for odd $n$.

Equivalence Classes, $n = 6$

For six input variables there are 150,357 equivalence classes — too many to list individually, but completely enumerated. Of these, 74,542 contain balanced functions. The table below summarises the classes by nonlinearity; within each nonlinearity level the classes further split by algebraic order and maximum absolute autocorrelation.

150,357
total classes
74,542
with balanced functions
28
maximum nonlinearity (bent)

Classes by nonlinearity

nlclassesnlclasses
0115626
11161,326
21172,647
31185,496
421910,789
522019,964
642131,521
762238,142
8112327,795
9152410,280
102925983
11462684
1292274
13160284
14325

The 4 bent classes at nonlinearity 28 are the maximally nonlinear functions for $n = 6$: one of algebraic order 2 (the quadratic bent class) and three of order 3. Together they account for over 5 billion individual bent functions.

Data files

The complete classification gives one representative function for every class. It is split into one file per combination of nonlinearity, algebraic order and maximum absolute autocorrelation $(\text{nl}, \text{ord}, \text{acmax})$. These data files accompanied the original site and have been used by other researchers, for example in NIST's study of the multiplicative complexity of 6-variable Boolean functions.

Format. Plain text, one class per line:

class=150341; tt=0x110707FF,0xE0422107;

class is the class number and tt is the 64-bit truth table of a representative, written as two 32-bit words. In the balanced files the classes are numbered separately (1–74,542). Each class contains at least one balanced function, but the representative listed is the class's usual representative and is not necessarily balanced itself.

Classes by (nl, ord, acmax): all 182 combinations
nlordacmaxclasseswith balancedfile
016411n6_nl0_ord1_acmax64.exp
166010n6_nl1_ord6_acmax60.exp
256411n6_nl2_ord5_acmax64.exp
366010n6_nl3_ord6_acmax60.exp
446411n6_nl4_ord4_acmax64.exp
455611n6_nl4_ord5_acmax56.exp
565210n6_nl5_ord6_acmax52.exp
566010n6_nl5_ord6_acmax60.exp
644810n6_nl6_ord4_acmax48.exp
654811n6_nl6_ord5_acmax48.exp
655611n6_nl6_ord5_acmax56.exp
656411n6_nl6_ord5_acmax64.exp
764420n6_nl7_ord6_acmax44.exp
765220n6_nl7_ord6_acmax52.exp
766020n6_nl7_ord6_acmax60.exp
836411n6_nl8_ord3_acmax64.exp
844011n6_nl8_ord4_acmax40.exp
844811n6_nl8_ord4_acmax48.exp
846411n6_nl8_ord4_acmax64.exp
854011n6_nl8_ord5_acmax40.exp
854833n6_nl8_ord5_acmax48.exp
855633n6_nl8_ord5_acmax56.exp
963610n6_nl9_ord6_acmax36.exp
964450n6_nl9_ord6_acmax44.exp
965260n6_nl9_ord6_acmax52.exp
966030n6_nl9_ord6_acmax60.exp
1044010n6_nl10_ord4_acmax40.exp
1044840n6_nl10_ord4_acmax48.exp
1054066n6_nl10_ord5_acmax40.exp
105481010n6_nl10_ord5_acmax48.exp
1055666n6_nl10_ord5_acmax56.exp
1056422n6_nl10_ord5_acmax64.exp
1163650n6_nl11_ord6_acmax36.exp
11644220n6_nl11_ord6_acmax44.exp
11652140n6_nl11_ord6_acmax52.exp
1166050n6_nl11_ord6_acmax60.exp
1236411n6_nl12_ord3_acmax64.exp
1243222n6_nl12_ord4_acmax32.exp
1244044n6_nl12_ord4_acmax40.exp
1244866n6_nl12_ord4_acmax48.exp
1246433n6_nl12_ord4_acmax64.exp
1253233n6_nl12_ord5_acmax32.exp
125403131n6_nl12_ord5_acmax40.exp
125483030n6_nl12_ord5_acmax48.exp
125561212n6_nl12_ord5_acmax56.exp
1362820n6_nl13_ord6_acmax28.exp
13636480n6_nl13_ord6_acmax36.exp
13644720n6_nl13_ord6_acmax44.exp
13652290n6_nl13_ord6_acmax52.exp
1366090n6_nl13_ord6_acmax60.exp
1433210n6_nl14_ord3_acmax32.exp
1443260n6_nl14_ord4_acmax32.exp
1444090n6_nl14_ord4_acmax40.exp
14448130n6_nl14_ord4_acmax48.exp
1452411n6_nl14_ord5_acmax24.exp
145324444n6_nl14_ord5_acmax32.exp
14540153153n6_nl14_ord5_acmax40.exp
145487070n6_nl14_ord5_acmax48.exp
145562323n6_nl14_ord5_acmax56.exp
1456455n6_nl14_ord5_acmax64.exp
1562010n6_nl15_ord6_acmax20.exp
15628400n6_nl15_ord6_acmax28.exp
156362960n6_nl15_ord6_acmax36.exp
156442130n6_nl15_ord6_acmax44.exp
15652620n6_nl15_ord6_acmax52.exp
15660140n6_nl15_ord6_acmax60.exp
1626411n6_nl16_ord2_acmax64.exp
1633222n6_nl16_ord3_acmax32.exp
1636422n6_nl16_ord3_acmax64.exp
1641611n6_nl16_ord4_acmax16.exp
1642411n6_nl16_ord4_acmax24.exp
164323636n6_nl16_ord4_acmax32.exp
164402626n6_nl16_ord4_acmax40.exp
164482525n6_nl16_ord4_acmax48.exp
1646455n6_nl16_ord4_acmax64.exp
165241818n6_nl16_ord5_acmax24.exp
16532459459n6_nl16_ord5_acmax32.exp
16540536536n6_nl16_ord5_acmax40.exp
16548175175n6_nl16_ord5_acmax48.exp
165563939n6_nl16_ord5_acmax56.exp
1762060n6_nl17_ord6_acmax20.exp
176286110n6_nl17_ord6_acmax28.exp
176361,3600n6_nl17_ord6_acmax36.exp
176445400n6_nl17_ord6_acmax44.exp
176521150n6_nl17_ord6_acmax52.exp
17660150n6_nl17_ord6_acmax60.exp
1831610n6_nl18_ord3_acmax16.exp
1833210n6_nl18_ord3_acmax32.exp
1841610n6_nl18_ord4_acmax16.exp
18424220n6_nl18_ord4_acmax24.exp
184321030n6_nl18_ord4_acmax32.exp
18440580n6_nl18_ord4_acmax40.exp
18448410n6_nl18_ord4_acmax48.exp
1851610n6_nl18_ord5_acmax16.exp
18524485483n6_nl18_ord5_acmax24.exp
185322,8502,850n6_nl18_ord5_acmax32.exp
185401,5321,532n6_nl18_ord5_acmax40.exp
18548336336n6_nl18_ord5_acmax48.exp
185565959n6_nl18_ord5_acmax56.exp
1856466n6_nl18_ord5_acmax64.exp
1961210n6_nl19_ord6_acmax12.exp
196201960n6_nl19_ord6_acmax20.exp
196284,9800n6_nl19_ord6_acmax28.exp
196364,3360n6_nl19_ord6_acmax36.exp
196441,0830n6_nl19_ord6_acmax44.exp
196521720n6_nl19_ord6_acmax52.exp
19660210n6_nl19_ord6_acmax60.exp
2033233n6_nl20_ord3_acmax32.exp
2036422n6_nl20_ord3_acmax64.exp
2041655n6_nl20_ord4_acmax16.exp
20424134134n6_nl20_ord4_acmax24.exp
20432331331n6_nl20_ord4_acmax32.exp
204409494n6_nl20_ord4_acmax40.exp
204484949n6_nl20_ord4_acmax48.exp
2046477n6_nl20_ord4_acmax64.exp
205162219n6_nl20_ord5_acmax16.exp
205245,5365,535n6_nl20_ord5_acmax24.exp
2053210,36810,365n6_nl20_ord5_acmax32.exp
205402,9032,903n6_nl20_ord5_acmax40.exp
20548453453n6_nl20_ord5_acmax48.exp
205565757n6_nl20_ord5_acmax56.exp
2161230n6_nl21_ord6_acmax12.exp
216203,4650n6_nl21_ord6_acmax20.exp
2162819,7210n6_nl21_ord6_acmax28.exp
216367,1320n6_nl21_ord6_acmax36.exp
216441,0670n6_nl21_ord6_acmax44.exp
216521220n6_nl21_ord6_acmax52.exp
21660110n6_nl21_ord6_acmax60.exp
2231630n6_nl22_ord3_acmax16.exp
2233210n6_nl22_ord3_acmax32.exp
22416380n6_nl22_ord4_acmax16.exp
224244010n6_nl22_ord4_acmax24.exp
224323260n6_nl22_ord4_acmax32.exp
22440710n6_nl22_ord4_acmax40.exp
22448320n6_nl22_ord4_acmax48.exp
22516617613n6_nl22_ord5_acmax16.exp
2252421,65521,651n6_nl22_ord5_acmax24.exp
2253212,85212,852n6_nl22_ord5_acmax32.exp
225401,9081,908n6_nl22_ord5_acmax40.exp
22548208208n6_nl22_ord5_acmax48.exp
225562626n6_nl22_ord5_acmax56.exp
2256444n6_nl22_ord5_acmax64.exp
23612140n6_nl23_ord6_acmax12.exp
2362010,8980n6_nl23_ord6_acmax20.exp
2362814,5240n6_nl23_ord6_acmax28.exp
236362,1270n6_nl23_ord6_acmax36.exp
236442020n6_nl23_ord6_acmax44.exp
23652250n6_nl23_ord6_acmax52.exp
2366050n6_nl23_ord6_acmax60.exp
2426411n6_nl24_ord2_acmax64.exp
2431611n6_nl24_ord3_acmax16.exp
2433266n6_nl24_ord3_acmax32.exp
2436422n6_nl24_ord3_acmax64.exp
244165454n6_nl24_ord4_acmax16.exp
24424304304n6_nl24_ord4_acmax24.exp
24432161161n6_nl24_ord4_acmax32.exp
244402020n6_nl24_ord4_acmax40.exp
244481111n6_nl24_ord4_acmax48.exp
2446411n6_nl24_ord4_acmax64.exp
245161,6261,626n6_nl24_ord5_acmax16.exp
245246,7166,716n6_nl24_ord5_acmax24.exp
245321,2391,239n6_nl24_ord5_acmax32.exp
24540118118n6_nl24_ord5_acmax40.exp
245481817n6_nl24_ord5_acmax48.exp
2455622n6_nl24_ord5_acmax56.exp
25612730n6_nl25_ord6_acmax12.exp
256207450n6_nl25_ord6_acmax20.exp
256281490n6_nl25_ord6_acmax28.exp
25636150n6_nl25_ord6_acmax36.exp
2564410n6_nl25_ord6_acmax44.exp
26416340n6_nl26_ord4_acmax16.exp
26424170n6_nl26_ord4_acmax24.exp
2643220n6_nl26_ord4_acmax32.exp
2644010n6_nl26_ord4_acmax40.exp
265880n6_nl26_ord5_acmax8.exp
265161313n6_nl26_ord5_acmax16.exp
2652477n6_nl26_ord5_acmax24.exp
2653211n6_nl26_ord5_acmax32.exp
2654011n6_nl26_ord5_acmax40.exp
276440n6_nl27_ord6_acmax4.exp
282010n6_nl28_ord2_acmax0.exp
283030n6_nl28_ord3_acmax0.exp

History of this data

How to cite

If you use these data files or tables, please cite the thesis, and the archived dataset if you used the files:

J. Fuller. Analysis of Affine Equivalent Boolean Functions for Cryptography. PhD thesis, Queensland University of Technology, Brisbane, Australia, 2003. https://eprints.qut.edu.au/15828/.

J. Fuller. Boolean Functions for Cryptography: affine equivalence class data. Zenodo, 2026. doi:10.5281/zenodo.24217283 (data first published 2003).

@phdthesis{fuller2003affine,
  author = {Joanne Fuller},
  title  = {Analysis of Affine Equivalent Boolean Functions for Cryptography},
  school = {Queensland University of Technology},
  address = {Brisbane, Australia},
  year   = {2003},
  url    = {https://eprints.qut.edu.au/15828/},
  note   = {Data: \url{https://booleanfunction.github.io/equivalence-classes.html}}
}

@misc{fuller_n6_data,
  author    = {Joanne Fuller},
  title     = {Boolean Functions for Cryptography: affine equivalence class data},
  publisher = {Zenodo},
  year      = {2026},
  doi       = {10.5281/zenodo.24217283},
  url       = {https://doi.org/10.5281/zenodo.24217283},
  note      = {Data first published 2003}
}