Next Article in Journal
On Nonuniqueness of Quantum Channel for Fixed Input-Output States: Case of Decoherence Channel
Next Article in Special Issue
Rotational Cryptanalysis on ChaCha Stream Cipher
Previous Article in Journal
Symmetry of Post-Translational Modifications in a Human Enzyme
Previous Article in Special Issue
Perfect Reconciliation in Quantum Key Distribution with Order-Two Frames
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Nonlinearity of Boolean Functions: An Algorithmic Approach Based on Multivariate Polynomials

by
Emanuele Bellini
1,*,
Massimiliano Sala
2 and
Ilaria Simonetti
3
1
Cryptography Research Centre, Technology Innovation Institute, Abu Dhabi P.O. Box 9639, United Arab Emirates
2
Department of Mathematics, University of Trento, 38123 Trento, Italy
3
Department of Mathematics, University of Milan, 20133 Milan, Italy
*
Author to whom correspondence should be addressed.
Submission received: 8 November 2021 / Revised: 10 December 2021 / Accepted: 14 December 2021 / Published: 22 January 2022
(This article belongs to the Special Issue The Advances in Algebraic Coding Theory)

Abstract

:
We review and compare three algebraic methods to compute the nonlinearity of Boolean functions. Two of them are based on Gröbner basis techniques: the first one is defined over the binary field, while the second one over the rationals. The third method improves the second one by avoiding the Gröbner basis computation. We also estimate the complexity of the algorithms, and, in particular, we show that the third method reaches an asymptotic worst-case complexity of O ( n 2 n ) operations over the integers, that is, sums and doublings. This way, with a different approach, the same asymptotic complexity of established algorithms, such as those based on the fast Walsh transform, is reached.
MSC:
Primary: 06E30; 11T71; Secondary: 11T06; 13P25

1. Introduction

Any function that maps binary strings of fixed length to the set { 0 , 1 } is called a Boolean function (B.f.). Besides being mathematically interesting combinatorial objects, Boolean functions have turned to be a fundamental tool for their relations to coding theory (to the covering radii of Reed–Muller codes), combinatorics (difference set) and cryptography, in particular for the design of symmetric and, recently, also homomorphic ciphers. Due to this, researchers have uninterruptedly studied these objects for more than four decades.
Modern symmetric ciphers are designed to achieve the principles of confusion and diffusion [1]. Diffusion aims at distributing uniformly the dependence of the output bits from all the input bits. This property is usually optimally achieved by means of linear operations. On the other hand, confusions aims at complicating the relationship between the output bits, the input bits and the key. This is usually achieved by exploiting relations that are not linear. In symmetric cryptography, Boolean functions are often used in the confusion layer of ciphers. An affine B.f. does not provide an effective confusion. To overcome this, functions that are as far as possible from being an affine function are needed. The effectiveness of these functions is measured by several parameters, one of these is called “nonlinearity”. In particular, it is hard to approximate a B.f. with high nonlinearity by an affine (or linear) function, which is a fundamental property in the defense against linear cryptanalysis. Furthermore, B.f.s with highest nonlinearity (so called “bent” functions [2]), have two fundamental properties: they achieve optimal diffusion (similarly to linear functions) and their derivative takes on each value exactly half the time, i.e., they are balanced, which makes them ideal to be resistant against differential cryptanalysis. Unfortunately, bent functions are not balanced. When used to build stream ciphers, for example, they make them susceptible to correlation attacks. In these case, bent functions need to be replaced with a B.f. that is both balanced and highly non-linear. Due to the extremely high number of B.f. and the scarcity of B.f.s with cryptographically interesting properties, one can either build B.f.s with predetermined nonlinearity (often this approach implies the lost of some desirable properties such as good diffusion, see, e.g., [3], or high algebraic degree, for example symmetric functions with highest nonlinearity are quadratic [4,5]), or to run a brute-force search among the available B.f.s. In this last case, it becomes crucial to be able to compute the nonlinearity of a B.f. efficiently. We refer to [6,7,8] for other applications of B.f.s in cryptography.

1.1. Related Works

Techniques to compute the nonlinearity of Boolean functions have been known for many years, since the seminal work of Rothaus in 1976 [2], where he introduced “bent” functions (even though his first paper in English on bent functions was written in 1966 [9]), Boolean functions achieving maximal nonlinearity. These functions were also studied by Dillon in 1974 [10], and it is claimed that they were already known also by Eliseev and Stepchenko in the Soviet Union in the early 1960s, but their technical reports have never been declassified [11]. A good overview and surveys on B.f. can be found, for example, in [12], or, specifically for bent functions, in  [9,11,13].
All methods to compute the nonlinearity of a generic B.f. f rely on butterfly algorithms such as the Fast Fourier transform, or  the fast Möbius transform, which are exponential in the number of variables of f. These methods allow to compute the so called Walsh spectrum, from which the nonlinearity can be directly quantified (see Section 2). With these methods, usually one can compute the nonlinearity up to about 40 variables, on a relatively powerful personal laptop. When f has a particular structure, there might be faster methods to compute the nonlinearity. For example, in 2013, Çalik [14,15] showed that, when f is sparse, the task of nonlinearity computation can be reduced to solving an associated binary integer programming problem. The algorithm is used to compute the nonlinearity of some sparse functions (up to 100 monomials) with 60 variables. Other kinds of properties of a B.f. are reflected in the structure of the Walsh spectrum, which becomes easier to determine. This is the case, for example, of quadratic functions, Maiorana–McFarland’s functions [16], or normal functions [17,18] (see [19] for more details).
When computing the nonlinearity is not feasible, it becomes interesting to provide lower bounds for this value. In 2008, Carlet [20], improving previous results from [21,22,23], introduces a recursive method for lower bounding the nonlinearity profile of a B.f. and deduces bounds on the second order nonlinearity for several classes of cryptographic Boolean functions, including the Welch and the multiplicative inverse functions (used in the S-boxes of the AES block cipher). Some more recent results [24] improve the lower bounds on the second-order nonlinearity of three classes of Boolean functions whose form is related to the absolute trace map.
Recently, in the context of defining a homomorphic encryption cipher, Carlet, Méaux, and Rotella [19] have studied the main cryptographic features, including nonlinearity, of Boolean functions when the input to these functions is restricted to some subset. The nonlinearity with restricted input is the focus of [25].
Cryptographic attack have also pushed to generalization of the concept of nonlinearity, as recently done for example by Semaev in [26], where “multidimensional” nonlinearity parameters for conventional and vectorial Boolean functions are introduced.
Techniques that are similar to those presented in this work, have also been applied in [27,28] to compute the minimum distance and the weight distribution of, respectively, systematic nonlinear codes, and  generic binary nonlinear codes.

1.2. Our Contribution

In this paper, we review three methods to compute the nonlinearity, which are based on the theory of multivariate polynomials instead of the standard approach in terms of the Walsh transform. These three methods are unpublished and have been partially presented only in conference (the method from Section 4.1 in WCC 2007 [29], the one from Section 4.2 in MEGA 2015 [30], and  the one from Section 4.3 in YACC 2014 [31]). All three methods compute the nonlinearity of Boolean functions by starting from their truth table (i.e., evaluation vector) representation (see Section 2). Moreover, we give an estimate of the complexity of our methods, comparing it with the complexity of the classical method which uses the fast Walsh transform and the fast Möbius transform.
The first method, described in Section 4.1, computes the nonlinearity of a B.f. f from the evaluation vector (truth table) of f. We construct a polynomial system of equations over the binary field with two elements, representing the set of all affine functions with a given distance t from f. Then, using Gröbner basis algorithms, we solve the system for t = 1 , and, if there is no solution, we increase t and try with the newly derived system. We repeat the procedure until a solution is found. At this point, the value of t returns the nonlinearity of the B.f. f. As already mentioned, this method, not only returns the nonlinearity of f, but  also all affine functions with distance t from f (and thus also all the best affine approximations of f, i.e., those affine functions g for which the distance between f and g is minimal), compactly represented as a polynomial system of equations over the binary field. Traditional methods to compute the nonlinearity only return the set of distances of all affine functions from f in the form of the so called Walsh table. Although all such affine functions could be deduced from the Walsh table, this does not provide a compact algebraic representation for them. This is the main reason why this method is considerably less efficient than those based on the fast Fourier transform.
At the cost of losing the information of all affine functions, we improve the efficiency of the previous method. Again, starting from the evaluation vector of f, we construct a polynomial, that we call the nonlinearity polynomial, whose evaluation contains all the distances of f from all possible affine functions, and  the minimum such distance will be the nonlinearity. This evaluation can be found again using Gröbner basis algorithms over the rational or a prime field (see Section 4.2) or by using a more traditional butterfly algorithm (see Section 4.3). This last option let us compute the nonlinearity of f with the same asymptotical complexity O ( n 2 n ) of the traditional technique using the Fast Walsh transform. Notice that, though we are not aware of any proof, the asymptotic complexity of O ( n 2 n ) seems to be already optimal. This claim is enforced by the fact that the input of the problem has a dimension of 2 n .

1.3. Outline of the Paper

In Section 2 and Section 3 we recall the basic notions and statements, especially regarding Boolean functions, which are necessary for our methods. In Section 4, we present our original algorithms, and  we introduce the notion of nonlinearity polynomial and describe its properties. Finally, in Section 5 we analyze the complexity of the proposed methods, both experimentally and theoretically.

2. Preliminaries and Notation on Boolean Functions

In this chapter we summarize some definitions and known results from [12,32], concerning Boolean functions and the classical techniques to determine their nonlinearity.
We denote by F the binary field F 2 . The set F n is the set of all binary vectors of length n, viewed as an F -vector space. Let v F n . The Hamming weight w ( v ) of the vector v is the number of its nonzero coordinates. For any two vectors v 1 , v 2 F n , the Hamming distance between v 1 and v 2 , denoted by d ( v 1 , v 2 ) , is the number of coordinates in which the two vectors differ. A Boolean function is a function f : F n F . The set of all Boolean functions from F n to F will be denoted by B n .

2.1. Representations of Boolean Functions

We assume implicitly to have ordered F n , so that F n = { p 1 , , p 2 n } . A Boolean function f can be specified by a truth table, which gives the evaluation of f at all p i ’s.
Definition 1.
We consider the evaluation map B n F 2 n such that
f f ̲ = ( f ( p 1 ) , , f ( p 2 n ) ) .
The vector f ̲ is called the evaluation vector of f.
Once the order on F n is chosen, i.e., the p i ’s are fixed, it is clear that the evaluation vector of f uniquely identifies f.
A B.f. f B n can be expressed in a unique way as a square free polynomial in F [ X ] = F [ x 1 , , x n ] , i.e., f = v F n b v X v , where X v = x v 1 x v n . This representation is called the Algebraic Normal Form (ANF).
Definition 2.
The degree of the ANF of a B.f. f is called the algebraic degree of f, denoted by deg f , and it is equal to max { w ( v ) v s . F n , b v 0 } .
Let A n be the set of all affine functions from F n to F , i.e., the set of all Boolean functions in B n with algebraic degree 0 or 1. If  α A n then its ANF can be written as α ( X ) = a 0 + i = 1 n a i x i . There exists a simple divide-and-conquer butterfly algorithm [12] (p. 10) to compute the ANF from the truth-table (or vice versa) of a Boolean function, which requires O ( n 2 n ) bit sums, while O ( 2 n ) bits must be stored. This algorithm is known as the fast Möbius transform.
In [33], a useful representation of Boolean functions for characterizing several cryptographic criteria (see also [34,35]) is introduced.
Boolean functions can be represented as elements of K [ X ] / X 2 X , where X 2 X is the ideal generated by the polynomials x 1 2 x 1 , , x n 2 x n , and  K is Q , R , or  C .
Definition 3.
Let f be a function on F n taking values in a field K . We call the numerical normal form (NNF) of f the following expression of f as a polynomial:
f ( x 1 , , x n ) = u F n λ u ( i = 1 n x i u i ) = u F n λ u X u ,
with λ u K and u = ( u 1 , , u n ) .
It can be proved that any B.f. f admits a unique numerical normal form. As for the ANF, it is possible to compute the NNF of a B.f. from its truth table by mean of an algorithm similar to a fast Fourier transform, thus requiring O ( n 2 n ) additions over K and storing O ( 2 n ) elements of K .
From now on let K = Q . The truth table of f can be recovered from its NNF by the formula f ( u ) = a u λ a , u F n , where a u i { 1 , , n } a i u i . Conversely, it is possible to derive an explicit formula for the coefficients of the NNF by means of the truth table of f.
Proposition 1.
Let f be any integer-valued function on F n . For every u F n , the coefficient λ u of the monomial X u in the NNF of f is:
λ u = ( 1 ) w ( u ) a F n | a u ( 1 ) w ( a ) f ( a ) .

2.2. Nonlinearity and Walsh Transform of a Boolean Function

Definition 4.
Let f , g B n . Then d ( f , g ) = | { v : f ( v ) g ( v ) } | .
Lemma 1.
Let f , g B n . Then d ( f , g ) = d ( f ̲ , g ̲ ) = w ( f ̲ + g ̲ ) .
Definition 5.
Let f B n . The nonlinearity of f is the minimum of the distances between f and any affine function N ( f ) = min α A n d ( f , α ) .
The maximum nonlinearity for a B.f. f is bounded by:
max { N ( f ) f B n } 2 n 1 2 n 2 1 .
Definition 6.
The Walsh transform of a B.f. f B n is the function F ^ : F n Z , such that x y F n ( 1 ) x · y + f ( y ) , where x · y is the scalar product.
Fact. 
N ( f ) = min v F n { 2 n 1 1 2 | F ^ ( v ) | } = 2 n 1 1 2 max v F n { | F ^ ( v ) | }
Definition 7.
The set of integers { F ^ ( v ) v F n } is called the Walsh spectrum of the B.f. f.
It is possible to compute the Walsh spectrum of f from its evaluation vector in O ( n 2 n ) integer operations, while storing O ( 2 n ) integers, by means of the fast Walsh transform (the Walsh transform is the Fourier transform of the sign function of f). Thus, the computation of the nonlinearity of a B.f. f, when this is given either in its ANF or in its evaluation vector, requires O ( n 2 n ) integer operations and a memory of O ( 2 n ) .

3. Preliminary Results

Here we present the main results from [29,36]. The same techniques are also applied in [27,37].

Polynomials and Vector Weights

Let K be a field and X = { x 1 , , x s } be a set of variables. We denote by K [ X ] the multivariate polynomial ring in the variables X. If  f 1 , , f N K [ X ] , we denote by { f 1 , , f N } the ideal in K [ X ] generated by f 1 , , f N . Let q be the power of a prime. We denote by E q [ X ] = { x 1 q x 1 , , x s q x s } , the set of field equations in F q [ X ] = F q [ x 1 , , x s ] , where s 1 is an integer, understood from now on. We write E [ X ] when q = 2 .
Definition 8.
Let 1 t s and m F q [ X ] . We say that m is a square free monomial of degree t (or a simple t-monomial) if:
m = x h 1 x h t , where h 1 , , h t { 1 , , s } and h h j , j ,
i.e., a monomial in F q [ X ] such that deg x h i ( m ) = 1 for any 1 i t . We denote by M s , t the set of all square free monomials of degree t in F q [ X ] .
Let t N , with  1 t s and let I s , t F q [ X ] be the following ideal
I s , t = { σ t , , σ s } E q [ X ] ,
where σ i are the elementary symmetric functions: σ 1 = x 1 + x 2 + + x s , σ 2 = x 1 x 2 + x 1 x 3 + + x 1 x s + x 2 x 3 + + x s 1 x s , , σ s = x 1 x 2 x s 1 x s .
We also denote by I s , s + 1 the ideal E q [ X ] . For any 1 i s , let P i be the set which contains all vectors in ( F q ) n of weight i, P i = { v F q n w ( v ) = i } , and let Q i be the set which contains all vectors of weight up to i, Q i = 0 j i P j .
Theorem 1.
Let t be an integer such that 1 t s . Then the vanishing ideal I ( Q t ) of Q t is I ( Q t ) = I s , t + 1 , and its reduced Gröbner basis G is
G = E q [ X ] M s , t , f o r   t 2 , G = { x 1 , , x s } , f o r   t = 1 .
Let F q [ Z ] be a polynomial ring over F q . Let m M s , t , m = z h 1 z h t . For any polynomial vector W in the module ( F q [ Z ] ) n , W = ( W 1 , , W n ) , we denote by m ( W ) the following polynomial in F q [ Z ] :
m ( W ) = W h 1 · · W h t .
Example 1.
Let n = s = 3 , q = 2 , W = ( x 1 x 2 + x 3 , x 2 , x 2 x 3 ) ( F [ x 1 , x 2 , x 3 ] ) 3 and m = z 1 z 3 . Then m ( W ) = ( x 1 x 2 + x 3 ) ( x 2 x 3 ) .

4. Computing the Nonlinearity of a Boolean Function

In this section, we present three methods to compute the nonlinearity of a B.f. f. The first exploits Gröbner basis algorithms over the binary field, and  is somehow inefficient, but beside the nonlinearity, also returns all affine functions of a given distance from f. The second methods is more efficient and uses Gröbner basis algorithms over the rational or a prime field. Finally, the third method, the most efficient, is based on a butterfly structure similar to a fast Fourier transform.

4.1. Gröebner Bases over the Biniary Field

In this section, we show how to use Theorem 1 to compute the nonlinearity of a given B.f. f B n . We want to define an ideal such that a point in its variety corresponds to an affine function with distance at most t 1 from f.
Let A be the variable set A = { a i } 0 i n . We denote by g n F [ A , X ] the following polynomial:
g n = a 0 + i = 1 n a i x i .
According to Lemma 1, determining the nonlinearity of f B n is the same as finding the minimum weight of the vectors in the set { f ̲ + g ̲ g A n } F 2 n . We can consider the evaluation vector of the polynomial g n as follows:
g n ̲ = ( g n ( A , p 1 ) , , g n ( A , p 2 n ) ) ( F [ A ] ) 2 n .
Example 2.
Let g 3 be a general affine function in A 3 . Then g 3 = a 1 x 1 + a 2 x 2 + a 3 x 3 + a 0 . We consider vectors in F 3 ordered as follows (note that, in all the examples, we first list the vectors from smaller to higher Hamming weight. Among vectors of the same weight, we list first those having a smaller integer representation, with least significant bit on the right):
p 1 = ( 0 , 0 , 0 ) , p 2 = ( 0 , 0 , 1 ) , p 3 = ( 0 , 1 , 0 ) , p 4 = ( 1 , 0 , 0 ) , p 5 = ( 0 , 1 , 1 ) , p 6 = ( 1 , 0 , 1 ) , p 7 = ( 1 , 1 , 0 ) , p 8 = ( 1 , 1 , 1 ) .
Thus, we have that the evaluation vector of g 3 is g 3 ̲ = ( a 0 , a 0 + a 1 , a 0 + a 2 , a 0 + a 3 , a 0 + a 1 + a 2 , a 0 + a 1 + a 3 , a 0 + a 2 + a 3 , a 0 + a 1 + a 2 + a 3 ) .
Definition 9.
We denote by J t n ( f ) the ideal in F [ A ] :
J t n ( f ) = { m g n ( A , p 1 ) + f ( p 1 ) , , g n ( A , p 2 n ) + f ( p 2 n ) m M 2 n , t } E [ A ] = { m ( g n ̲ + f ̲ ) m M 2 n , t } E [ A ] .
Remark 1.
As E [ A ] J t n ( f ) , J t n ( f ) is zero-dimensional and radical ([38]).
Lemma 2.
For 1 t 2 n the following statements are equivalent:
1.
V ( J t n ( f ) ) ,
2.
u { f ̲ + g ̲ g A n } s u c h   t h a t   w ( u ) t 1 ,
3.
α A n s u c h   t h a t   d ( f , α ) t 1 .
Proof. 
(2)⇔(3). Obvious.
(1)⇒(2). Let A ¯ = ( a ¯ 0 , a ¯ 1 , , a ¯ n ) V ( J t n ( f ) ) F n + 1 and u = ( g n ( A ¯ , v 1 ) + f ( v 1 ) , , g n ( A ¯ , v 2 n ) + f ( v 2 n ) ) F 2 n . We have that m ( u ) = 0 for all m M 2 n , t . Thus, u V ( I 2 n , t ) and, thanks to Theorem 1, u Q t 1 , i.e.,  w ( u ) t 1 .
(2)⇒(1). It can be proved by reversing the above argument. □
From Lemma 2 we immediately have the following theorem.
Theorem 2.
Let f B n . The nonlinearity N ( f ) is the minimum t such that V ( J t + 1 n ( f ) ) .
From this theorem we can derive an algorithm to compute the nonlinearity for a function f B n , by computing any Gröbner basis of J t n ( f ) .
Remark 2.
If f is not affine, we can start our check from J 2 n ( f ) .
Example 3.
Let f : F 3 F be the Boolean function: f ( x 1 , x 2 , x 3 ) = x 1 x 2 + x 1 x 3 + x 2 + 1 . We want to compute N ( f ) and clearly f is not affine. We compute vector f ̲ and we take a general affine function g 3 (as in Example 2), so that f ̲ = ( 1 , 1 , 0 , 1 , 1 , 0 , 0 , 0 ) , g 3 ̲ = ( a 0 , a 0 + a 1 , a 0 + a 2 , a 0 + a 3 , a 0 + a 1 + a 2 , a 0 + a 1 + a 3 , a 0 + a 2 + a 3 , a 0 + a 1 + a 2 + a 3 ) . Thus, f ̲ + g 3 ̲ = ( a 0 + 1 , a 0 + a 1 + 1 , a 0 + a 2 , a 0 + a 3 + 1 , a 0 + a 1 + a 2 + 1 , a 0 + a 1 + a 3 , a 0 + a 2 + a 3 , a 0 + a 1 + a 2 + a 3 ) = ( p 1 , p 2 , , p 8 ) . The ideal J 2 3 ( f ) is the ideal generated by J 2 3 ( f ) = { p 1 p 2 , p 1 p 3 , , p 7 p 8 } { a 0 2 + a 0 , a 1 2 + a 1 , a 2 2 + a 2 , a 3 2 + a 3 } . We compute any Gröbner basis of this ideal and we obtain that it is trivial, so V ( J 2 3 ( f ) ) = and N ( f ) > 1 . Now we have to compute a Gröbner basis for J 3 3 ( f ) . We obtain, using degrevlex (graded reverse lexicographic order, also known as grevlex, or degrevlex for degree reverse lexicographic order, compares the total degree first, then uses a reverse lexicographic order as tie-breaker, but it reverses the outcome of the lexicographic comparison so that lexicographically larger monomials of the same degree are considered to be degrevlex smaller). Ordering with a 1 > a 2 > a 3 > a 0 , that G ( J 3 3 ( f ) ) = { a 2 + a 3 + 1 , a 3 2 + a 3 , a 1 a 3 + a 0 + 1 , a 0 a 3 + a 0 + a 3 + 1 , a 1 2 + a 1 , a 0 a 1 + a 0 + a 1 + 1 , a 0 2 + a 0 } . Thus, N ( f ) = 2 by Theorem 2. By inspecting G ( J 3 3 ( f ) ) , we also obtain all affine functions having distance 2 from f: α 1 = 1 + x 1 + x 2 , α 2 = 1 + x 2 , α 3 = 1 + x 3 , α 4 = x 1 + x 3 .
Example 4.
Let f : F 5 F be the Boolean function f = x 1 x 3 x 4 x 5 + x 1 x 2 x 4 + x 1 x 4 x 5 + x 2 x 3 x 4 + x 2 x 4 x 5 + x 3 x 4 x 5 + x 4 x 5 . As it is obvious that f is not affine, we start from the ideal J 2 5 ( f ) . The Gröbner basis of J t 5 ( f ) is trivial with respect to any monomial order for 2 t 4 . For  t = 5 , we obtain the Gröbner basis G ( J 5 5 ( f ) ) = { a 0 , a 5 , a 4 , a 3 , a 2 , a 1 } . with respect to the degrevlex order with a 1 > a 2 > a 3 > a 4 > a 5 > a 0 : Then N ( f ) = 4 , that is, there is only one affine function α that has distance equal to 4 from f: α = 0 .

4.2. Gröebner Bases over the Rational Field

Here we present an algorithm to compute the nonlinearity of a B.f. using Gröbner bases over Q rather than over F , which turns out to be much faster than Algorithm 1. The same algorithm can be slightly modified to work over the field F p , where p is a prime. The complexity of these algorithms will be analyzed in Section 5.
Algorithm 1 NL GB F . Basic algorithm to compute the nonlinearity of a B.f. using Gröbner basis over F .
Input: a B.f. f
Output: the nonlinearity of f
  1: j 1
  2: while V ( J j n ( f ) ) = do
  3:  j j + 1
  4: end while
  5: return j 1
As we have seen in Section 4.1, the nonlinearity of a B.f. can be computed using Gröbner bases over F . It is sufficient to find the minimum j such that the variety of the ideal J t n ( f ) is not empty. Recall that
J t n ( f ) = { m ( g n ̲ + f ̲ ) m M 2 n , t } E [ A ] .
This method becomes impractical even for small values of n, since 2 n t monomials have to be evaluated. A first slight improvement could be achieved by adding to the ideal one monomial evaluation at a time and check if 1 has appeared in the Gröbner basis. Even this way, the algorithm remains very slow.
For each i = 1 , , 2 n , let us denote:
f i ( F ) ( A ) = g n ( A , p i ) + f ( p i )
the B.f. where as usual A = { a 0 , , a n } are the n + 1 variables representing the coefficient of a generic affine function. In this case we have that:
( f 1 ( F ) ( A ) , , f 2 n ( F ) ( A ) ) = g n ̲ ( A ) + f ̲ ( F [ A ] ) 2 n
Note that the polynomials f i ( F ) are affine polynomials. We also denote by
f i ( Z ) ( A ) = NNF ( f i ( F ) ( A ) )
the NNF of each f i ( F ) ( A ) (obtained as in [33], Theorem 1).
Definition 10.
We call n f ( A ) = f 1 ( Z ) ( A ) + + f 2 n ( Z ) ( A ) Z [ A ] the integer nonlinearity polynomial (or simply the nonlinearity polynomial) of the B.f. f. For any t N we define the ideal N f t Q [ A ] as follows:
N f t = E [ A ] { f 1 ( Z ) + + f 2 n ( Z ) t } = E [ A ] { n f t }
Note that the evaluation vector n f ̲ represents all the distances of f from all possible affine functions (in n variables).
Theorem 3.
The variety of the ideal N f t is non-empty if and only if the B.f. f has distance t from an affine function. In particular, N ( f ) = t , where t is the minimum positive integer such that V ( N f t ) .
Proof. 
Note that N f t = E [ A ] + { n f ( A ) t } and so V ( N f t ) = V ( E [ A ] ) V ( { n f ( A ) t } ) . Therefore, V ( N f t ) if and only if a ¯ = ( a ¯ 0 , , a ¯ n ) V ( E [ A ] ) such that n f ( a ¯ ) = t . Let α A n such that α ( X ) = a ¯ 0 + i = 1 n a ¯ i x i . By definition we have f i ( Z ) = 1 f ( p i ) α ( p i ) and f i ( Z ) = 0 f ( p i ) = α ( p i ) . Hence n f ( a ¯ ) = i = 1 2 n f i ( Z ) ( a ¯ ) t = 0 | { i f ( p i ) α ( p i ) } | = t d ( f , α ) = t . and our claim follows directly. □
To compute the nonlinearity of f we can use Algorithm 2 over the rational field ( K = Q ), with input f.
Algorithm 2 NL GB F . To compute the nonlinearity of the B.f. f using Gröbner basis over a field K .
Input:f
Output: nonlinearity of f
  1: Compute n f
  2: j 1
  3: while V ( N f j ) = do
  4:  j j + 1
  5: end while
  6: return j

4.3. Fast Polynomial Evaluation

Once the nonlinearity polynomial n f is defined, we can use another approach to compute the nonlinearity avoiding the computations of Gröbner bases. We have to find the minimum nonnegative integer t in the set of the evaluations of n f , that is, in  { n f ( a ¯ ) a ¯ { 0 , 1 } n + 1 Z n + 1 } . To compute the evaluations we can use a Fast Polynomial Evaluation algorithm ( FPE ), such as the fast Möbius transform. In Algorithm 3, we explicitly show the above steps.
Algorithm 3 NL GB F . To compute the nonlinearity of the Boolean function, using Nonlinearity Polynomial ( NLP ) and Fast Polynomial Evaluation ( FPE ).
Input:f
Output: nonlinearity of f
  1: if f A n then
  2:  return 0
  3: else
  4:  Compute n f // Algorithm 4: NLP
  5:  Compute m = min { n f ( a ¯ ) a ¯ { 0 , 1 } n + 1 } // FPE
  6:  return m
  7: end if
Example 5.
Consider the case n = 2 , f ( x 1 , x 2 ) = x 1 x 2 + 1 . We have that f ̲ = ( 1 , 1 , 1 , 0 ) and g n ̲ = ( a 0 , a 0 + a 1 , a 0 + a 2 , a 0 + a 1 + a 2 ) . Let us compute all f i ( F ) = ( g n ̲ + f ̲ ) i and f i ( Z ) , for i = 1 , , 2 2 :
f 1 ( F ) = a 0 + 1 f 1 ( Z ) = a 0 + 1 f 2 ( F ) = a 0 + a 1 + 1 f 2 ( Z ) = 2 a 0 a 1 a 0 a 1 + 1 f 3 ( F ) = a 0 + a 2 + 1 f 3 ( Z ) = 2 a 0 a 2 a 0 a 2 + 1 f 4 ( F ) = a 0 + a 1 + a 2 f 4 ( Z ) = 4 a 0 a 1 a 2 2 a 0 a 1 2 a 0 a 2 + a 0 2 a 1 a 2 + a 1 + a 2
Then n f = f 1 ( Z ) + f 2 ( Z ) + f 3 ( Z ) + f 4 ( Z ) = 4 a 0 a 1 a 2 2 a 0 2 a 1 a 2 + 3 and since
n f ̲ = ( 3 , 1 , 3 , 1 , 3 , 1 , 1 , 3 )
then the nonlinearity of f is 1. Observe that the vector n f ̲ represents all the distances of f from all possible affine functions in 2 variables, that is, from  0 , 1 , x 1 , x 1 + 1 , x 2 , x 2 + 1 , x 1 + x 2 , x 1 + x 2 + 1 .

4.4. Properties of the Nonlinearity Polynomial

From now on, with abuse of notation, we sometimes consider 0 and 1 as elements of F and other times as elements of Z . We have the following simple lemma:
Lemma 3.
Given b 1 , , b n F
b 1 b n = v = ( v 1 , , v n ) F n , v 0 ( 2 ) w ( v ) 1 · b 1 v 1 b n v n .
where the sum on the right is in Z .
It is easy to show that b 1 b n { 0 , 1 } . We give a theorem to compute the coefficients of the nonlinearity polynomial.
Theorem 4.
Let v = ( v 0 , v 1 , , v n ) F n + 1 , v ˜ = ( v 1 , , v n ) F n , A v = a 0 v 0 a n v n F [ A ] and c v Z be such that n f = v F n + 1 c v A v . Then the coefficients of n f can be computed as:
c v = u F n f ( u ) = w ( f ̲ ) if v s . = 0
c v = ( 2 ) w ( v ) u F n v ˜ u f ( u ) 1 2 if v s . 0
Proof. 
The nonlinearity polynomial is the integer sum of the 2 n numerical normal forms of the affine polynomials g n ( A , u ) f ( u ) F [ A ] , each identified by the vector u F n , i.e.,:
n f = u F n NNF ( g n ( A , u ) f ( u ) ) = u F n NNF ( a 0 a 1 u 1 a n u n f ( u ) )
which is a polynomial in Z [ A ] . The NNF of g n ( A , u ) f ( u ) is a polynomial with 2 n + 1 terms, i.e.,:
NNF ( g n ( A , u ) f ( u ) ) = v F n + 1 λ v A v ,
for some λ v Z , and by Proposition 1
λ v ( u ) = ( 1 ) w ( v ) a F n + 1 | a v ( 1 ) w ( a ) g n ( a , u ) f ( u ) .
Let us prove Equation (3). When v = ( 0 , , 0 ) we have
c ( 0 , , 0 ) = u F n g n ( ( 0 , , 0 ) , u ) f ( u ) = u F n f ( u ) .
Let us prove Equation (4). Suppose v 0 . Now the coefficient c v of the monomial A v of the nonlinearity polynomial is such that:
c v = u F n λ v ( u ) = = u F n ( 1 ) w ( v ) a F n + 1 , a v ( 1 ) w ( a ) g n ( a , u ) f ( u ) = = ( 1 ) w ( v ) u F n a F n + 1 , a v ( 1 ) w ( a ) g n ( a , u ) f ( u ) .
We claim that each u such that v ˜ = ( v 1 , , v n ) u yields a zero term in the summation. If v ˜ u then i { 1 , , n } s.t. v i > u i , i.e.,  v i = 1 , u i = 0 . We show now that a F n + 1 s.t. a v s . a ¯ = ( a ¯ 0 , , a ¯ n ) F n + 1 s.t. a ¯ v and
( 1 ) w ( a ) g n ( a , u ) f ( u ) + ( 1 ) w ( a ¯ ) g n ( a ¯ , u ) f ( u ) = 0
It is sufficient to choose a ¯ i a i and a ¯ j = a j for all j { 1 , , n } , j i . Clearly a ¯ v and a v since v i = 1 . By direct substitution we obtain
( 1 ) w ( a ) g n ( a , u ) f ( u ) + ( 1 ) w ( a ¯ ) g n ( a ¯ , u ) f ( u ) = = ( 1 ) w ( a ) a 0 a 1 u 1 a i u i a n u n + ( 1 ) w ( a ) ( 1 ) a ¯ 0 a ¯ 1 u 1 a ¯ i u i a ¯ n u n = ( 1 ) w ( a ) [ a i u i a ¯ i u i ] = 0 .
Thanks to (6) we can continue from (5) and get
c v = ( 1 ) w ( v ) u F n v ˜ u a F n + 1 , a v ( 1 ) w ( a ) [ g n ( a , u ) + f ( u ) 2 g n ( a , u ) f ( u ) ] ,
where we used a b = a + b 2 a b .
Now we consider v , u fixed, and  v ˜ u . There are exactly 2 w ( v ) vectors a such that a v , i.e.,:
| { a F n + 1 a v s . } | = 2 w ( v )
Now we want to study the internal summation in (7). If u = ( 0 , , 0 ) then a = ( a 0 , , a n ) v we have g n ( a , u ) = a 0 a 1 u 1 a n u n = a 0 . Otherwise, if  u ( 0 , , 0 ) we can consider the following set of indices U = { j u j = 1 } = { j 1 , , j w ( u ) } , which has size w ( u ) . Since a v and v ˜ u then ( a 1 , , a n ) u by transitivity. For all j U we have a j = 0 , and then w ( a 0 , a j 1 , , a j w ( u ) ) = w ( a ) . Thus, for any u F n we have
g n ( a , u ) = a 0 a j 1 a j w ( u ) = 1   if   w ( a ) is   odd 0   if   w ( a ) is   even
and each of the two cases happens for exactly one half of the vectors a v . Clearly the two halves are disjointed. This yields, from (5) and (7), the following chain of equalities:
c v = u F n λ v ( u ) = = ( 1 ) w ( v ) u F n v ˜ u [ a F n + 1 , a v g n ( a , u ) = 0 ( 1 ) w ( a ) f ( u ) + a F n + 1 , a v g n ( a , u ) = 1 ( 1 ) w ( a ) ( 1 f ( u ) ) ] = = ( 1 ) w ( v ) u F n v ˜ u [ a F n + 1 , a v g n ( a , u ) = 0 f ( u ) + a F n + 1 , a v g n ( a , u ) = 1 ( f ( u ) 1 ) ] = = ( 1 ) w ( v ) u F n v ˜ u [ 2 w ( v ) 1 f ( u ) + 2 w ( v ) 1 ( f ( u ) 1 ) ] = = ( 1 ) w ( v ) u F n v ˜ u [ 2 w ( v ) f ( u ) 2 w ( v ) 1 ] = = ( 2 ) w ( v ) u F n v ˜ u [ f ( u ) 1 2 ]
which proves the theorem. □
In particular we have:
Corollary 1.
Let u = ( u 1 , , u n ) and the nonlinearity polynomial
n f = u F n c ( 0 , u ) a 1 u 1 · · a n u n + a 0 u F n c ( 1 , u ) a 1 u 1 · · a n u n .
Then, we have that:
c ( 1 , 0 , , 0 ) = 2 n 2 w ( f ̲ )
Furthermore, v ˜ F n , v ˜ 0 we have:
c ( 1 , v ˜ ) = 2 c ( 0 , v ˜ ) , .
Corollary 1 shows that it is sufficient to store half of the coefficients of n f , precisely the coefficients of the monomials where a 0 does not appear.
Corollary 2.
Each coefficient c of the nonlinearity polynomial n f is such that | c | 2 n .
Corollary 3.
Given the nonlinearity polynomial of f as
n f ( a 0 , , a n ) = c ( 0 , , 0 ) + ( p 0 , , p n ) F n + 1 ( p 0 , , p n ) ( 0 , , 0 ) c ( p 0 , , p n ) a 0 p 0 · · a n p n
then the nonlinearity polynomial of f 1 is related to that of f by the following rule:
n f 1 ( a 0 , , a n ) = 2 n c ( 0 , , 0 ) + ( p 0 , , p n ) F n + 1 ( p 0 , , p n ) ( 0 , , 0 ) c ( p 0 , , p n ) a 0 p 0 · · a n p n
A scheme that shows how to derive the coefficients of the nonlinearity polynomial in the case n = 3 can be seen in Table 1 and Table 2.

5. Complexity Considerations

In this section, we analyze the complexity of constructing the nonlinearity polynomial and of running Algorithms 1–3 to compute the nonlinearity. Recall that, using the Fast Möbius and the Fast Walsh Transform, the complexity of computing the nonlinearity of a B.f. with n variables, having as input its coefficients vector, is O ( n 2 n ) .

5.1. Complexity of Constructing the Nonlinearity Polynomial

In Algorithm 4, we provide the pseudo code to compute the coefficients of the nonlinearity polynomial in O ( n 2 n ) integer operations. In Figure 1, Algorithm 4 is visualized for n = 3 .
Algorithm 4 NLP . Algorithm to calculate the nonlinearity polynomial n f in O ( n 2 n ) integer operations.
Input: The evaluation vector f ̲ of a B.f. f ( x 1 , , x n )
Output: the vector c = ( c 1 , , c 2 n + 1 ) of the coefficients of n f
  Calculation of the coefficients of the monomials not containing a 0
   1: ( c 1 , , c 2 n ) = f ̲
   2: for i = 0 , , n 1 do
   3:   b 0
   4:  repeat
   5:    for  x = b , , b + 2 i 1  do
   6:       c x + 1 c x + 1 + c x + 2 i + 1
   7:      if  x = b  then
   8:         c x + 2 i + 1 2 i 2 c x + 2 i + 1
   9:      else
 10:         c x + 2 i + 1 2 c x + 2 i + 1
 11:      end if
 12:    end for
 13:     b b + 2 i + 1
 14:  until  b = 2 n
 15: end for
  Calculation of the coefficients of the monomials containing a 0
 16: c 1 + 2 n 2 n 2 c 1
 17: for i = 2 , , 2 n do
 18:   c i + 2 n 2 c i
 19: end for
 20: return c
Theorem 5.
Algorithm 4 requires:
1.
O ( n 2 n ) integer sums and doublings, in particular about n 2 n 1 integer sums and about n 2 n 1 integer doublings.
2.
The storage of O ( 2 n ) integers of size less than or equal to 2 n .
Proof. 
In the first part of Algorithm 4 (the computation of the coefficients of the monomials not containing a 0 ) the iteration on i is repeated n times. For each i, Step 9 and Step 11 or 13 are repeated 2 i 2 n 2 i + 1 = 2 n / 2 times (since b goes from 0 to 2 n by a step of 2 i + 1 and x performs 2 i steps). In Step 9 only one integer sum is performed, in Steps 11 we have one integer sum and one doubling, and in Step 13 only one doubling. Then the total amount of integer operation is O ( n 2 n ) . Finally the computation of the coefficients of the monomials containing a 0 requires only 2 n integer doublings. To store all the monomials of the nonlinearity polynomial we have to store 2 n + 1 integers, although Corollary 1 shows that it is sufficient to store only the first half of them, i.e., 2 n integers. By Corollary 2, their size is less than or equal to 2 n . □

5.2. Some Considerations on Algorithm 1

In Algorithm 1, almost all the computations are wasted evaluating all possible simple-t-monomials in 2 n variables, which are 2 n t . This number grows enormously even for small values of n and t. We investigated experimentally how many of the 2 n t monomials are actually needed to compute the final Gröbner basis of J t n . Our experiment ran over all possible Boolean functions in 3 and 4 variables. The results are reported in Table 3, Table 4 and Table 5. In this tables, for each J t n there are four columns. Let G t n be the Gröbner basis of J t n . Under the column labeled #C we report the average number of checked monomials in 2 n variables before obtaining G t n . Under the column labeled #S we report the average number of monomials which are actually sufficient to obtain G t n . Under the columns labeled “m” e “M” we report, respectively, the minimum and the maximum number of sufficient monomials to find G t n running through all possible Boolean functions in n variables. For example, to compute the Gröbner basis of the ideal J 2 3 associated with a B.f. f whose nonlinearity is 2, we needed to check on average 24 monomials before finding the correct basis. Between the 24 monomials only 9.7 (on average) were sufficient to obtain the same basis, where the number of sufficient monomials never exceeded the range 8–11.

5.3. Algorithms 1 and 2

Since it is not easy to estimate the complexity of a Gröbner basis computation theoretically, we give some experimental results, shown in Table 6.
In this table we report the coefficients of growth of the analyzed algorithms (to compute the values in the columns FWT and NL NLP + FPE we tested 15,000 random Boolean functions from n = 4 , since for n = 3 there are only 2 ( 2 3 ) = 256 Boolean functions), comparing them with the value log 2 ( n + 1 ) 2 n + 1 n 2 n . For each algorithm we compute the average time t n to compute the nonlinearity of a B.f. with n variables and the average time t n + 1 to compute the nonlinearity of a B.f. with n + 1 variables. Then we report in the table the value log 2 t n + 1 t n . When Gröbner bases are computed, then graded reverse lexicographical order is used, with Magma [39] implementation of the Faugère F 4 algorithm [40]. Since the ideal J t n ( f ) of Definition 9 is derived from the evaluation of 2 n t monomials (generating at most the same number of equations), then the complexity of Algorithm 1 is equivalent to the complexity of computing a Gröbner basis of at most 2 n t equations of degree d (where 1 < d t ) in n + 1 variables over the field F . This method becomes almost impractical for n = 5 . We recall that t 2 n 1 2 n 2 1 (see Equation (2)).
The complexity of Algorithm 2 is equivalent to the complexity of computing a Gröbner basis of only n + 1 field equations plus one single polynomial n f of degree at most n + 1 in n + 1 variables over the rational field, i.e., K = Q (or over a prime field, i.e., K = F p ) with coefficients of size less then or equal to 2 n . As shown in Table 6, computing this Gröbner basis over a prime field F p with p 2 n is much faster than computing the same base over Q . It may be investigated if there exist better size for the prime p.

5.4. Algorithm 3

Theorem 6.
Algorithm 3 returns the nonlinearity of a B.f. f with n variables in O ( n 2 n ) integers operations (sums and doublings).
Proof. 
Algorithm 3 can be divided in three main steps:
  • Calculation of the nonlinearity polynomial n f . This step, as shown in Theorem 5, requires O ( n 2 n ) integer operations and O ( 2 n ) memory.
  • Evaluation of the nonlinearity polynomial n f . This step can be performed using fast Möbius transform in O ( n 2 n ) integer sums and O ( 2 n ) memory. We refer to this algorithm as the Fast Polynomial Evaluation ( FPE ) algorithm.
  • Computation of the minimum n f ( a ) with a Z n + 1 . This step requires no more than O ( 2 n ) checks.
The overall complexity is then O ( n 2 n ) integer operations and O ( 2 n ) memory. □

6. Conclusions

We presented three approaches to compute the nonlinearity of a Boolean function using multivariate polynomials. In particular we show that the problem of computing the distance of a generic B.f. f from the set of affine functions is equivalent to the problem of solving a multivariate polynomial system over the binary field. This system can be reformulated over the rationals by considering the associated pseudo Boolean function, and we can exhibit a multivariate polynomial whose evaluations solve the problem. Moreover, we evaluate our polynomial using fast Fourier techniques and solve the problem very efficiently. In particular, with our polynomial-based approach we compute the nonlinearity of any B.f. in O ( n 2 n ) operations, reaching the same asymptotic complexity of classical methods. The first of the presented methods returns the nonlinearity of f and a compact algebraic representation of all affine functions with distance t from f, opposed to traditional methods to compute the nonlinearity which only allow to deduce these affine functions from the Walsh table, not yielding a compact algebraic representation. Regarding the two other methods, they make use of a special polynomial, namely the nonlinearity polynomial, which is an interesting mathematical object per se. Studying his properties might open interesting research directions, and, possibly, finding a more efficient way of determining its minimum value, will determine a more efficient way of computing the nonlinearity.

Author Contributions

Conceptualization, E.B., M.S. and I.S.; methodology, E.B., M.S. and I.S.; software, E.B.; validation, E.B., M.S.; formal analysis, E.B., M.S. and I.S.; investigation, E.B., M.S. and I.S.; resources, E.B., M.S. and I.S.; data curation, E.B., M.S. and I.S.; writing—original draft preparation, E.B., M.S. and I.S.; writing—review and editing, E.B., M.S. and I.S.; visualization, E.B., M.S. and I.S.; supervision, M.S.; project administration, M.S.; funding acquisition, not applicable. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Acknowledgments

These results have been partially presented in three conferences, WCC 2007 [29], YACC 2014 [31], MEGA 2015 [30], and in the Ph.D. thesis [41,42]. The first two authors would like to thank the third author (their supervisor).

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Shannon, C.E. Communication theory of secrecy systems. Bell Syst. Tech. J. 1949, 28, 656–715. [Google Scholar] [CrossRef]
  2. Rothaus, O.S. On “bent” functions. J. Comb. Theory Ser. A 1976, 20, 300–305. [Google Scholar] [CrossRef] [Green Version]
  3. Adams, C.M.; Tavares, S.E. The Use of Bent Sequences to Achieve Higher-Order Strict Avalanche Criterion in S-Box Design; Technical Report TR 90-013; Queen’s University: Kingston, ON, Canada, 1990. [Google Scholar]
  4. Maitra, S.; Sarkar, P. Maximum nonlinearity of symmetric Boolean functions on odd number of variables. IEEE Trans. Inf. Theory 2002, 48, 2626–2630. [Google Scholar] [CrossRef]
  5. Savickỳ, P. On the bent Boolean functions that are symmetric. Eur. J. Comb. 1994, 15, 407–410. [Google Scholar] [CrossRef] [Green Version]
  6. Cusick, T.W.; Stanica, P. Cryptographic Boolean Functions and Applications; Academic Press: Cambridge, MA, USA, 2017. [Google Scholar]
  7. Carlet, C. Boolean Functions for Cryptography and Coding Theory; Cambridge University Press: Cambridge, UK, 2021. [Google Scholar]
  8. Wu, C.-K.; Feng, D. Boolean Functions and Their Applications in Cryptography; Springer: Berlin/Heidelberg, Germany, 2016. [Google Scholar]
  9. Carlet, C.; Mesnager, S. Four decades of research on bent functions. Des. Codes Cryptogr. 2016, 78, 5–50. [Google Scholar] [CrossRef]
  10. Dillon, J.F. Elementary Hadamard Difference Sets. Ph.D. Thesis, University of Maryland, College Park, MD, USA, 1974. [Google Scholar]
  11. Tokareva, N. Bent Functions: Results and Applications to Cryptography; Academic Press: Cambridge, MA, USA; Elsevier: Amsterdam, The Netherlands, 2015. [Google Scholar]
  12. Carlet, C. Boolean functions for cryptography and error correcting codes, Boolean Models and Methods in Mathematics. Comput. Sci. Eng. 2010, 2, 257–397. [Google Scholar]
  13. Mesnager, S. Bent Functions; Springer: Berlin/Heidelberg, Germany, 2016. [Google Scholar]
  14. Çalık, Ç. Nonlinearity computation for sparse boolean functions. arXiv 2013, arXiv:1305.0860. [Google Scholar]
  15. Çalık, Ç. Computing Cryptographic Properties of Boolean Functions from the Algebraic Normal form Representation. Ph.D. Thesis, Middle East Technical University, Ankara, Turkey, 2013. [Google Scholar]
  16. Carlet, C. On the confusion and diffusion properties of Maiorana–McFarland’s and extended Maiorana–McFarland’s functions. J. Complex. 2004, 20, 182–204. [Google Scholar] [CrossRef] [Green Version]
  17. Dobbertin, H. Construction of bent functions and balanced Boolean functions with high nonlinearity. In International Workshop on Fast Software Encryption; Springer: Berlin/Heidelberg, Germany, 1994; pp. 61–74. [Google Scholar]
  18. Charpin, P. Normal boolean functions. J. Complex. 2004, 20, 245–265. [Google Scholar] [CrossRef] [Green Version]
  19. Carlet, C.; Méaux, P.; Rotella, Y. Boolean functions with restricted input and their robustness; application to the flip cipher. IACR Trans. Symmetric Cryptol. 2017, 2017, 192–227. [Google Scholar] [CrossRef]
  20. Carlet, C. Recursive lower bounds on the nonlinearity profile of boolean functions and their applications. IEEE Trans. Inf. Theory 2008, 54, 1262–1272. [Google Scholar] [CrossRef]
  21. Iwata, T.; Kurosawa, K. Probabilistic higher order differential attack and higher order bent functions. In International Conference on the Theory and Application of Cryptology and Information Security; Springer: Berlin/Heidelberg, Germany, 1999; pp. 62–74. [Google Scholar]
  22. Carlet, C. On the higher order nonlinearities of algebraic immune functions. In Annual International Cryptology Conference; Springer: Berlin/Heidelberg, Germany, 2006; pp. 584–601. [Google Scholar]
  23. Carlet, C.; Dalai, D.K.; Gupta, K.C.; Maitra, S. Algebraic immunity for cryptographically significant boolean functions: Analysis and construction. IEEE Trans. Inf. Theory 2006, 52, 3105–3121. [Google Scholar] [CrossRef]
  24. Yan, H.; Tang, D. Improving lower bounds on the second-order nonlinearity of three classes of boolean functions. Discret. Math. 2020, 343, 111698. [Google Scholar] [CrossRef]
  25. Mesnager, S.; Zhou, Z.; Ding, C. On the nonlinearity of boolean functions with restricted input. Cryptogr. Commun. 2019, 11, 63–76. [Google Scholar] [CrossRef]
  26. Semaev, I. New non-linearity parameters of boolean functions. arXiv 2019, arXiv:1906.00426. [Google Scholar]
  27. Guerrini, E.; Orsini, E.; Sala, M. Computing the distance distribution of systematic nonlinear codes. J. Algebra Its Appl. 2010, 9, 241–256. [Google Scholar] [CrossRef] [Green Version]
  28. Bellini, E.; Sala, M. A deterministic algorithm for the distance and weight distribution of binary nonlinear codes. Int. J. Inf. Coding Theory 2018, 5, 18–35. [Google Scholar]
  29. Sala, M.; Simonetti, I. An algebraic description of Boolean Functions. International Workshop on Coding and Cryptography (WCC) 2007, Versailles, France, 2007. Available online: https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.74.3211&rep=rep1&type=pdf (accessed on 2 November 2021).
  30. Bellini, E.; Mora, T.; Sala, M. Algorithmic Approach Using Polynomial Systems for the Nonlinearity of Boolean Functions, Computation Presentation. In Proceedings of the The thirteen conference on Effective Methods in Algebraic Geometry, Trento, Italy, 15–19 June 2015. [Google Scholar]
  31. Bellini, E. Yet Another Algorithm to Compute the Nonlinearity of a Boolean Function. In Proceedings of the Yet Another Conference on Cryptography, Porquerolles, France, 9–13 June 2014; Available online: http://veron.univ-tln.fr/YACC14/Bellini.pdf (accessed on 2 November 2021).
  32. MacWilliams, F.J.; Sloane, N.J.A. The Theory of Error-Correcting Codes; North-Holland Publishing Co. Amsterdam, North-Holland Mathematical Library: Amsterdam, North-Holland, 1977; Volume 16. [Google Scholar]
  33. Carlet, C.; Guillot, P. A new representation of Boolean functions. In Applied Algebra, Algebraic Algorithms and Error-Correcting Codes; Springer: Berlin/Heidelberg, Germany, 1999; pp. 94–103. [Google Scholar]
  34. Carlet, C.; Guillot, P. Bent, resilient functions and the Numerical Normal Form. DIMACS Ser. Discret. Math. Theor. Comput. Sci. 2001, 56, 87–96. [Google Scholar]
  35. Carlet, C. On the coset weight divisibility and nonlinearity of resilient and correlation-immune functions. In Sequences and Their Applications; Springer: Berlin/Heidelberg, Germany, 2002; pp. 131–144. [Google Scholar]
  36. Simonetti, I. On the non-linearity of Boolean functions. In Gröbner Bases, Coding, and Cryptography; RISC Book Series; Sala, M., Mora, T., Perret, L., Sakata, S., Traverso, C., Eds.; Springer: Heidelberg, Germany, 2009; pp. 409–413. [Google Scholar]
  37. Guerrini, E. On Distance and Optimality in Non-Linear Codes. Master’s Thesis, Department of Mathematics, University of Pisa, Pisa, Italy, 2005. [Google Scholar]
  38. Seidenberg, A. Constructions in algebra. Trans. Amer. Math. Soc. 1974, 197, 273–313. [Google Scholar] [CrossRef]
  39. MAGMA: Computational Algebra System for Algebra, Number Theory and Geometry, The University of Sydney Computational Algebra Group. 2020. Available online: http://magma.maths.usyd.edu.au/magma (accessed on 16 December 2021).
  40. Faugere, J.-C. A new efficient algorithm for computing gröbner bases (f4). J. Pure Appl. Algebra 1999, 139, 61–88. [Google Scholar] [CrossRef]
  41. Simonetti, I. On Some Applications of Commutative Algebra to Boolean Functions and Their Non-Linearity. Ph.D. Thesis, Department of Mathematics, University of Trento, Trento, Italy, 2007. [Google Scholar]
  42. Bellini, E. Computational Techniques for Nonlinear Codes and Boolean Functions. Ph.D. Thesis, Department of Mathematics, University of Trento, Trento, Italy, 2014. [Google Scholar]
Figure 1. Butterfly scheme to efficiently compute the coefficients of the nonlinearity polynomial, where ( e 1 , , e 8 ) = ( f ( p 1 ) , , f ( p 8 ) ) (see Algorithm 4: NLP ).
Figure 1. Butterfly scheme to efficiently compute the coefficients of the nonlinearity polynomial, where ( e 1 , , e 8 ) = ( f ( p 1 ) , , f ( p 8 ) ) (see Algorithm 4: NLP ).
Symmetry 14 00213 g001
Table 1. Computation of the coefficients of the nonlinearity polynomial with n = 3 . Each line represents the NNF coefficients of the terms of f ( u ) + g n ( A , u ) not containing a 0 .
Table 1. Computation of the coefficients of the nonlinearity polynomial with n = 3 . Each line represents the NNF coefficients of the terms of f ( u ) + g n ( A , u ) not containing a 0 .
u f ( u ) + g n ( a 0 , a 1 , a 2 , a 3 , u ) 1 a 3 a 2 a 2 a 3 a 1 a 1 a 3 a 1 a 2 a 1 a 2 a 3
000 v 1 + a 0 v 1
001 v 2 + a 0 + a 3 v 2 1 2 v 2
010 v 2 + a 0 + a 2 v 3 1 2 v 3
011 v 2 + a 0 + a 2 + a 3 v 4 1 2 v 4 1 2 v 4 2 + 4 v 4
100 v 2 + a 0 + a 1 v 5 1 2 v 5
101 v 2 + a 0 + a 1 + a 3 v 6 1 2 v 6 1 2 v 6 2 + 4 v 6
110 v 2 + a 0 + a 1 + a 2 v 7 1 2 v 7 1 2 v 7 2 + 4 v 7
111 v 2 + a 0 + a 1 + a 2 + a 3 v 8 1 2 v 8 1 2 v 8 2 + 4 v 8 1 2 v 8 2 + 4 v 8 2 + 4 v 8 4 8 v 8
Table 2. Computation of the coefficients of the nonlinearity polynomial with n = 3 . Each line represents the NNF coefficients of the terms of f ( u ) + g n ( A , u ) containing a 0 .
Table 2. Computation of the coefficients of the nonlinearity polynomial with n = 3 . Each line represents the NNF coefficients of the terms of f ( u ) + g n ( A , u ) containing a 0 .
u f ( u ) + g n ( a 0 , a 1 , a 2 , a 3 , u ) a 0 a 0 a 3 a 0 a 2 a 0 a 2 a 3 a 0 a 1 a 0 a 1 a 3 a 0 a 1 a 2 a 0 a 1 a 2 a 3
000 v 1 + a 0 1 2 v 1
001 v 2 + a 0 + a 3 1 2 v 2 2 + 4 v 2
010 v 2 + a 0 + a 2 1 2 v 3 2 + 4 v 3
011 v 2 + a 0 + a 2 + a 3 1 2 v 4 2 + 4 v 4 2 + 4 v 4 4 8 v 4
100 v 2 + a 0 + a 1 1 2 v 5 2 + 4 v 5
101 v 2 + a 0 + a 1 + a 3 1 2 v 6 2 + 4 v 6 2 + 4 v 6 4 8 v 6
110 v 2 + a 0 + a 1 + a 2 1 2 v 7 2 + 4 v 7 2 + 4 v 7 4 8 v 7
111 v 2 + a 0 + a 1 + a 2 + a 3 1 2 v 8 2 + 4 v 8 2 + 4 v 8 4 8 v 8 2 + 4 v 8 4 8 v 8 4 8 v 8 8 + 16 v 8
Table 3. Number of monomials needed to compute the Gröbner basis of the ideal J t 3 , using Algorithm 1: NL GB F .
Table 3. Number of monomials needed to compute the Gröbner basis of the ideal J t 3 , using Algorithm 1: NL GB F .
J 1 3 J 2 3 J 3 3
NL#SmM#C#SmM#C#SmM#C
0444800000000
14.5454.48.5710280000
24.44549.7811249.381156
Table 4. Number of monomials needed to compute the Gröbner basis of the ideal J t 4 , t = 1 , 2 , 3 , using Algorithm 1: NL GB F .
Table 4. Number of monomials needed to compute the Gröbner basis of the ideal J t 4 , t = 1 , 2 , 3 , using Algorithm 1: NL GB F .
J 1 4 J 2 4 J 3 4
NL#SmM#C#SmM#C#SmM#C
05551600000000
15.254688.758111200000
24.83465.679.9781262.8314.501218560
34.62464.769.9281242.7215.761319315.04
44.53464.429.8381237.4915.811319246.19
54.46454.1910.1181234.3915.891319215.68
64.43454.009.7181124.0017.291619156.86
Table 5. Number of monomials needed to compute the Gröbner basis of the ideal J t 4 , t = 4 , 5 , 6 , 7 , using Algorithm 1: NL GB F .
Table 5. Number of monomials needed to compute the Gröbner basis of the ideal J t 4 , t = 4 , 5 , 6 , 7 , using Algorithm 1: NL GB F .
J 4 4 J 5 4 J 6 4 J 7 4
NL#SmM#C#SmM#C#SmM#C#SmM#C
00000000000000000
10000000000000000
20000000000000000
320.1815231820000000000000
421.4416241319.9623.992229436800000000
521.5419241003.1526.0024283851.2423.50222580080000
619.571920671.712828282603.792828287608.7916161611441
Table 6. Experimental comparisons of the coefficients of growth of the analyzed algorithms.
Table 6. Experimental comparisons of the coefficients of growth of the analyzed algorithms.
n log 2 ( n + 1 ) 2 n + 1 n 2 n FWT NL NLP + FPE
Algorithm 3
NL GB F p
Algorithm 2
NL GB Q
Algorithm 2
NL GB F
Algorithm 1
2–31.53--1.451.862.50
3–41.31--1.882.277.51
4–51.220.901.022.332.91-
5–61.170.981.092.643.23-
6–71.141.011.132.764.29-
7–81.121.221.073.24--
8–91.110.951.173.48--
9–101.091.251.07---
10–111.091.071.11---
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Bellini, E.; Sala, M.; Simonetti, I. Nonlinearity of Boolean Functions: An Algorithmic Approach Based on Multivariate Polynomials. Symmetry 2022, 14, 213. https://0-doi-org.brum.beds.ac.uk/10.3390/sym14020213

AMA Style

Bellini E, Sala M, Simonetti I. Nonlinearity of Boolean Functions: An Algorithmic Approach Based on Multivariate Polynomials. Symmetry. 2022; 14(2):213. https://0-doi-org.brum.beds.ac.uk/10.3390/sym14020213

Chicago/Turabian Style

Bellini, Emanuele, Massimiliano Sala, and Ilaria Simonetti. 2022. "Nonlinearity of Boolean Functions: An Algorithmic Approach Based on Multivariate Polynomials" Symmetry 14, no. 2: 213. https://0-doi-org.brum.beds.ac.uk/10.3390/sym14020213

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop