Trims and Extensions of Quadratic APN Functions

In this work, we study functions that can be obtained by restricting a vectorial Boolean function $F \colon \mathbb{F}_2^n \rightarrow \mathbb{F}_2^n$ to an affine hyperplane of dimension $n-1$ and then projecting the output to an $n-1$-dimensional space. We show that a multiset of $2 \cdot (2^n-1)^2$ EA-equivalence classes of such restrictions defines an EA-invariant for vectorial Boolean functions on $\mathbb{F}_2^n$. Further, for all of the known quadratic APN functions in dimension $n<10$, we determine the restrictions that are also APN. Moreover, we construct 6,368 new quadratic APN functions in dimension eight up to EA-equivalence by extending a quadratic APN function in dimension seven. A special focus of this work is on quadratic APN functions with maximum linearity. In particular, we characterize a quadratic APN function $F \colon \mathbb{F}_2^n \rightarrow \mathbb{F}_2^n$ with linearity of $2^{n-1}$ by a property of the ortho-derivative of its restriction to a linear hyperplane. Using the fact that all quadratic APN functions in dimension seven are classified, we are able to obtain a classification of all quadratic 8-bit APN functions with linearity $2^7$ up to EA-equivalence.


Introduction
Let us be given two integers n, m ∈ N with m < n and two vectorial Boolean functions F : F n 2 → F n 2 and G : F m 2 → F m 2 . We say that F is an extension of G and that G is a restriction of F , denoted G ≺ F , if there exists an affine injective mapping φ : F m 2 → F n 2 and an affine surjection ϕ : This version of the article has been accepted for publication, after peer review but is not the Version of Record and does not reflect post-acceptance improvements, or any corrections. The Version of Record is available online at: https://doi.org/10.1007/s10623-022-01024-4. In the remainder of this work, we concentrate on the case of m = n − 1, but let us recall first that there are well-known examples for APN restrictions, resp., APN extensions. Indeed, given an APN monomial function F on F 2 n , then the restriction G of F to any proper subfield of F 2 n is APN.
The notion of restriction defines a strict partial ordering on the set of vectorial Boolean functions with the same dimension in the input and the output. Indeed the relation is irreflexive, as no function is its own extension simply as we exclude the case n = m by requiring m < n . For the same reason, the relation is antisymmetric, i.e. no function can be both an extension and a restriction of any given function. Transitivity follows directly from the definition.
The notion of restriction for vectorial Boolean functions also defines a notion of restriction on EA-equivalence classes of vectorial Boolean functions. We say that the EA-equivalence class of F is the extension of the EA-equivalence class of G if there exist a function G which is EA-equivalent to G such that G ≺ F . This is well-defined as, given two EA-equivalent functions F and F and a function G that is the restriction of F , then there exists an EA-equivalent function G to G such that G is the restriction of F .
As mentioned above, we only focus on the case m = n − 1, that is extensions and restrictions by adding or removing only a single dimension. One question is how to algorithmically check for a given APN function whether it is an extension or a restriction of another APN function and whether we can discover new APN functions as extensions or restrictions of known functions. In Section 3, we define an operation called trimming, which restricts a vectorial Boolean function F on F n 2 to a linear or affine hyperplane of dimension n − 1 and then projects the output to an n − 1-dimensional space by discarding one component function. Compared to the case in which only a coordinate is discarded, we show that this operation is sound in the sense that (1), any function on F n−1 2 that is a restriction of F is EA-equivalent to a trim of F and, (2), EA-equivalent functions yield EA-equivalent trims when considering all 2 · (2 n − 1) 2 possibilities to choose the affine hyperplanes and the component functions. This way, we obtain an EA-invariant, which we call trim spectrum. We then analyze how many of the known quadratic APN functions in dimensions n < 10 contain APN restrictions. The results are visualized in a so-called trimming graph, see Figures 1 and 2.
For constructing new APN functions that have a given APN function as a restriction, the focus on EA-equivalence classes is helpful as, in a nutshell, extending a function by one dimension boils down to constructing one additional coordinate function and deducing the values for the remaining input values. More precisely, an APN function G on F n 2 is a restriction of an APN function in dimension n + 1 if there exist Boolean functions r 1 , r 2 : F n 2 → F 2 and a vectorial Boolean function G : F n 2 → F n 2 such that T : is APN. While for very small dimensions it is possible to check if a function G is an APN restriction of some function, this becomes prohibitively expensive as n increases. However, focusing on quadratic functions for T and G allows for much stronger results. As we will detail in Section 4, in the case where we want to determine if a given quadratic APN function G is a restriction of a quadratic APN function T , the function G differs from G itself only by a linear mapping L and r 2 differs by a linear Boolean function from r 1 . This, obviously, reduces the search space significantly. By using a recursive tree search with backtracking, we are able to construct 6,368 new quadratic APN functions in dimension n = 8 up to EA-equivalence. Those new functions are APN extensions of quadratic 7-bit APN functions by construction and it is worth remarking that the vast majority of the previously-known APN functions in dimension n = 8 are not, i.e., they do not have APN functions within their trim spectrum. As we found out that almost all of the quadratic APN functions in dimension n = 7 can be extended to quadratic APN functions in dimension n = 8, we conjecture that for each dimension n, there exist APN functions F i : F i 2 → F i 2 , i = 2, . . . , n such that F 2 ≺ F 3 ≺ · · · ≺ F n−1 ≺ F n , so called recursive APN functions.
For APN functions in the form of Equation (1), the case where T is quadratic and r 1 is constant and equal to zero is of particular interest. Indeed, as it was already observed in [13,Remark 12], any quadratic APN function on F n 2 with linearity 2 n−1 , i.e., the highest possible linearity of a quadratic APN function, is EA-equivalent to the extension T of a quadratic APN function G with choosing r 1 = 0 (as in the form of Equation (1)). Moreover, we show that for the ortho-derivative π G of G, we have π G (α), L(α) = 1 for all α ∈ F n 2 \ {0} with (α) = 0. This observation allows us in particular to classify all quadratic APN functions with maximum linearity in dimension eight, simply by using the recent classification of all quadratic 7-bit APN functions into EA-equivalence classes and by recovering L from the ortho-derivative of G using linear algebra.
In the last part of this paper, we provide some further observations on quadratic APN functions with maximum linearity. In particular, we provide a simple representation of those functions and study their Walsh spectra, as well as their ortho-derivatives. We conclude by listing several open problems for future work.

Related Work
The effect on the differential uniformity and on the linearity of restricting a vectorial Boolean function to an affine subspace was first studied in [23]. Restrictions of APN functions that are obtained by discarding one output coordinate have also been studied before, see [18,19].
APN functions are completely classified up to n ≤ 5, see [6]. For n = 6, 7, we know a complete classification of quadratic and cubic, and quadratic APN functions up to EA-equivalence, respectively [21,11,20]. For n = 8, at the time of submission of this manuscript in August 2021, we know 26,524 distinct quadratic APN functions up to EA-equivalence. Those are the ones listed by Edel and Pott [17] in 2009, the 10 functions constructed in [28], the 8,157 functions found by the QAM approach in 2014 [32, 31], the two functions coming from the Taniguchi family [27], the 12,921 functions found by the recursive tree search utilizing linear self-equivalences [2], and the 5,412 functions found by the QAM approach very recently [30]. The authors of [30] conjectured that there are more than 50,000 distinct quadratic APN functions in dimension n = 8 up to EA-equivalence.
One interesting result reported in [2] is the fact that, among the 12,921 found APN functions in dimension n = 8, four of them have a linearity of 2 n−1 , which is the highest value that can possibly be achieved for quadratic APN functions. Note that for n ≤ 4, every quadratic APN function admits a linearity of 2 n−1 trivially. 1 In odd dimension n ≥ 5, a quadratic APN function cannot have linearity 2 n−1 , since every such function must be almost bent [15]. In dimension n = 6, there is exactly one quadratic APN function up to EA-equivalence which admits the highest possible linearity of 2 n−1 . The existence of quadratic APN functions in dimension n having linearity 2 n−1 is still unknown for n > 8. Preliminary observations on such functions have been remarked in [13].
In [20], the authors proposed a secondary approach to search for quadratic APN functions in dimension n + 1 by extending a quadratic APN function in dimension n. The approach was to guess the (n + 1)-th coordinate function and to utilize necessary properties of the algebraic normal form of the extended function. The search was then quite similar to the QAM approach [32]. However, no results were reported for n ≥ 7.

Notation and Preliminaries
By N, we denote the set of natural numbers {1, 2, 3, . . . } and by F q , we denote the finite field with q elements. In this work, we focus on functions between finite-dimensional F 2 -vector spaces, also called vectorial Boolean functions. For n ∈ N, the set of invertible linear automorphisms from F n 2 to itself is denoted by GL(n, F 2 ) and in our notation, we use matrices and their corresponding linear mappings interchangeably. In the following, let V, V , W, W be finite-dimensional (non-zero) vector spaces over F 2 . We denote the set of all linear mappings from V to W by L(V, W). An affine function from V to W is a function of the form x → L(x) + c, where L ∈ L(V, W) and c ∈ W. Two vectorial Boolean functions F : V → W, G : V → W are called extended-affine equivalent (EA-equivalent for short) if there exist affine bijections A : V → V, B : W → W and an affine function C : V → W such that G = B • F • A + C. If C = 0, the functions F and G are called affine-equivalent, and if C = 0 and A and B are linear bijections, the two functions F and G are called linear-equivalent. We are interested in vectorial Boolean functions only up to EA-equivalence since the most important cryptographic properties are invariant under this equivalence relation, most importantly the algebraic degree, the differential uniformity, as well as the linearity. We recall the definition of those three notions in the following paragraphs. For a comprehensive textbook on the theory of Boolean functions and vectorial Boolean functions, we refer to [14].
Any Boolean function f : F n 2 → F 2 can be uniquely expressed as a multivariate polynomial in F 2 [X 1 , . . . , X n ]/(X 2 1 + X 1 , . . . , X 2 n + X n ) via The algebraic degree of f is defined as max {u∈F n 2 |au =0} wt(u), where wt(u) denotes the Hamming weight of the binary vector u. Without loss of generality, a function from V to W with dim(V) = n, dim(W) = m can be represented as a function F : F n 2 → F m 2 by applying a linear function in the input and in the output. In this representation, F can be given by its m coordinate functions . . , f m (x 1 , . . . , x n )). The algebraic degree of a vectorial Boolean function from V to W is defined as the maximum algebraic degree over all its coordinate functions when represented as a function from F n 2 to F m 2 . Functions with algebraic degree equal to 2 are called quadratic and functions with algebraic degree at most 1 are called affine.
The differential uniformity [22] of a function F : V → W is defined as max α∈V\{0},β∈W |{x ∈ V | F (x) + F (x + α) = β}|. It is straightforward to observe that the differential uniformity of a function F : V → W is an even integer larger than or equal to 2. For F 2 -vector spaces V, W of the same finite dimension, a function F : V → W with the least possible differential uniformity of 2 is called almost perfect nonlinear (or APN for short) [24].
Let ·, · V : V × V → F 2 and ·, · W : W × W → F 2 be non-degenerate symmetric bilinear forms and let F : and the linearity of F corresponds to the maximum absolute value of its Walsh transform, i.e., max α∈V,β∈W\{0} | F β (α)|. The linearity is a measure on how well a component can be approximated by an affine function. When V = F n 2 for an integer n ∈ N, we use x, y V = x, y = wt( n i=1 x i y i ) mod 2, where x = (x 1 , x 2 , . . . , x n ), y = (y 1 , y 2 , . . . , y n ) ∈ F n 2 and wt(k) denotes the Hamming weight of the binary expansion of k ∈ N ∪ {0}. In case of V = F 2 n for an integer n ∈ N, we use x, y V = Tr (xy), where x, y ∈ F 2 n and Tr denotes the absolute trace function, defined as It is well known that the Walsh transform of a quadratic Boolean function f : F n 2 → F 2 only takes values in {0, ±2 n+k 2 }, where k is the dimension of the vector space {a ∈ F n 2 | x → f (x) + f (x + a) is constant}, see [14,Prop. 55]. Therefore, the Walsh transform of a quadratic vectorial Boolean function F : V → W can only take 0 or powers of 2 as absolute values. In case that F is APN and dim(V) = dim(W) = n > 2, we know that the linearity of F cannot be equal to 2 n , see [14,Prop. 161]. Therefore, when F is APN and quadratic, the linearity of F can be at most 2 n−1 , which motivates the following definition. Definition 1. Let n ∈ N, n > 2 and let V, W be n-dimensional F 2 -vector spaces. We say that a quadratic APN function F : V → W has maximum linearity if it has linearity 2 n−1 .
If n ∈ N is odd, every quadratic APN function is almost bent, i.e., its Walsh transform can only take values in {0, ±, 2 n+1 2 }, see [15]. Therefore, quadratic APN functions with maximum linearity can only exist in even dimensions n or for n = 3. Until recently, we only knew the existence of quadratic APN functions with maximum linearity up to n = 6, see [17] for an example in dimension 6. In [2], the authors found 4 EA-inequivalent instances in dimension n = 8. It is still an open problem whether quadratic APN functions with maximum linearity exist for n ≥ 10.
In this work, we need the notion of the ortho-derivative of a quadratic APN function, which is defined as follows.
Definition 2 ( [12]). Let V, W be F 2 -vector spaces of the same finite dimension and let ·, · W : W × W → F 2 be a non-degenerate symmetric bilinear form. Let G : V → W be a quadratic APN function.
The ortho-derivative of G is defined as the unique function π G : V → W with π G (0) = 0 such that, for all α ∈ V \ {0}, we have π G (α) = 0 and The ortho-derivative π G of a given quadratic APN function G : F n 2 → F n 2 is computed from the difference distribution table (DDT) of G by first identifying, for every a ∈ F n 2 , the linear part of the affine space {b ∈ F n 2 | DDT G [a, b] = 2}, and then finding the value π G (a) which is orthogonal to it. 2 Overall, the most computationally demanding step is the computation of the DDT, which takes time O(2 2n ).
The authors of [12] showed that for two EA-equivalent quadratic APN functions G, G : F n 2 → F n 2 , the ortho-derivatives π G and π G are linear-equivalent. Indeed, the linear-equivalence of the orthoderivatives is a strongly discriminating EA-invariant for quadratic APN functions, which allows in many cases to efficiently detect the EA-inequivalence of two quadratic APN functions. , this would quickly become infeasible already for very small values of n. However, as we are only interested in vectorial Boolean functions up to EA-equivalence, the particular restrictions and projections that have to be taken into account can be significantly reduced, as we outline in the following. For an element α ∈ F n 2 \{0}, we denote by α ⊥ its orthogonal, i.e., α ⊥ = {x ∈ F n 2 | α, x = 0}, which is an n − 1-dimensional linear hyperplane. We denote its complement set F n 2 \ α ⊥ by α ⊥ . For a non-zero element β ∈ F n 2 and an element γ ∈ F n 2 such that β, γ = 1, we define ρ (γ) β as the function ρ (γ)

Function Trimming
If we represent F n 2 as the direct sum F n 2 = γ ⊥ ⊕ {0, β}, for any vector is a projection of F n 2 to γ ⊥ . The following definition precisely captures the idea of restricting the input and projecting the output of a vectorial Boolean function.
Definition 3 (Trim along (H, β)). Let n ∈ N, n ≥ 2, β ∈ F n 2 be a non-zero element and let H ⊆ F n 2 be a hyperplane of dimension n − 1, so that H = α ⊥ or H = α ⊥ for some non-zero α ∈ F n 2 . Let ∈ F n 2 be zero if H = α ⊥ and / ∈ α ⊥ otherwise, and let γ ∈ F n 2 \ β ⊥ . The trim of a function F along (H, β) with respect to , γ is then defined as Note that, for a given F : F n 2 → F n 2 , we can convert every function T ,γ H β F : α ⊥ → γ ⊥ to a function from F n−1 2 to F n−1 2 by applying linear bijections in the input and in the output. Moreover, if we are only interested in T ,γ H β F up to affine-equivalence, the particular choice of and γ does not matter, as we show in the following proposition.
For a fixed choice of (H, β) with β ∈ F n 2 being a non-zero element and H ⊆ F n 2 being a hyperplane of dimension n − 1, all trims of F along (H, β) with respect to some , γ are affine-equivalent.
Proof. We first consider the case of a fixed γ ∈ F n 2 \ β ⊥ and varying . If H is a linear hyperplane, i.e., H = α ⊥ for some non-zero α ∈ F n 2 , there is only one valid choice of , i.e., = 0. Let us therefore consider the case that H = α ⊥ . Let , ∈ F n 2 \ α ⊥ and let α ∈ α ⊥ be such that = + α . We have

Let us now consider the case of a fixed and varying
Because of the above proposition, we say that the EA-equivalence class of T ,γ H β F is the trim of F along (H, β), denoted T H β F . Remark 1. To the best of our knowledge, the effect on the differential uniformity and on the linearity of restricting a vectorial Boolean function to an affine subspace was first studied in [23]. Moreover, the paper [23] also derived an upper bound and a lower bound on the differential uniformity of a vectorial Boolean function when composing it with an affine surjection from the output. There are some works that study subfunctions of APN functions obtained by discarding one output coordinate, e.g., [18,19]. We remark that the notion of a trim covers the case of restricting the input of F to an affine hyperplane and then discarding one output coordinate of F , but it is more general than that.
The following proposition states that every restriction of F in dimension n − 1 is EA-equivalent to a trim of F .
be given with G ≺ F . Then, there exists a non-zero element β ∈ F n 2 and an affine hyperplane H ⊆ F n 2 of dimension n − 1 such that G is EA-equivalent to an (every) element in T H β F .
Proof. By definition, there exists an affine injective mapping φ : F n−1 2 → F n 2 and an affine surjection Sinceφ is surjective, the matrix M has rank n − 1, so there exist n − 1 linearly independent columns in M . Let P be an n × n permutation matrix such that P −1 permutes those linearly independent columns to the left side, i.e, we have and finally This proposition allows to reduce the number of restrictions we need to consider for a given function F : F n 2 → F n 2 to 2 · (2 n − 1) 2 , i.e., we only need to consider all the trims T H β F of F , where (H, β) takes all possible values. In the following, we establish the fact that for EA-equivalent functions F, G : F n 2 → F n 2 , the multiset of all possible trims of F is the same as the multiset of all possible trims of G.
Proof. Let us fix a non-zero element β ∈ F n 2 and an The proof is divided in three parts.
First, let us consider the case of H = α ⊥ . For any x ∈ α ⊥ , we then have Let us now consider the case of H = α ⊥ . Then, H = α ⊥ + for / ∈ α ⊥ . For any x ∈ α ⊥ , we then have For any x ∈ α ⊥ , we then have • Finally, let G = F + C with C being an affine function in F n 2 . For any x ∈ α ⊥ , we then have Proposition 3 motivates us to define the notion of the trim spectrum of a function F : F n 2 → F n 2 , which is an EA-invariant. In the following, let H n denote the set of all n−1-dimensional hyperplanes of F n 2 , i.e., H n : We recall that for an n − 1-dimensional hyperplane H ⊆ F n 2 and a non-zero element β ∈ F n 2 , the trim T H β F refers to an EA-equivalence class, and not to a particular vectorial Boolean function. Corollary 1. The trim spectrum of a vectorial Boolean function is an EA-invariant. In other words, for n ∈ N, n ≥ 2, if F, G : consist of the same EA-equivalence classes with the same multiplicities.
Proof. This follows directly from Proposition 3 and from the fact that the two functions Remark 2. We note that for a quadratic function F : F n 2 → F n 2 , the trim spectrum can be simplified by only considering the linear hyperplanes H. In fact, for α, where A is the affine mapping such that, for all

APN-Trims of APN Functions in Small Dimension
We could ask the following question: Among the APN functions that were known before our work, how many have APN functions as a restriction in one dimension lower?
To answer this question for the quadratic APN functions in small dimension, we proceeded as follows. For each quadratic APN function F in dimension 3 ≤ n ≤ 7 up to EA-equivalence, we checked whether the trim spectrum of F contains an APN function. To illustrate this data, we plotted it in a trimming graph defined as follows. Each EA-equivalence class of a quadratic APN function corresponds to a node, and each node is at a height corresponding to the value of n (n = 3 at the lowest level, and then it is incremented going up each level). Then, there is a vertex from a node F at height n down to a node G at height n − 1 if the function G is in the trim spectrum of F . Functions that are neither the start nor the end of an edge are not represented. The result can be seen in the graph given in Figure 1. This graph is complete in the sense that all EA-equivalence classes of quadratic APN functions in dimension up to n = 7 are known and we have taken into account all the relevant functions. More precisely, for n ≤ 4, there is only the EA-equivalence class corresponding to the function x → x 3 over F 2 n , for n = 5, there are the two EA-equivalence classes corresponding to the functions x → x 3 and x → x 5 , for n = 6, there are the 13 quadratic EA-equivalence classes listed in [17, Table 5], and for n = 7, there are 488 EA-equivalence classes of quadratic APN functions [20].
As we can see, the trimming graph given in Figure 1 has a complex structure where the following properties stand out.
• Two EA-equivalence classes of quadratic 6-bit APN functions are in the trim spectra of some 7-bit ones, but do not have any APN functions in their own trim spectra. Those functions correspond to Function no. 1.2 and Function no. 2.1 in [17, Table 5] and can be given in univariate representation as x → x 3 + g 11 x 6 + gx 9 and x → x 3 + gx 24 + x 10 , respectively, where g ∈ F 2 6 is an element with minimal polynomial X 6 + X 4 + X 3 + X + 1. • Conversely, there is a 6-bit quadratic APN function that is not in the trim spectrum of any 7-bit one, but it has 5-bit APN functions in its trim spectrum. This is Function no. 2.6 in [17, Table 5] (see also the representation we provide in Section 5.3). Note that this observation was already reported in [20,Sec. 3].
• Most of the EA-equivalence classes of quadratic 6-bit APN functions are in the trim spectra of multiple 7-bit ones, and most of the quadratic 7-bit APN functions that have APN functions in their trim spectra have multiple different EA-equivalence classes of APN functions in their trim spectra.
• Several of the quadratic 7-bit APN functions have a unique EA-equivalence class of 6-bit APN functions in their trim spectrum.
• For n = 6, one out of the 13 EA-inequivalent quadratic APN functions does not appear in the graph because it has no APN functions in its trim spectrum, and does not belong to the trim spectrum of any quadratic 7-bit APN function. That function is x → x 3 . For n = 7, 50 functions out of the 488 EA-inequivalent quadratic APN functions do not appear because they do not have any APN functions in their trim spectra.
Moreover, for each of the known quadratic APN functions in dimension n = 8 up to EAequivalence (except the new ones constructed in Section 4), we also checked whether it contains an APN function within its trim spectrum. The result is given in the graph depicted in Figure 2. Unlike the previous one, this graph is not complete since quadratic APN functions in dimension eight are not classified yet, so we do not have a full list of all the quadratic 8-bit APN functions. Looking at all of the 26,524 previously known quadratic 8-bit APN functions, we observe the following: • Only 123 of those functions have an APN function within their trim spectrum.
• 15 have a unique EA-equivalence class of 7-bit APN functions in their trim spectrum that is also not in the trim spectrum of another of the 26,524 quadratic 8-bit APN functions.
• Three of the EA-equivalence classes quadratic 7-bit APN functions are in the trim spectrum of quadratic 8-bit APN functions, but do not have any APN functions in their own trim spectrum (meaning that these functions appear in Figure 2 but not in Figure 1).
To the best of our knowledge, there are 60 known quadratic APN functions in dimension 9 up to EA-equivalence. They either correspond to a polynomial with coefficients in F 2 [29], to the (generalized) isotopic shift construction [7,8], to the infinite families given in [9,10], or to one of the 35 instances presented in [2]. None of those 60 instances contains an APN trim within their trim spectrum.
We further checked for some quadratic APN instances in dimension n = 10 that come from infinite families (i.e., the instances 10.1-10.2 and 10.5-10.17 from [5]) and for the 5 sporadic instances presented in [2] whether they contain an APN trim within their trim spectrum. This is not the case for any of those functions.
On the 6-Bit APN Function Inequivalent to a Quadratic Function From [11], we know that the known 6-bit APN function CCZ-inequivalent to a quadratic function consist of 25 distinct EA-equivalence classes. For each of those EA-equivalence classes, we chose a representative and checked whether the trim spectrum contains APN functions. Indeed, this is the case for 21 out of the 25 classes. For one class, all the APN trims are quadratic, while for the 20 other classes, all the APN trims are cubic.
On the Non-Quadratic APN Monomial Functions We further checked for all of the nonquadratic APN monomial functions in dimension n with 5 ≤ n ≤ 10 whether the trim spectrum contains an APN function. This is not the case.
In [4], we provide the source code for computing the trim spectrum of a given vectorial Boolean function, as well as the source code for computing the trimming graphs as given in Figure 1 and

Recursive APN Functions
As one can observe from the trimming graph depicted in Figure 2, there are quadratic APN functions in dimension n = 8 that contain an APN function in dimension n = 7 as a restriction, which again contains an APN restriction in dimension n = 6, and so forth up to n = 2. This property is indicated by a path from the top level to the bottom level of the trimming graph (note that the trimming graph only depicts the nodes for n ≥ 3). We call such functions recursive APN functions, formally defined in the following.
In Appendix A, we give an example of a recursive APN function in dimension n = 8. Motivated by the new APN extensions we construct in Section 4 below, we raise the following conjecture. Conjecture 1. There exists a recursive APN function in every dimension n ∈ N, n ≥ 2.

New APN Extensions in Dimension Eight
In this section, up to EA-equivalence, we construct new quadratic APN functions in dimension eight as extensions of quadratic 7-bit APN functions. Note that a search for quadratic APN functions which contain a quadratic APN function G : F n 2 → F n 2 as a restriction was already conducted in [20]. In this previous work, the search was based on necessary properties of the algebraic normal form of F and it was quite similar to the QAM approach [32]. However, no results were reported for n ≥ 7.
The following proposition derives a simple form of such APN functions, which we utilize in our search.
be a quadratic function. Then, there exists a function G : F n 2 → F n 2 of algebraic degree at most 2, a Boolean function r : F n 2 → F n 2 of algebraic degree at most 2, and two linear functions L : F n 2 → F n 2 , : F n 2 → F 2 such that F is EA-equivalent to Proof. By applying an EA-transformation to F , we can obtain a function where H : F n 2 ×F 2 → F n 2 is of algebraic degree at most 2, H(0, 0) = H(0, 1) = 0 and h : F n 2 ×F 2 → F 2 is of algebraic degree at most 2 with h(0, 0) = h(0, 1) = 0. Then, by defining G(x) = H(x, 0) and Note that since (G, r) is a restriction of (H, h) to a linear hyperplane, it is also of algebraic degree at most 2. Now, T is quadratic if and only if x → (G(x)+H(x, 1), r(x)+h(x, 1)) is of algebraic degree at most 1, which means that H(x, 1) = G(x) + L(x) for an affine function L and h(x, 1) = r(x) + (x) for an affine function . Since we chose (H(0, 1), h(0, 1)) = (H(0, 0), h(0, 0)) = (0, 0), we have (L(0), (0)) = (0, 0) and both L and must therefore be linear.
Definition 6. Let G : F n 2 → F n 2 be a quadratic APN function and let r : F n 2 → F 2 be a Boolean function of algebraic degree at most 2. The function G is called r-extendable if there exist two linear functions L : F n 2 → F n 2 , : F n 2 → F 2 such that is APN. If T is APN, we say that the tuple (G, r, L, ) yields an APN function T and we say that T is an APN extension of G in standard form.
Remark 3. For any linear mappings L : F n 2 → F n 2 , : F n 2 → F 2 and any Boolean function r : F n 2 → F 2 , we remark that if two functions G, G : F n 2 → F n 2 are EA-equivalent, there exist linear mappings L : F n 2 → F n 2 , : F n 2 → F 2 and a Boolean function r : F n 2 → F 2 EA-equivalent to r such that the two functions are EA-equivalent as well. Further, note that if T is given in the same form as in Proposition 4, the EA-equivalence class of G is contained within the trim spectrum of T by choosing H = F n 2 × {0} and β = e n+1 .
Using a recursive tree search similar to the approach described in [1,2], we conducted a search for 8-bit quadratic APN functions that are an extension of a quadratic APN function in dimension seven. In particular, we applied the following search procedure: 1. Fix a representative G : F 7 2 → F 7 2 of one of the 488 EA-equivalence classes of 7-bit quadratic APN functions.
2. Guess the Boolean function r of a possible APN extension T of G in standard form, i.e., randomly choose a function r : F n 2 → F 2 of algebraic degree at most 2.
3. Recursively construct the linear function (L, ) : F n 2 × F 2 → F n 2 × F 2 such that T is APN. In case there is a contradiction with the property of T being APN, the recursive algorithm backtracks. If a suitable function (L, ) cannot be found after a predetermined number of iterations, we abort the search. Otherwise, we found an APN extension of G.
By repeatedly iterating the above algorithm, we found 6,368 new quadratic APN functions in dimension eight up to EA-equivalence. With our implementation, it takes about 2 CPU hours to find one APN extension in dimension eight. The new APN functions are available in the dataset [3] and our implementation is available at [4]. The check for EA-inequivalence to the previouslyknown APN functions was done using the method explained in [12]. In particular, we computed the extended Walsh spectra and the differential spectra of the ortho-derivatives of all the known and found quadratic 8-bit APN functions, which is a strongly discriminating EA-invariant.
As our new 8-bit APN functions are extensions of quadratic 7-bit APN functions by construction, they are all connected to some nodes at height 7 in the trimming graph. From the previously-known 8-bit APN functions (see Figure 2), one might expect that there are only a few of the quadratic 7-bit APN functions that can be extended to quadratic 8-bit APN functions. However, it turns out that the vast majority of the quadratic APN functions in dimension n = 7 can be extended to a quadratic APN function in dimension n = 8. In fact, this observation is the reason we raised Conjecture 1. Remark 4. It is possible to further restrict the definition of an "APN extension of G in standard form". Let Q n be the set of quadratic homogeneous Boolean functions mapping n bits to 1, i.e. the set of n-bit quadratic Boolean functions with no linear or constant terms. Furthermore, let G be an n-bit quadratic APN function, and let (G, r, L, ) yield an APN function T . Then we can impose for r to be in Q n , and for all coordinates G i of G to be in Q n as well: removing all affine terms is the same as adding an affine function to the output of T , which would not change its EA-equivalence class. This first restriction means that r can be searched for in a space of dimension n(n − 1)/2. We can go further. In the procedure outlined above for extending a given function G, we first guess r and then find (L, ). For a given r, setting r = r + i i G i for some ∈ F n 2 and then searching for all (L, ) would yield the same EA-equivalence classes as starting from r. Indeed, we would simply find pairs (L, ) where is replaced by = + i i L i . Thus, we can safely search for r in the complement of the span of the coordinates of G, i.e. in a space of dimension n(n − 1)/2 − n. For n = 7, this quantity is only equal to 15. Unfortunately, for a given tuple (G : F 7 2 → F 7 2 , r : F 7 2 → F 2 ), exhausting all pairs (L, ) using our implementation already takes several minutes, and exhausting all possible such pairs for each of the 488 · 2 15 choices of (G, r) is simply infeasible. Thus, while this reduction of the search space would work, it would be of no practical impact at this stage due to the cost of finding (L, ). Still, should progress be made in this direction, it might become possible to exhaustively find all quadratic 8-bit APN extensions of quadratic APN functions in dimension n = 7.
The Number of Known Instances of 8-Bit APN Functions The 6,368 APN functions constructed in this work together with the 23 APN functions listed in [17] (including one nonquadratic monomial function), the 8,157 APN functions constructed by the QAM method [31], the 10 APN functions presented in [28], the two APN functions from the Taniguchi family [27], the 12,921 APN functions from [2], and the 5,412 APN functions presented in [30], are all APN functions in dimension eight up to CCZ-equivalence known until January 2022 (32,893 in total).

Quadratic APN Functions With Maximum Linearity
The following simple observation illustrates how a quadratic function in dimension n + 1 and having linearity 2 n can be obtained as an extension of a function on n bit. A similar argument (for APN functions) was already given in [13,Remark 12].
be a quadratic function with linearity 2 n . Then, there exists a function G : F n 2 → F n 2 of algebraic degree at most 2 and two linear functions L : is a quadratic function with linearity 2 n , it consists of a component which is EA-equivalent to (x, y) → (x)y for a linear function : F n 2 → F 2 , = 0, see [14, Thm.10 and p. 173]. Therefore, by applying an EA-transformation to F , we can obtain a function where H : F n 2 ×F 2 → F n 2 is of algebraic degree at most 2, H(0, 0) = H(0, 1) = 0 and : F n 2 → F 2 , = 0 is linear. Then, by defining G(x) = H(x, 0), we obtain Note that since G is a restriction of H to a linear hyperplane, it is also of algebraic degree at most 2. Now, T is quadratic if and only if x → G(x) + H(x, 1) is of algebraic degree at most 1, which means that H(x, 1) = G(x) + L(x) for an affine function L. Since we chose H(0, 1) = H(0, 0) = 0, we have L(0) = 0 and L must therefore be linear.
Remark 5. For any linear mappings L : F n 2 → F n 2 , : F n 2 → F 2 , = 0, we remark that if two functions G, G : F n 2 → F n 2 are EA-equivalent, there exist linear mappings L : F n 2 → F n 2 , : F n 2 → F 2 , = 0 such that the two functions are EA-equivalent as well. Thus, the function G as in Proposition 5 can be chosen up to EAequivalence.
We now deduce when the functions T of the same form as given in Proposition 5 are APN.
Theorem 1. Let G : F n 2 → F n 2 be a function of algebraic degree at most 2, L : F n 2 → F n 2 be linear and : F n 2 → F 2 , = 0 be linear. Then is APN if and only if the following two assertions hold: Proof. By definition, the function T is APN if and only if, for all α, γ ∈ F n 2 , β, δ ∈ F 2 with (α, β) = (0, 0), the equation has at most two solutions (x, y) ∈ F n 2 × F 2 . By the definition of T , Equation (4) is equivalent to For every α ∈ F n 2 , we recall that B α is defined as , which is a linear mapping if G is of algebraic degree at most 2. We now consider two cases.
Case β = 1 We will show that Condition 2 of the statement is a sufficient condition for Equation (5) having at most 2 solutions (x, y) ∈ F n 2 × F 2 . For y = 1, Equation (5) simplifies to and for y = 0, Equation (5) simplifies to An element x ∈ F n 2 is a solution of Equation (7) if and only if x + α is a solution of Equation (8). Therefore, for Equation (5) having at most two solutions (x, y) ∈ F n 2 ×F 2 , we need that Equation (7) has at most 1 solution x ∈ F n 2 . In other words, we need to show that the mapping is injective. For this, let us choose an arbitrary element x ∈ F n 2 and a non-zero element w ∈ F n 2 and consider H α (x) + H α (x + w), which is equal to Since G is of algebraic degree at most 2, the mapping x → G(x)+G(x+α)+G(x+w)+G(x+w +α) is constant. Thus, The right-hand side can only be equal to 0 if L(w) ∈ Im(B w ) and (w) = 0. Therefore, if L(w) / ∈ Im(B w ) for all w ∈ F n 2 \ {0} with (w) = 0, the mapping H α must be injective.
Note that Condition 2 of Theorem 1 implies that the mapping has full rank equal to n. In particular, if T is APN, L can only be of rank n or n − 1. We further remark that, if n > 2 and T is APN, the APN function G must actually be quadratic (since affine functions in dimension n > 2 cannot be APN).
From Remark 5, it is obvious that the property of being 0-extendable is invariant under EAequivalence. Moreover, since quadratic APN functions in odd dimension must be almost bent, 0-extendable APN functions can only exist in dimension n = 2 or in odd dimension n.
Let us now define the set which is either empty or an affine subspace of L(F n 2 , F n 2 ). Given G and , the set Γ G, can be recovered by first computing the ortho-derivative of G and by then solving a system of 2 n−1 linear equations with n 2 unknowns. The following proposition yields a lower bound on |Γ G, | in cases where Γ G, = ∅. Proposition 6. Let n ∈ N, n ≥ 3. Let G : F n 2 → F n 2 be a quadratic mapping, L : F n 2 → F n 2 be linear and : F n 2 → F 2 , = 0 be linear such that (G, 0, L, ) yields an APN function T . For all µ, ν ∈ F n 2 , the tuple (G, 0, L + B µ + ν, ) yields an APN function EA-equivalent to T , where . The functions L + B µ + ν are pairwise distinct for µ, ν ∈ F n 2 . Moreover, for every µ ∈ F n 2 , we have Proof. For an element c ∈ F n 2 , let us consider the linear involution For µ ∈ F n 2 , let us consider the function By definition, T µ is EA-equivalent to T . Using the representation of T given in Equation (3), we obtain T µ x y = G(x + µy) 0 (y + 1) + G(x + µy) + L(x + µy) (x + µy) y which is of the same form as in Theorem 1. Thus, (G, 0, L + B µ , ) yields the APN function T µ . For an element ν ∈ F n 2 , we obtain The function M ν T is also EA-equivalent to T and of the same form as in Theorem 1. Thus, (G, 0, L + ν, ) yields the APN function M ν T . Combining the above, we obtain that (G, 0, L + B µ + ν , ) yields the APN function M ν T µ , which is EA-equivalent to T . To see that the functions L + B µ + ν are pairwise distinct for all µ, ν ∈ F n 2 , we need to show that the linear mapping is injective. We show that the kernel of J is trivial. Suppose that, for all x ∈ F n 2 , we have B µ (x) + (x)ν = 0. This implies B µ (x) = ν for all x ∈ F n 2 with (x) = 1. Since is not the zero mapping and since B µ is 2-to-1 for every non-zero µ, we have µ = 0. From µ = 0, we immediately deduce ν = 0, so the kernel of J is trivial.
To prove the last statement, let us fix an element µ ∈ F n 2 . We consider L := L + B µ . Suppose that Rank(L ) = n. We can choose an element ν ∈ F n 2 such that ν / ∈ Im(L ). For such ν, we have that Rank(L + ν) = n. This can be observed by looking at the kernel of L + ν. For all x ∈ F n 2 with (x) = 0, we have L (x) + (x)ν = L (x) = 0 if and only if x = 0, since Rank((L , )) = n. For all x ∈ F n 2 with (x) = 1, we have L (x) + (x)ν = 0 if and only if L (x) = ν, which is not possible since ν / ∈ Im(L ). Therefore, there exists an element ν ∈ F n 2 such that L := L + J(µ, ν) is invertible. By using a similar argument as above we obtain that, for all ν ∈ F n 2 , the mapping L + ν is invertible if and only if (L −1 (ν )) = 0. The statement follows since there are exactly 2 n−1 elements ν ∈ F n 2 with (L −1 (ν )) = 0.

A Classification in Dimension Eight
Recently, Kalgin and Idrisova completely classified all quadratic 7-bit APN functions [20]. In total, there are 488 such functions up to EA-equivalence. By using this classification and by applying the results from Theorem 1 and Proposition 6, we can now classify all 8-bit quadratic APN functions with linearity 2 7 .
Let G = {G 1 , G 2 , . . . , G 488 } be a set of 7-bit quadratic APN functions that contains one representative of each EA-equivalence class. Algorithm 1 describes how G can be used to obtain a classification of 8-bit quadratic APN functions with maximum linearity up to EA-equivalence.
A sage [26] implementation of Algorithm 1 is given in Appendix B. For each quadratic 7-bit APN function G, the running time of the ZeroExtensions procedure is less than one second on a PC. To execute this code, the library sboxU [25] is needed. Compute Γ G,x → γ,x by solving a linear system 5: for L ∈ Γ G,x → γ,x up to Γ-equivalence do 6: sol ← sol ∪ T , where T is such that (G, 0, L, x → γ, x ) yields T There are exactly four functions G in G for which there exists a γ ∈ F 7 2 such that that Γ G,x → γ,x is not empty. Moreover, for each of those four functions, there is exactly one such γ. The space Γ G,x → γ,x is of size 2 14 in all those cases, implying that there is only one element in Γ G,x → γ,x up to Γ-equivalence. Thus, Algorithm 1 outputs four 8-bit quadratic APN functions with linearity 2 7 . Those are pairwise inequivalent up to EA-equivalence. More precisely, they correspond to the four EA-equivalence classes reported in [2]. While in [2], the authors have shown that there are at least four pairwise EA-inequivalent quadratic APN functions in dimension eight with maximum linearity, by using Algorithm 1 we now deduced that there are exactly four such EA-equivalence classes.
Theorem 2. In dimension eight, there are exactly four quadratic APN functions with linearity 2 7 up to EA-equivalence.
We give representatives of those four EA-equivalence classes in Section 5.2 using a simpler representation.
Searching for 0-Extensions of 9-Bit and 11-Bit Quadratic APN Functions For all of the 60 known instances of 9-bit quadratic APN functions, we checked whether there exists a γ ∈ F 9 2 such that Γ G,x → γ,x is non-empty. This is never the case. Thus, up to now, we do not know a quadratic 9-bit APN function that can be extended to a quadratic 10-bit APN function with linearity 2 9 .
We also checked whether any of the known quadratic 11-bit APN functions coming from a known infinite family of APN functions (see the list in [5]) is 0-extendable. In particular, we checked the quadratic monomial functions and the function F 2 11 → F 2 11 , x → x 3 + Tr x 9 discovered in [9]. Also, none of those functions is 0-extendable.

A Simpler Representation
As a summary of previous results, we can assume without loss of generality that quadratic APN functions with maximum linearity are of the following form.
Theorem 3. Let n ∈ N, n ≥ 3 and let γ ∈ F n 2 \ {0} be an arbitrary non-zero element. Let T : F n 2 × F 2 → F n 2 × F 2 be a quadratic APN function with linearity 2 n . Then, there exist a quadratic APN function G : F n 2 → F n 2 such that π G (α), α = 1 for all α ∈ F n 2 \ {0} with γ, α = 0. More precisely, T is EA-equivalent to Proof. By Theorem 1, we know that there exist a quadratic APN function Q : F n 2 → F n 2 , a linear mapping L : F n 2 → F n 2 , and an element δ ∈ F n 2 \ {0} such that (Q, 0, L, x → δ, x ) yields T . By Proposition 6, we can assume without loss of generality that L is invertible (then (Q, 0, L, x → δ, x ) does not necessarily yield T , but an APN function T EA-equivalent to T ). We then have Let us choose an invertible linear mapping L : F n 2 → F n 2 with L (δ) = γ. It is straightforward to deduce that T is EA-equivalent to The result follows by defining G := (LL ) −1 • Q • L .
The Walsh Transform of Quadratic APN Functions with Maximum Linearity To deduce the Walsh spectrum of a quadratic APN function with maximum linearity, we need the following well-known result on the sum of fourth powers of the Walsh coefficients of APN functions.
Then the following two statements are equivalent: 1. F is APN.

The Case of Gold Functions
It is worth highlighting that an EA-equivalent representation of the 6-bit quadratic APN function with linearity 2 5 , i.e., Function no. 2.6 in [17, Table 5], can be given as i.e., it can be obtained as a 0-extension of the cube function over F 2 5 . Note that it was already observed in [20,Sec. 3] that both of the two quadratic EA-equivalence classes of 5-bit APN functions yield the EA-equivalence class of the 6-bit quadratic APN function with maximum linearity as a 0-extension. The following proposition gives us a necessary and sufficient condition on when a Gold APN function in odd dimension can be extended to a quadratic APN function with maximum linearity.
Proposition 7. Let n ∈ N be an odd integer and let i ∈ N be an integer with gcd(i, n) = 1.
The APN function G : F 2 n → F 2 n , x → x 2 i +1 is 0-extendable if and only if there exists a linear function (bijection) L : F 2 n → F 2 n such that, for all x ∈ F 2 n \ {0} with Tr (x) = 0, we have Proof. In the finite field F 2 n , we use α, x F 2 n = Tr (αx). Then, for the ortho-derivative of G, we have Therefore, G is 0-extendable if and only if there exists a linear function L : F 2 n → F 2 n and a non-zero β ∈ F 2 n such that, for all x ∈ F 2 n \ {0} with Tr (βx) = 0, we have Tr x −(2 i +1) L (x) = 1.
If we substitute x by β −1 x, we obtain that, for all x ∈ F 2 n \ {0} with Tr (x) = 0, we have Without loss of generality, we can assume L being a bijection because of Proposition 6.
We did not find any example of a 0-extendable Gold function in odd dimension n with 7 ≤ n ≤ 15.

Open Problems
Our work leaves several open problems, which we list in the following. We expect that a solution to any of those problems will provide further interesting insights within the theory of APN functions.
Open Problem 1. Study how restrictions of a function F : F n 2 → F n 2 are related to restrictions of a function F CCZ-equivalent to F . Moreover, if we have two quadratic APN functions F and G such that G ≺ F , determine whether it is possible to construct an APN function G which is not CCZ-equivalent to a quadratic function such that G ≺ F , where F is CCZ-equivalent to F . Open Problem 2. Find a recursive APN function in every dimension n ≥ 2 (i.e., prove Conjecture 1).
Open Problem 3. Find an algorithmic way for finding valid pairs (L, ) when building r-extendable APN functions that is more efficient than the method described in Section 4.
Open Problem 4. Construct an infinite family of quadratic APN functions with maximum linearity (or equivalently an infinite family of 0-extendable APN functions) or prove that such a family cannot exist.
Open Problem 5. Determine whether there exists a 0-extendable APN function in odd dimension n > 5 that comes from one of the known infinite families of APN functions.
The following sage code returns R and APN restrictions contained in R for n = 7, . . . , 2.