Charles Bouillaguet
email: charles.bouillaguet@univ-lille1.fr

Pierre-Alain Fouque
email: pierre-alain.fouque@univ-rennes1.fr

Amandine Véber
email: amandine.veber@cmap.polytechnique.fr

Graph-Theoretic Algorithms for the "Isomorphism of Polynomials" Problem

We give three new algorithms to solve the "isomorphism of polynomial" problem, which was underlying the hardness of recovering the secret-key in some multivariate trapdoor one-way functions. In this problem, the adversary is given two quadratic functions, with the promise that they are equal up to linear changes of coordinates. Her objective is to compute these changes of coordinates, a task which is known to be harder than Graph-Isomorphism. Our new algorithm build on previous work in a novel way. Exploiting the birthday paradox, we break instances of the problem in time q 2n/3 (rigorously) and q n/2 (heuristically), where q n is the time needed to invert the quadratic trapdoor function by exhaustive search. These results are obtained by turning the algebraic problem into a combinatorial one, namely that of recovering partial information on an isomorphism between two exponentially large graphs. These graphs, derived from the quadratic functions, are new tools in multivariate cryptanalysis.

Introduction

The notion of equivalent linear maps is a basic concept in linear algebra; two linear functions f and g over vector spaces are equivalent if and only if there exist two other linear bijective functions S and T such that f = T •g•S. Geometrically speaking, this means that f and g are essentially the same function, but with coordinates expressed in different bases. The computational problem consisting in testing the equivalence of two linear functions (given by matrices) is easy, because it is well-known that two linear maps are equivalent if and only if they have the same rank.

This notion of equivalent linear maps lends itself to an obvious generalization, by dropping the requirement that the functions shall be linear. Then, given two vector spaces U and V , of respective dimension n and m, two functions f, g : U → V are said to be equivalent if there exist an invertible n × n matrix S and an invertible m × m matrix T such that g = T • f • S. Again, the geometric interpretation of this notion is that g and f are "the same function", up to linear changes of coordinates. However, deciding the equivalence of two such functions is no longer easy in general.

The case where f and g are polynomial maps is particularly relevant, not only because it is a natural generalization of the linear case, but also because f and g admit a compact representation. It is understood that a polynomial map f is such that each coordinate of the vector f (x) is a polynomial expression of the coordinates of the vector x. Testing the equivalence of two polynomial maps has been called the "Isomorphism of Polynomials" (IP) problem by Patarin in 1996 [START_REF] Patarin | Hidden fields equations (hfe) and isomorphisms of polynomials (ip): Two new families of asymmetric algorithms[END_REF], and later the "Polynomial Linear Equivalence" (PLE) problem by Faugère et al. in 2006 [25].

One aspect of PLE that makes it a bit difficult to study is that depending on the parameters (dimensions and base field of the vector spaces, degree of the polynomials, special restrictions, etc.), the problem can take very different forms. We will thus focus on the case where the base field of the vector space is finite (of size q), where polynomials are quadratic, and where their domain and codomain are the same, i.e., where f, g : (F q )

n → (F q ) n are quadratic maps. This is the setting that appears in most cryptographic constructions. In the sequel we will call this particular restriction the Quadratic Maps Linear Equivalence (QMLE) problem. In order to make our exposition simpler, we will furthermore assume that q, the size of the finite field, is a power of two. The theory of quadratic forms presents itself very differently for odd characteristic and for characteristic two, and in order not to expose two variants of each of our results, we chose the most computer-oriented setting.

The first "multivariate" cryptographic schemes relied on a somewhat heuristic construction to build Trapdoor One-Way Functions, whose security was based on the hardness of QMLE. Starting with an easy-to-invert quadratic map f , one builds an apparently random-looking one by setting g = T • f • S. The idea is that the changes of coordinate would hide the structure of f that makes it easy to invert, so that g would look random. Inverting random quadratic maps is extremely hard, and the best options in general are exhaustive search (if q is small), or the computation of a Groebner basis (when q is large), both techniques being exponential in n. This construction backed one of the advertized goals of multivariate cryptography, namely the ability to encrypt or sign n-bit blocks while offering n bits of security, as opposed to, e.g. RSA.

In this setting, g (and eventually f ) is the public key, while S and T are the secret key. When f is public, then recovering the secret-key precisely means solving an instance of QMLE. Several cryptosystems have been built on this idea [START_REF] Billet | A traceable block cipher[END_REF][START_REF] Wang | Tractable rational map signature[END_REF][START_REF] Ding | -invertible cycles for multivariate quadratic public key cryptography[END_REF][START_REF] Gligoroski | Multivariate quadratic trapdoor functions based on multivariate quadratic quasigroups[END_REF][START_REF] Clough | Square, a new multivariate encryption scheme[END_REF][START_REF] Baena | Square-vinegar signature scheme[END_REF], but they have all been broken [START_REF] Fouque | Key Recovery on Hidden Monomial Multivariate Schemes[END_REF][START_REF] Faugère | Cryptanalysis of the hidden matrix cryptosystem[END_REF][START_REF] Dubois | Cryptanalysis of SFLASH with Slightly Modified Parameters[END_REF][START_REF] Dubois | Practical Cryptanalysis of SFLASH[END_REF][START_REF] Macario-Rat | Cryptanalyse de schémas multivariés et résolution du problème Isomorphisme de Polynômes[END_REF][START_REF] Fouque | Key Recovery on Hidden Monomial Multivariate Schemes[END_REF][START_REF] Joux | Cryptanalysis of the tractable rational map cryptosystem[END_REF][START_REF] Bettale | Cryptanalysis of the trms signature scheme of pkc[END_REF][START_REF] Fouque | Total break of the -ic signature scheme[END_REF][START_REF] Mohamed | Algebraic attack on the mqq public key cryptosystem[END_REF][START_REF] Billet | Cryptanalysis of the square cryptosystems[END_REF]. The main reason behind this fiasco is that the specific instances of QMLE exposed by these schemes were weak because f was too special, so that polynomial-time and/or efficient algorithms to crack them have eventually been designed.

In a different direction, Patarin also proposed to use the hardness of arbitrarily chosen instances of the PLE problem to design a public-key identification scheme, thus potentially avoiding the aforementioned disaster. A prover, who has generated a pair of private/public keys (P K, SK), wants to prove her identity to a verifier who knows P K. In fact the prover aims to convince that she knows SK, but without revealing any information about SK to the verifier, or to anybody else. In 1986, Goldreich, Micali and Wigderson [START_REF] Goldreich | Proofs that yield nothing but their validity and a methodology of cryptographic protocol design[END_REF] built an elegant zero-knowledge proof system for Graph Isomorphism (GI) and used it to build an identification scheme. There, P K is a pair of isomorphic graphs, and SK is the isomorphism (a permutation of the vertices). In order for this system to be secure, it must be hard to solve the instance of GI formed by the public-key. Despite a large research effort, until now no algorithm has been able to solve instances of GI in worst-case polynomial, which is certainly encouraging. However, most instances of GI, and in particular random instances, are extremely easy to solve. Thus, the identification scheme of [START_REF] Goldreich | Proofs that yield nothing but their validity and a methodology of cryptographic protocol design[END_REF] relied on a presumably hard problem for which we do not know how to generate non-trivial instances... Patarin's suggestion was that Graph Isomorphism could be replaced by QMLE, with the hope that random instances of the problem would then be hard, and that key-generation would then be straightforward. There was apparently nothing to lose with the new problem, because it was shown to be harder than GI [START_REF] Patarin | Improved Algorithms for Isomorphisms of Polynomials[END_REF]. Using random instances would in principle avoid the weak instances that had been broken. The resulting QMLE-based identification scheme is not particularly efficient, and does not enjoy very attractive key-sizes, but it is quite simple. It also has a few interesting features compared to other identification schemes based on NP-hard combinatorial problems such as [START_REF] Pointcheval | A new identification scheme based on the perceptrons problem[END_REF][START_REF] Sakumoto | Public-key identification schemes based on multivariate cubic polynomials[END_REF][START_REF] Sakumoto | Public-key identification schemes based on multivariate quadratic polynomials[END_REF][START_REF] Shamir | An efficient identification scheme based on permuted kernels (extended abstract)[END_REF][START_REF] Stern | A new identification scheme based on syndrome decoding[END_REF][START_REF] Stern | Designing identification schemes with keys of short size[END_REF]: most notably, it does not require hash functions nor commitment schemes, and it does not require the parties to share a (usually large) public common string describing an instance of the NP-complete problem.

Related Work

The QMLE problem is reminiscent of the Even-Mansour cipher [START_REF] Even | A construction of a cioher from a single pseudorandom permutation[END_REF], which turns a fixed n-bit permutation P into an n-bit block-cipher with 2n-bit key by setting E k1,k2 (x) = P (x + k 1 ) + k 2 . Attacks against this construction aim to recover the keys while only having black-box access to E and P . One of its distinctive features is that the performance of a successful adversary running in time t and sending q queries is limited by t•q ≥ 2 n , under the assumption that P is a random permutation. The known attacks match this bound [START_REF] Daemen | Limitations of the even-mansour construction[END_REF][START_REF] Dunkelman | Minimalism in cryptography: The evenmansour scheme revisited[END_REF]. As mentioned above, the hardness of QMLE would allow a similar construction where a fixed and public quadratic permutation P is turned into a public-key encryption primitive E S,T = T • P • S. In this context, adversaries not only have oracle to E and P , but know their full description.

Essentially two non-trivial algorithms have been proposed so far for QMLE: the "To-and-Fro" approach [START_REF] Patarin | Improved Algorithms for Isomorphisms of Polynomials[END_REF] on the one hand, and the "Groebner Basis" approach [START_REF] Faugère | Polynomial Equivalence Problems: Algorithmic and Theoretical Aspects[END_REF] on the other hand. There are also several, more efficient algorithms for the special case where the secret T matrix is known to be the identity matrix [START_REF] Geiselmann | An Attack on the Isomorphisms of Polynomials Problem with One Secret[END_REF][START_REF] Perret | A Fast Cryptanalysis of the Isomorphism of Polynomials with One Secret Problem[END_REF][START_REF] Bouillaguet | Practical cryptanalysis of the identification scheme based on the isomorphism of polynomial with one secret problem[END_REF][START_REF] Kayal | Efficient algorithms for some special cases of the polynomial equivalence problem[END_REF]. This sub-problem is also GI-hard, even in very restricted settings [START_REF] Agrawal | Equivalence of f-algebras and cubic forms[END_REF]. The article [START_REF] Alon | Testing boolean function isomorphism[END_REF] considers the particular case of testing whether two boolean func-tions are equal modulo a permutation of their inputs. It shows that 2 n/2 queries are necessary if one only has black-box access to the boolean functions.

Back to the full QMLE problem, the "To-and-Fro" algorithm, while being simple, was exposed on a toy example, without pseudo-code nor detailed analyzis. We are convinced that the algorithm works when the polynomial maps f and g are bijective, but it cannot work as-is when they are not (the authors of [START_REF] Faugère | Polynomial Equivalence Problems: Algorithmic and Theoretical Aspects[END_REF] made the same observation). Note that a random polynomial map is not bijective with overwhelming probability. As is it given in [START_REF] Patarin | Improved Algorithms for Isomorphisms of Polynomials[END_REF], the "to-and-fro" algorithm is thus not applicable to random instances of QMLE. We found out that it is nevertheless possible to adapt the algorithm to work in the non-bijective case, but there are several ways to do so, and some are more efficient than others. Figuring that out required some work, and exposing it requires some space, so we will not go deeper into this issue in this paper. In any case, the authors of [START_REF] Patarin | Improved Algorithms for Isomorphisms of Polynomials[END_REF] claim that the complexity of their algorithm is of order O q 2n when q > 2 and O 2 3n when q = 2, and we agree with them. The algorithm was later independently rediscovered under the form of a procedure to test the linear equivalence of S-boxes [START_REF] Biryukov | A toolbox for cryptanalysis: Linear and affine equivalence algorithms[END_REF].

The "Groebner basis" algorithm, on the other hand is not heuristic, and is well-specified. It consists in identifying coefficient-wise the equation T -1 • g = f • S, which relates two vectors of n quadratic forms. It is therefore equivalent to about n 3 quadratic equations in the 2n 2 coefficients of the unknown changes of coordinates. These equations are then solved through the computation of a Groebner basis. The complexity of Groebner basis algorithms is notoriously tricky to study, and the authors of [START_REF] Faugère | Polynomial Equivalence Problems: Algorithmic and Theoretical Aspects[END_REF] did not give any definitive results. However, they empirically observed an important fact, namely that when f and g are inhomogeneous quadratic maps, i.e., when f and g contains non-zero linear and constant terms, then their algorithm terminated in polynomial time O n 9 . In the homogeneous case, the authors of [START_REF] Faugère | Polynomial Equivalence Problems: Algorithmic and Theoretical Aspects[END_REF] conjectured that their algorithm is subexponential, without providing any argument nor any evidence that it is the case. This assertion is impossible to verify in practice because the complexities are too high, but our own reasoning makes us more inclined to believe that the algorithm is plainly exponential. Assuming that the equations form a semiregular sequence would allow to estimate the complexity of the Groebner basis computation [START_REF] Bardet | On the complexity of Gröbner basis computation of semi-regular overdetermined algebraic equations[END_REF]; doing so results in a total complexity of O 2 18n , yet assuming that the equations are semi-regular is probably a bit of a stretch. Establishing the complexity of this algorithm is thus essentially an open problem.

In the sequel, we will nevertheless take for granted that inhomogeneous instances of QMLE are tractable and can be solved in polynomial time, using the "Groebner-based" algorithm for instance.

It must be noted that in [START_REF] Patarin | Improved Algorithms for Isomorphisms of Polynomials[END_REF], the existence of an algorithm based on the birthday paradox and running in time O q n/2 is asserted, and that this algorithm is itself partially described in [START_REF] Patarin | Improved Algorithms for Isomorphisms of Polynomials -Extended Version[END_REF], where it is called the "combined powers attack". This algorithm is sometimes acknowledged for in the literature (e.g. in [START_REF] Faugère | Polynomial Equivalence Problems: Algorithmic and Theoretical Aspects[END_REF]). However, it is underspecified to the point that it is impossible to implement it, and some of the bits that are specified have major problems. Some of them deterministically fail to meet their goal, and the whole construction relies on heuristic assumptions that are empirically false (sometimes provably). This "algorithm" should thus be disregarded.

Our Results

We give three algorithms to solve QMLE in the homogeneous case. All these algorithms work by reducing the solution of a homogeneous (hard) instance into that of one or several inhomogeneous (easy) instances after some preprocessing. We will thus assume that we are given a (black-box) Inhomogeneous solver that presumably works in polynomial time, and we will count the number of inhomogeneous queries sent to this oracle. We are well-aware that this assumption is quite strong. The empirical success of the algorithm of [START_REF] Faugère | Polynomial Equivalence Problems: Algorithmic and Theoretical Aspects[END_REF] convinced us that it works in polynomial-time on average, yet moving from there to "worst-case polynomial time" seems like a leap of faith. However, this assumption eases our exposition considerably, and in practice there does not seem to be any problem (probably because the queries sent to the inhomogeneous oracle are random enough).

Our three algorithms differ by the number of queries they send to the oracle, by the amount of computation they perform themselves, and by their success probability.

Algo. Preprocessing Inhom. queries success prob.

1 q n 1 2 O n 3 • q 2n/3 q 2n/3 62% 3 O n 5 • q n/2
1 62 % only when q = 2 Algorithm 1 is deterministic, and essentially performs an exhaustive search in (F q ) n , sending one inhomogeneous query per vector. Using the algorithm of [START_REF] Faugère | Polynomial Equivalence Problems: Algorithmic and Theoretical Aspects[END_REF] to deal with the inhomogeneous instances, the resulting complexity is O n 9 • q n , which already improves on the "to-and-fro" algorithm of [START_REF] Patarin | Improved Algorithms for Isomorphisms of Polynomials[END_REF].

Algorithms 2 and 3 rely on the birthday paradox to improve on exhaustive search and break the q n barrier. To this end, two exponentially large isomorphic graphs are derived from the two quadratic maps. Recovering a bit of information on an isomorphism allows to make the problem inhomogeneous, and thus easy to solve. The trick is that this partial information must be extracted without knowing the full graphs, because they are too large. The construction of these graphs borrows from the differential techniques that have broken SFLASH, amongst others.

Algorithm 2 is relatively easy to analyze and we rigorously establish its complexity and success probability when dealing with random instances of the problem. Algorithm 3 is more efficient but more sophisticated and harder to analyze (as well as somewhat heuristic). We provide an as-rigorous-as-possible complexity analysis under a conjecture on random quadratic maps, and we verify experimentally that we are not off by too much.

Because our algorithms are exponential in n, we do not fully break Patarin's identification scheme (it is of no practical value anyway), even though its keysizes should in principle be doubled. The construction of a Trapdoor One-Way Function from QMLE outlined above has already been bludgeoned to death by cryptanalysts, and it now lies on the autopsy table. We take the role of the medical examiner that appears in every good police drama, only to discover that the corpse had a fatal disease even before being brutally assaulted. We indeed believe that our algorithms condemn this generic construction of a Trapdoor One-Way Function post-mortem, and give a theoretical reason not to try again, besides the obvious "they have all been broken" argument. Our algorithms indeed break the QMLE instance and retrieve the secret-key (asymptotically) much faster than inverting the quadratic map by exhaustive search. This shows in passing that this construction can only offer n/2 bits of security, instead of the n that was its original objective.

A First Algorithm Based on Dehomogenization

Confronted with a homogeneous instance of QMLE, our strategy throughout this paper is to build an inhomogeneous instance admitting the exact same solutions. This inhomogeneous instance can in turn be solved in polynomial time, and reveals the solution(s) of the original problem. The downside of this approach is that the image of S must be known at one arbitrary point of the vector space. Indeed, if β = S • α, then:

∀x. g(x) = T • f (S • x) ⇐⇒ ∀x. g(x + α) = T • f (S • x + β).
Thus defining g (x) = g(x + α) and f = f (x + β) yields an equivalent problem, i.e., an instance that has the same solutions as the original one. In addition, the new instance is inhomogeneous. This follows from the simple observation that although x 2 is a homogeneous polynomial, (x + α) 2 = x 2 + 2αx + α 2 is not since it has a non-trivial linear term αx and a non-trivial constant term α 2 . It follows that solving (homogeneous) instances of QMLE essentially boils down to finding Sα, for some known and non-zero vector α. Exhaustive search is the first option that comes to mind, leading to Algorithm 1. This algorithm sends q n queries to the inhomogeneous solver in the worst case, and finds the solutions when they exist. This algorithm terminates with probability one in time O n 9 • q n if the Groebner-based algorithm of [START_REF] Faugère | Polynomial Equivalence Problems: Algorithmic and Theoretical Aspects[END_REF] is used to solve the inhomogeneous instances. Despite being extremely simple, Algorithm 1 is asymptotically q n times faster than to the "to-and-fro" algorithm of [START_REF] Patarin | Improved Algorithms for Isomorphisms of Polynomials[END_REF].

This dehomogenization technique exposes a crucial asymmetry in the problem: it is apparently much more critical to obtain knowledge on S than on T . This is not new: the "To-and-Fro" algorithm relies on the ability to transfer knowledge of a relation

β = S • α to a relation g(α) = T • f (β).
Algorithm 1 Simple algorithm based on dehomogenization.

function Exhaustive-Dehomogenization(f, g)

x ← random non-zero vector in (Fq) n for all 0 = y ∈ (Fq

) n do f (z) ← f (z + y) g (z) ← g(z + x)
query IQMLE-Solver with (f , g ) if solution (S, T ) found then return (S, T ) return "Not Equivalent"

Moving the Problem Into a Graphic World

Using the birthday paradox is a natural idea to improve on exhaustive search algorithms in many scenarii, with the hope to halve the exponent in the complexity. Here, we wish to use the birthday paradox to obtain the image of S at one point, and build a dehomogenized instance, just as we did in the previous section. One difficulty is that we want to focus only on S, and leave T alone. To this end, we introduce a tool which is, to the best of our knowledge, new. We associate a graph G h to any quadratic map h : (F q )

n → (F q ) n . Its vertices are the elements of (F q )

n , and there is an edge between x, y ∈ (F q ) n if and only if h(x + y) = h(x) + h(y). To some extent, G h expresses the "linear behavior" of h (even though h is not linear) and thus we call these graphs the "linearity graphs" of the associated quadratic maps.

These graphs are natural objects associated to quadratic maps. For instance, the distinguisher of [START_REF] Dubois | An efficient provable distinguisher for hfe[END_REF] to determine whether a given quadratic map f is an HFE public key can be rephrased as follows: pick a random node in G f , and count its neighbors. If their number exceeds a given bound (which depends on the degree of the internal HFE polynomial), then return "random", else return "HFE". With the right bound on the number of neighbors, this algorithm achieves subexponential advantage.

The essential interest of linearity graphs for our purposes is that the two graphs G f and G g are connected by the secret matrix S.

Lemma 1. If T • g = f • S then S is a graph isomorphism that sends G f to G g . Proof. Indeed, if x ↔ y in G g , then by definition g(x + y) = g(x) + g(y), and it follows that T • g(x + y) = T • g(x) + T • g(y), and thus that f (S • x + S • y) = f (S • x) + f (S • y). This in turn means that S • x ↔ S • y in G f . It follows that S is a graph isomorphism between G f and G g .
Linearity graphs thus allows a formulation of the problem where the other secret matrix T is no longer present. We have two (exponentially large) isomorphic graphs G f and G g , and we ultimately need to recover the whole isomorphism S. However, thanks to the dehomogenization technique of the previous section, and thanks to the ease with which inhomogeneous instances can be solved, it turns out that recovering just a little bit of information on the isomorphism is enough to find it completely. More precisely, we just need to know how the isomorphism S transforms one arbitrary vertex.

Of course, completely building these graphs is prohibitively expensive (they have q n vertices). It turns out that this is never necessary, because it is possible to walk in these graphs without fully knowing them.

Walking in Linearity Graphs. The function ψ(x, y) = f (x + y) + f (x) + f (y) is a generalization of the polar form of a quadratic form to vectors thereof, in characteristic two. It is easy to check that ψ is bilinear. Given a (non-zero) vertex x ∈ (F q )

n in the graph, the function:

D x f : y → ψ(x, y) = f (x + y) + f (x) + f (y)
is a familiar object in multivariate cryptology, called the Differential of f at x [START_REF] Fouque | Differential cryptanalysis for multivariate schemes[END_REF][START_REF] Dubois | An efficient provable distinguisher for hfe[END_REF][START_REF] Dubois | Practical Cryptanalysis of SFLASH[END_REF][START_REF] Fouque | Key Recovery on Hidden Monomial Multivariate Schemes[END_REF]. It is a linear function from (F q ) n to (F q ) n , which is then conveniently represented by a matrix. The set of nodes adjacent to x in G f is in fact the kernel of D x f . Note that x always belong to ker D x f , because x + x = 0. The main reason we chose to focus on the case where q = 2 e is that this fact is not true when q is not a power of two.

The matrix D x f is easy to compute given f and x. If f is a (homogeneous) quadratic map, then it is in fact a vector of n quadratic forms, which can conveniently be described by a collection of n matrices F 1 , . . . , F n , that are interpreted as follows:

F k [i, j] is the coefficient of x i x j in the k-th component of f . If t M
denotes the transpose of M , then the matrix representation of the differential of f at x is given by:

D x f =   x • (F 1 + t F 1 ) . . . x • (F n + t F n )   .
Thus, given a vector x, finding the neighbors of x in G f can be done in time O n 3 : computing the matrix D x f requires n matrix-vector products, and determining its kernel classically takes O n 3 operations. It is thus possible to crawl the linearity graphs by spending a polynomial number of elementary operations on each traversed vertex.

Structure in Linearity Graphs. Linearity graphs possess a rich structure, thanks to their algebraic origin. Recall that in G f , two nodes x and y are adjacent if ψ(x, y) = 0, where ψ is the symmetric bilinear map defined above. The bilinearity of ψ induces a lot of structure in G f . For instance, we always have ψ(x, x) = 0, and by bilinearity ψ(λx, µx) = λµψ(x, x) = 0, so that the q multiples of a vector x form a clique in G f . The set of all multiples of x are thus topologically indifferentiable (they all have the exact same neighborhood).

Furthermore, the same reasoning shows that if two vectors x and y are adjacent in G f , then the set of q 2 linear combinations λx + µy form a clique in G f of size q 2 . Degree Distribution. If a quadratic map f is randomly chosen (amongst the finite number of possibilities), then the resulting linearity graph G f follows a certain -mostly unknown-probability distribution, and any property of G f can be seen as a random variable. One of the most interesting properties of G f is the distribution of the degree (i.e., of the number of neighbors) of vertices in G f . This result is stated in terms of the probability that a random n × n matrix over F q is invertible. We denote it by λ(n):

λ(n) = n i=1 1 - 1 q i
Lemma 2 (theorem 2 in [START_REF] Dubois | An efficient provable distinguisher for hfe[END_REF]). Let x ∈ (F q ) n be a non-zero vector, and f : (F q )

n → (F q ) n be a uniformly random quadratic map. Then D x f is a uniformly random matrix vanishing over x. As a consequence, the probability that D x f has a kernel of dimension k ≥ 1 is:

λ(n)λ(n -1) λ(k)λ(k -1)λ(n -k) q -k(k-1)
Because λ(n) is a decreasing function of n that converges to a finite limit bounded away from zero, then the ratio of the λ-expressions lives in a small interval, independently of q, n and k, so that the probability is in fact of order q -k(k-1) . Of course, over F q , a k-dimensional vector space contains q k elements, so that if dim ker D x f = k, then the vertex x has q k neighbors.

Sparsity. Computing the expectation and the variance of the degree is technical, but feasible:

E [degree] = q - 1 q n-2 σ 2 = q 2 (q -1) 1 - q 2 + 1 q n + q 2 q 2n
Establishing these two expressions is somewhat technical, yet because both are sums of q-hypergeometric terms, they can be computed by "creative telescoping" thanks to the q-analog of Zeilberger's algorithm [START_REF] Wilf | An algorithmic proof theory for hypergeometric (ordinary and "q") multisum/integral identities[END_REF]. It follows that the expected number of edges of G f is essentially q n+1 /2. In other terms, G f is a very sparse graph that has barely more edges than it has vertices.

Disconnecting Linearity Graphs. A linearity graph G f is fully connected, because all vertices are adjacent to the "zero" vertex. This "zero" vertex is not very interesting (since it is adjacent to every other vertex), and, as a matter of fact, it even turns out to be a bit annoying. Thus, it seems that there is nothing to lose by removing it. In addition, we could also get rif of the self-loops ; they are useless since every vertex has one.

We thus denote by G * f the simple graph G f in which the zero vertex has been removed, and where self-edges are removed. It is interesting to note that the resulting graph is no longer connected, and that there are in fact very many connected components. Indeed, if dim ker D x f = 1, then the only neighbors of x are its multiples, and x belong to a connected component of size q -1. Lemma 2 tells us that this happens with probability λ(n)/λ(1), and this converges to a finite limit bounded away from zero when n goes to infinity. Thus, a constant fraction of the vertices belong to "small" connected components of size q -1. Working a bit on the λ functions reveals that this proportion grows like 1 -1/q 2 .

Just Count Your Neighbors

It is well-know that if two graphs (V 1 , E 1 ) and (V 2 , E 2 ) are isomorphic, and if ρ is an isomorphism between them, then u ∈ V 1 and ρ(u) ∈ V 2 have the same degree, i.e., the same number of neighbors. It follows that if u ∈ V 1 and v ∈ V 2 do not have the same degree, then they cannot be related by ρ.

We adapt this simple idea in the context of QMLE, under the form of Algorithm 2. The main idea in this algorithm is to target vertices in the linearity graphs of f and g that have a specific degree: we only look for a "right pair" y = S • x amongst vertices x, y that have a prescribed degree (chosen to optimise the complexity of the algorithm). The remaining of this section is devoted to establishing the properties of this algorithm, which are summarized in the following theorem.

Algorithm 2 First Birthday Based Algorithm

1: function SampleSet(h) 2:
L ← ∅ 3: repeat 4: repeat 5:

x ← random vertex of G h 6:

until x has q √ n/3 neighbors 7:

L ← L ∪ {x} 8:

until |L| = √ 2q n/3 9: return L 10: function Neighbor-Counting-QMLE(f, g) 11:

U ← SampleSet (f ) 12:

V ← SampleSet (g) 13:

for all (x, y) ∈ U × V do 14:

f (z) ← f (z + y) 15: g (z) ← g(z + x) 16:
query IQMLE-Solver with (f , g ) 17:

if solution (S, T ) found then return (S, T ) 18:

return "Probably not equivalent" Theorem 1. Algorithm 2 performs O q 2n/3 units of computations on average, sends at most q 2n/3 queries to the inhomogeneous solver, and succeeds with probability 1 -1/e.

The helper function SampleSet returns a set of O q n/3 vertices of G f (resp. G g ), each having q √ n/3 neighbors in the graph. It follows that there are q 2n/3 queries to the inhomogeneous solver, because this is the size of the cartesian product U × V .

It remains to establish the complexity of SampleSet, and the success probability of the algorithm. As explained above, since we are looking for a "right pair" y = S • x, it is safe to restrict our attention to vertices x, y that have a specific degree (as long as vertices with such a degree exist in the graphs).

Lemma 2 gives us the expected number iterations of the innermost loop of SampleSet that are required to find a random vertex with the required degree. Up to a constant factor, finding a vertex with degree q k requires q k(k-1) trials, so that finding each new random vertex requires O q n/3 rank computations on n × n matrices, hence O n 3 • q n/3 operations.

Lemma 2 also tells us that there are on average q n-k(k-1) vertices in G f each having degree q k . In Algorithm 2 we look specifically at vertices of degree q √ n/3 , and we thus expect G f to contain q 2n/3 of them. Since the number of iterations of the outermost repeat...until loop is roughly the square root of this number, we do not expect more than a constant number of "extra" iterations finding an already-known vector x. Putting everything together, we conclude that SampleSet terminates after O n 3 q 2n/3 operations. Now, the birthday bound tells us that U × V contains a "right pair" y = Sx with probability greater than 63%, because both U and V contain about the square root of the total number of vertices with degree q √ n/3 (see [START_REF] Vaudenay | A Classical Introduction to Cryptography: Applications for Communications Security[END_REF] for a precise statement of this specific version of the birthday paradox).

Practical Results. We have implemented Algorithm 2 inside the MAGMA computer algebra system [START_REF] Bosma | The Magma Algebra System I: The User Language[END_REF], running on one core of a 2.8 Ghz Xeon machine. As shown in Table 1, we found out that in practice it is difficult to balance the cost of building U and V on the one hand, and going through the candidate pair on the other hand, because the target degree can only take √ n integer values. We could nevertheless verify in practice that the complexity of building the lists and the expected number of right pairs in them is consistent with our expectations. The source code is in the public domain, and is available on the webpage of the first author. It uses an unpublished algorithm to solve the inhomogeneous instances.

n q generating U and V total time log q (target degree) |U | # pairs [START_REF] Cramer | Advances in Cryptology -EUROCRYPT 2005, 24th Annual International Conference on the Theory and Applications of Cryptographic Techniques[END_REF] We have seen in section 3 that the linearity graphs, once deprived from the "zero" vertex, contain many small connected components. Of course, if y = Sx, then the connected component of x is isomorphic to the connected component of y.

In this section, we describe an algorithm that builds upon this idea-instead of just looking at immediate neighbors, as we did in algorithm 2, we now try to look at the whole connected component, in order to distinguish between vertices of the same degree.

Canonical Graph Labeling. Given a graph G, a Canonical Labeling algorithm relabels the vertices of G, thus producing a graph Canon(G), which is by definition isomorphic to G. The result is canonical in the sense that if G and H are isomorphic graphs, then Canon(G) = Canon(H). The canonical labels are therefore complete invariants of the isomorphism class, and as such, computing a canonical labeling is necessarily harder than checking if two graphs are isomorphic. However, computing a canonical labeling can be done in average linear time [START_REF] Babai | Canonical labelling of graphs in linear average time[END_REF], because except for an exponentially small fraction of all graphs, it can be done with a very simple linear algorithm. Deterministic algorithms that always succeed are subexponential, with complexity O exp √ n log n [START_REF] Babai | Computational complexity and the classification of finite simple groups[END_REF]. The perhaps most well-known, and most practical algorithm dates back to 1978, and is implemented in the nauty open-source package [START_REF] Mckay | Computing automorphisms and canonical labelling of graphs[END_REF]. It is known to be exponential on some specific counter-examples [START_REF] Miyazaki | The complexity of mckay's canonical labelling algorithm[END_REF], but otherwise performs exceptionally well. There are also many relevant classes of graphs where canonical labeling is polynomial [START_REF] Fortin | The graph isomorphism problem[END_REF]: graphs of bounded degree, planar graphs, chordal graphs, graphs of bounded treewidth, etc.

Back to our more specific problem, let us denote by C x (resp C y ) the connected component of x in G * f (resp. of y in G * g ). The key idea of the algorithm presented in this section is that y = Sx implies Canon(C x ) = Canon(C y ). Thus, it seems that the function H : u → Canon(C u ) could be used as a "hash function". In fact, in algorithm 2, we used the degree as such a "hash function", but it was not very discriminating, because the degree does not contain enough entropy. We hope that H behaves as a good hash function, and that false positives, i.e., pairs (x, y) such that H(x) = H(y) but y = Sx, should be very rare.

One problem is that H does not distinguish between vertices of the same connected component. To improve it, we would need a way to single out a specific vertex in the connected component. Fortunately, most canonical labeling algorithm return the isomorphism (say ρ) between their argument G and Canon(G). To single a vertex x out in G, it is sufficient to send ρ(x) along with the canonical labeling of G.

A Canonical-Labeling-Based Algorithm As discussed in section 3, G * f contains many small connected components that are all isomorphic to each others, since they are all cliques of size q -1. Therefore, if we want our "hash function" to be discriminating, we must avoid small connected components. Our "hash function" will thus reject the vector x if there is no simple path starting from x and of length at least r. In the other direction, we cannot exclude the existence of a giant connected component of exponential size. Therefore, we only consider the radius-r neighborhood of the vertex x we are interested in, i.e., the set of all vertices that can be reached from x by crossing at most r edges. This is the basis of algorithm 3. V ← SampleHashTable (g) 20:

Algorithm 3 Canonical Labeling/Birthday Based Algorithm

for all (h1 → x) ∈ U, (h2 → y) ∈ V such that h1 = h2 do 21:

f (z) ← f (z + y) 22: g (z) ← g(z + x) 23:
query IQMLE-Solver with (f , g ) 24:

if solution (S, T ) found then return (S, T ) 25:

return "Probably not equivalent"

Remarks on Algorithm 3. Establishing the complexity and success probability of algorithm 3 is surprisingly difficult, probably because is relies on topological properties of G * f , which is a somewhat random but very structured graph. Algorithm 3 has been written in a generic way, independently of the actual value of q. However, we have only been able to discuss its properties when q = 2. We have verified that the algorithm works as we expected in this case, but the situation when q = 2 is not so clear. We tend to believe that the complexity and/or success probability degrade exponentially fast when q grows, but we fall short of definitive conclusion.

When q = 2, the structure of G * f seems to be richer. For instance, we already alluded to the fact that the fraction of nodes whose connected component is of size only q -1, grows like 1 -1/q 2 . In addition, as we will see in the next section, setting q = 2 allows us to turn most more-or-less-random graphs into trees, which are much easier to deal with.

Preliminary Analysis of Algorithm 3. When q = 2, the correctness of the algorithm is implied by the following three heuristic statements.

Claim. i) Hashable [r] G * f ,
x is true with probability ≈ 1/r over the random choice of f (assuming x = 0). ii) Both Hashable [r] and H [r] can be evaluated in expected time O rn 3 .

iii) When restricted to elements that are Hashable [r] , then

H [r] G * f ,
• is an ε r -almost universal hash function family (indexed by f ) for some ε < 1.

The notion of almost universal hash function is usually useful when the hash function is "less injective" than a random function. In this paper though, H [r] can become more injective than a random function, as soon as r becomes sufficiently large.

It follows from claim i that the expected number of iterations of the loop of lines 11-13 is O (r), and it follows from claim ii that finding one admissible vector x requires O r 2 n 3 operations on average. Claim iii then guarantees that if we choose r to be a bit larger than n, then the probability to find hash collisions can be made smaller than 2 -n , and standard birthday-type results guarantee that the number of expected hash collisions in the execution of SampleHashTable is constant. From this, we conclude that SampleHashTable runs in expected time O r 2 n 3 q n/2 .

It follows from the birthday paradox [START_REF] Vaudenay | A Classical Introduction to Cryptography: Applications for Communications Security[END_REF] that there is a "right pair" in U × V , i.e., a pair (x, y) with y = Sx, with probability greater than 1 -1/e. This is because (F q )

n has q n elements and that the sizes of both U and V are essentially q n/2 . This guarantees the success probability of the algorithm.

Let us denote by N the number of bogus inhomogeneous queries, i.e., the number of pairs x = y ∈ U × V with the same hash. It follows from Markov's inequality and claim iii that P [N ≥ 1] ≤ 2q n • ε r . Thus, as soon as r is asymptotically larger than n, e.g. r = n log log n, then the probability that N ≥ 1 gets exponentially small. This concludes our preliminary analysis: algorithm 3 runs in time O n 5 q n/2 , and sends a constant number of inhomogeneous queries. It now remains to show that our claims are valid, but we first find it reassuring to show that the practical behavior of the algorithm is very consistent with our expectations.

experimental results. We have implemented Algorithm 3 using the MAGMA computer algebra system [START_REF] Bosma | The Magma Algebra System I: The User Language[END_REF], and we found out that it works well in practice, as Table 2 shows. The experiment clearly shows that N is constant, as expected. This justify our heuristic analysis a posteriori. The implementation is in the public domain and is available on the webpage of the first author. 6 Discussion of the Claims Special Structure in Linearity Graphs. Any analysis of algorithm 3 will have to rely on the properties of linearity graphs. As argued above, the situation when q = 2 is somewhat different than that obtained with larger values of q. When q = 2, the connected components of G * f seem to enjoy a very nice structure, as illustrated by figure 1. The origin of the triangles is that any nonisolated vertex x belong to the (q 2 -1)-clique formed by x, y and x + y (0 has been removed). If it were not for these triangles, the connected components of G * f would be trees. While this structure is clearly visible on all the examples we could forge, we fall short of any rigorous explanation.

x Fig. 1. A typical moderate-size connected component of G * f when q = 2. Self-edges are not shown. The thick edges show a spanning tree obtained by performing a Breadth-First Search starting from x.

Conjecture 1. When r is polynomial in n, then with high probability the radius-r neighborhood of any vertex in G * f does not contain cliques of size strictly greater than q 2 -1. In addition, every edge belongs to at most one maximal clique with high probability.

Back to the Trees. Fig. 1 illustrates that the connected components are close to trees, and this analogy can easily be made rigorous when q = 2. To a vertex x in a linearity graph G * f , we associate the unordered, unlabeled tree T [r] (G * f , x) by performing a Breadth-First Search in G * f starting from x, and stopping r edges away from x. It is well-known that any graph traversal induces a spanning tree of the graph. The tree T [r] (G * f , x) is simply the spanning tree induced by the BFS (cf. fig. 1). Lemma 3. If G 1 , G 2 satisfy the properties of Conjecture 1, then:

(G 1 , x) isomorphic to (G 2 , y) ⇐⇒ ∀r. T [r] (G * 1 , x) isomorphic to T [r] (G * 2 , y)
This transformation of connected components of G * f into trees serves several purposes : not only it helps understanding why our three claims hold, but is also allows a more efficient formulation of algorithm 3. Indeed, Hashable [r] (G, x) can be evaluated by checking if T [r] (G, x) has depth r. Lastly, it is well-known that unordered, unlabeled trees can be canonically labeled in linear time thanks to a venerable algorithm of Aho, Hopcroft and Ullman [START_REF] Aho | The Design and Analysis of Computer Algorithms[END_REF]. . Random Trees From Random Linearity Graphs. When f is randomly chosen, then T [r] (G * f , x) can also be seen as a random variable. Because each vertex of G * f has k neighbors with some probability, then each node of T [r] (G * f , x) also has a given number of children (sometimes called "offspring" in the context of branching processes) with some probability. Everything looks as if T [r] (G * f , x) were a random tree where the number of descendant of each node was chosen at random according to a given offspring distribution. The offspring distribution of x in T [r] (G * f , x) (i.e., the root of the tree) is almost exactly the degree distribution of G * f , which is known by lemma 2 (with the caveat that self-loops are removed). However, the offspring distribution of non-root nodes is a bit different:

n (i) = P [a non-root node produces i offspring] = p n,k when i = q k -q 2 0 otherwise
where

p n,k = P dim ker D x f = k y ∈ ker D x f = λ(n)λ(n -2) λ(k)λ(k -2)λ(n -k) • q -k(k-2)
The expression of p n,k can be derived from a reasoning similar to that of the proof of lemma 2, which can also be found in [START_REF] Dubois | An efficient provable distinguisher for hfe[END_REF]. It is also possible to compute the expected progeny µ of each non-root node, and the variance σ 2 of the offspring distribution :

µ = 1 - 1 q n-2 σ 2 = q 2 (q -1) 1 - q 2 + 1 q n + q 2 q 2n
These two expressions can be derived from the expectation and the variance of the degree in G f without too much effort. When a random tree is sampled by choosing independently the number of children of each node according to a fixed law, the resulting object is called a random Galton-Watson tree. These random trees are well-studied [START_REF] Athreya | Branching processes[END_REF], and this wealth of results would be extremely useful to our own purposes. Unfortunately, in T [r] (G * f , x), the number of descendant of each node is not even pairwiseindependent.

We nevertheless denote by P n the law of Galton-Watson trees with offspring distribution n , and by

P [r]
n the law of such trees conditioned to be of height at least r. We verified in practice that the following assumption holds very well. Heuristic Assumption: Over the random choice of f , T [r] (G * f , x) has the same properties as Galton-Watson trees sampled according to P

[r]

n and truncated at depth r.

Because µ ≤ 1, trees sampled according to P n are finite with probability one [START_REF] Athreya | Branching processes[END_REF]. In addition, the probability that a tree sampled according to P n has height greater than r is equivalent to 2/(rσ 2 ) ≈ 2/(r • q 3 ) [4]. This justifies claim i.

However, it follows from this result that the expected height of trees sampled according to P n is not finite; this justifies why we stop the BFS after a (finite) depth. It is also known that in trees sampled according to P n , the expected total number of nodes after h generation is h + 1 [START_REF] Pakes | Some limit theorems for the total progeny of a branching process[END_REF]. It follows that actually performing the BFS requires on average O (r) matrix operations. This justifies claim ii.

False Positive Rate. It remains to justify claim iii, the trickiest one. Under the heuristic assumption that T [r] (G * f , x) follows the law P n , then claim iii is equivalent to the following statement: the probability that two random trees sampled according to P

[r]

n are isomorphic decreases exponentially fast with r. In other word, we must determine the probability that two random trees are isomorphic. While this appears to be a natural question, it has (to the best of our knowledge) not been treated in the literature. We could not establish the required exponential upper-bound in general, however we proved a strong enough bound that holds if we are allowed to reject a negligible amount of trees (i.e., shrinking a bit the Hashable [r] domain).

We say that a tree has a unique spine decomposition if there is a unique path starting from the root and reaching a leaf of maximal depth. We also say that a tree has a unique spine decomposition up to height k if there is a unique path starting from the root and reaching depth k that extends to a path reaching nodes of maximal depth. Fig 2 shows a tree with a spine decomposition up to a certain level. Note that it is easy (and efficient) to check whether a given tree has this property. We now redefine the hashable domain by saying that x ∈ G is Hashable [h,r] if and only if T [h] (G, x) has depth at least h, and admits a unique spine decomposition up to height r. Theorem 2. There exists constants c, d such that the probability that a random tree sampled according to P n have a unique spine decomposition up to height r, then the probability that they are isomorphic is upper-bounded by ε r . This justifies claim iii. Proofs of these two theorems can be found in Appendix B. We conclude that modifying the definition of Hashable(G, x) to only accept x if T [h] (G, x) has height h and a unique spine decomposition under height r, with h = n log n and r = n log log n is enough to make algorithm 3 work as advertised.

B Isomorphism of Random Trees

For any n ≥ 3, let T be a tree sampled according to P (i.e., with offspring distribution ), and let P [h] be the law of T conditioned to have height at least h.

In this section, all quantities depend on n (the random tree T, the law P [h] , the offspring distribution , the height h, etc.), but we do not always make this dependency explicitly visible by writing subscripts or superscripts, in order to make notations less cumbersome. In addition, we also write

P [h] [•] instead of P • Height(T) ≥ h .
We need a criterion to decide whether two conditioned trees are isomorphic or not, and we need it to be simple enough so that we may evaluate the probability that it holds. The criterion we will use is the following: two isomorphic trees with a unique spine decomposition must have empty subtrees emanating from the backbone at the exact same heights. Of course, if the spine decomposition is unique up to height r, then this holds only up to height r. This will intuitively show that two random trees with a unique spine decomposition up to height r are isomorphic with a probability that gets exponentially small in r. We will make this intuition formal later, but we must first introduce some properties of the spine decomposition.

We decompose a conditioned tree (i.e., a tree of law P [h] ) into a backbone (or spine) going from the root to height h, on which we graft a given number of unconditioned Galton-Watson trees at each of its nodes. Looking at all nodes of height r, if only one of them has descendants at height h then the spine up to height r is uniquely determined: necessarily, it is the path in the tree going from the root to this node (fig. 2

illustrates this).

Let us work for a moment with ordered Galton-Watson trees. That is, we also record who is the descendant of each parent and offspring are ordered (so that we can talk about brothers to the left or to the right of an individual). In [START_REF] Geiger | Elementary new proofs of classical limit theorems for Galton-Watson processes[END_REF], Geiger shows that if we define the sequence of independent random variables (V m , Y m ) , m ∈ N by

P [V m = j, Y m = k] = P [Height(T) ≥ m -1] P [Height(T) ≥ m] • P [Height(T) < m -1] j-1 • (k),
for 1 ≤ j ≤ k < ∞, then T n conditioned to have height at least h has the same law as the random tree constructed inductively as follows:

-The root (i.e., the first node of the spine) has Y h offspring.

-To each of the V h -1 first offspring node we graft a Galton-Watson tree with offspring distribution and conditioned to have height (strictly) less than h -1. These V h -1 trees are independent of each other (and of the rest of the construction). These subtrees are on the left of the backbone on fig. 3. -To each of the Y h -V h last offspring, we graft an unconditioned Galton-Watson tree with offspring distribution (again, these trees are independent of each other and of the rest of the construction). These subtrees are on the right of the backbone on fig. 3. -The V h -th offspring node continues the spine. It has Y h-1 offspring, the first V h-1 ones are the roots of i.i.d. Galton-Watson trees conditioned to have height less than h -2, the last Y h-1 -V h-1 are the roots of i.i.d. unconditioned Galton-Watson trees and the spine carries on with the V h-1th offspring, which has Y h-2 offspring nodes, and so on.

Observe that the marginal distribution of Y m is given by

P [Y m = y] = 1 -P [Height(T) < m -1] y P [Height(T) ≥ m] • (y), (1)
The spine can be seen as a "prolific" line of descent that survives up to generation h by producing a biased number of offspring, while the other individuals of the population reproduce essentially according to the initial offspring distribution (we refer to [START_REF] Geiger | Elementary new proofs of classical limit theorems for Galton-Watson processes[END_REF] for an explanation of the fact that trees emanating from brothers to the left of the spine are conditioned not to have descendants at generation h).

Proof (proof of theorem 2). We show that in a tree sampled according to P [h] , with high probability only one path from the root to height r extends to a path reaching height h. Call this event A. Since this property is purely topological, then it does not matter whether the tree is ordered or not. We obtain the desired result by bounding from below the probability of A by the probability that all trees emanating from the spine under height r are of height less than h -r. The independence of this family of trees, together with the fact (easy to check) that for every integer i in the interval {1, . . . , r -1}

P Height(T) < h -r Height(T) < h -i ≥ P [Height(T) < h -r] ,
enables us to write

P [A] ≥ r-1 i=0 E P [Height(T) < h -r] Y h-i -1 ≥ E P [Height(T) < h -r] r-1 i=0 Y h-i . (2)
Now, as n → +∞, all the p n,k (for k ∈ {3, . . . , n}) converge to a finite limit p ∞,k , the expected progeny µ converges to 1 (recall that µ < 1 for every n), and finally the variance σ 2 n converges to q 3 -q 2 . The last two convergences happen exponentially fast in n, therefore the same proof as that of Theorem 3.1 in [START_REF] Geiger | Elementary new proofs of classical limit theorems for Galton-Watson processes[END_REF] (in which µ = 1 for all n) shows that whenever (m n ) n≥1 tends to infinity at most polynomially, we have

lim n→∞ m n • P [Height(T) ≥ m n ] = 2 σ 2 . (3)
Furthermore, we have the following lemma.

Lemma 6. There exist constants C 3 , C 4 > 0 such that for every n ≥ 3,

P r-1 i=0 Y h-i > rC 3 ≤ C 4 r .
We postpone the proof of Lemma 6 until the end of the proof of Theorem 2. Armed with (3) and Lemma 6, we can come back to (2) and write for every n

P [A] ≥ E P [Height(T) < h -r] rC3 • 1 { r-1 i=0 Y h-i ≤C3r} ≥ 1 - C 4 σ 2 h rC3 × P r-1 i=0 Y h-i ≤ rC 3 ≥ e -r h C6 1 - C 4 r ≥ 1 - r h C 7 . (4)
Note that for the third inequality, use the fact that 1 -x ≥ e -2x for every x ∈ [0, 1/2]. What (4) shows is that for every n ≥ 3, if we sample a Galton-Watson tree T according to P [h] , then with probability at least 1 -C 7 r h there will be a unique spine decomposition under height r.

Proof (of lemma 6). We use Markov's inequality (in a Chebychev-like fashion) as follows: if C 3 > 0, we have for each n ≥ 3

P r-1 i=0 Y h-i > rC 3 = P r-1 i=0 (Y h-i -E [Y h-i ]) > C 3 • r - r-1 i=0 E [Y h-i ] ≤ E   r-1 i=0 (Y h-i -E [Y h-i ]) 2   C 3 • r - r-1 i=0 E [Y h-i ] 2 .
(

) 5
Let us show that the numerator in the right-hand side of ( 5) is of order r, while the denominator is of order r 2 whenever C 3 > 0 is large enough. These two points rely on appropriate bounds on the first two moments of all Y h-i 's (observe that the numerator is in fact the sum of the variances of the Y h-i 's). Indeed, recall from (1) that for every k ∈ {3, . . . , n},

P Y h-i = q k -q 2 = 1 -P [Height(T) < h -i -1] q k -q 2 P [Height(T) ≥ h -i] • p n,k
and these are the only possible values for Y h-i . Because 1-e -x ≤ x for all x ≥ 0, we can write for every i ≤ r -1 :

1 -P [Height(T) < h -i -1] q k -q 2 ≤ -q k -q 2 log P [Height(T) < h -i -1]
≤ -q k -q 2 log P [Height(T) < h -r -2] .

We thus have for every such integer i

1 -P [Height(T) < h -i -1]
q k -q 2 (q k -q 2 ) • P Combining the above, we arrive at

P Y h-i = q k -q 2 ≤ - log P [Height(T) < h -r -2] P [Height(T) ≥ h] • C q • q k -q 2 q -k(k-2)
for every n ≥ 3 and k ∈ {2, . . . , n}. This yields

E [Y h-i ] ≤ - log P [Height(T) < h -r -2] P [Height(T) ≥ h] • C q • n k=3 q k -q 2 2 q -k(k-2) E (Y h-i ) 2 ≤ - log P [Height(T) < h -r -2] P [Height(T) ≥ h] • C q • n k=2 q k -q 2 3 q -k(k-2)
Now, by (3) we have q k -q 2 2 q -k(k-2) =: m 1 < ∞ and ∞ k=3 q k -q 2 3 q -k(k-2) =: m 2 < ∞.

As a consequence, there exists C > 0 such that for every n ≥ 3, we have

r-1 i=0 E [Y h-i ] ≤ Cm 1 r,
and (using the independence of all Y m 's)

E   r-1 i=0 Y h-i -E [Y h-i ] 2   = r-1 i=0 Var (Y h-i ) ≤ rC ,
for a constant C > 0 depending on m 1 and m 2 . Choosing C 3 > Cm 1 and coming back to [START_REF] Babai | Computational complexity and the classification of finite simple groups[END_REF], we obtain the existence of C 4 > 0 such that for every n ≥ 3,

P r-1 i=0 Y h-i ≥ rC 3 ≤ C 4 r .
This completes the proof of Lemma 6.

Proof (proof of theorem 3). Let us use again T (from the proof of theorem 2) and its spine decomposition under the additional conditioning that all trees emanating from the spine under height r are of height smaller than h -r. We Brother to the right or to the left does not matter here since the condition at the denominator is stronger than Height(T) < h -i -1 for our range of integers i. Let us use [START_REF] Babai | Canonical labelling of graphs in linear average time[END_REF] to obtain some bounds (away from 0 and 1), uniform in n and i ≤ r -1, for the probability that all of the Y h-i -1 brothers of the i-th node of the spine have zero offspring. Because (0) = p n,2 and using (3), the right-hand side of ( 6) is equivalent as n → ∞ to

Thus, if we denote α = P[h] [no nephews at height i], then by definition α ≥ P Y h-i = q 3 -q 2 • (e) q 3 -q 2 -1

Using (1) and (3),

α ≥ 1 -1 - 2 σ 2 (h -i -1) + o 1 h q 3 -q 2 2 σ 2 (h -i) + o 1 h • p n,2
• (e) q 3 -q 2 -1

The fraction is equal to q 3 -q 2 + o(1/(h)), and given the expression of p n,3 as well as [START_REF] Baena | Square-vinegar signature scheme[END_REF], the lower bound on α is equivalent to q 3 -q 2 q 3 • e q 3 -q 2 -1 λ(1)λ(3)

• ∞ j=1
1 -1 q j = e q 3 -q 2 -1 ∞ j=4

1 -1 q j ∈ ]0, 1[.

Likewise, P[h]

[at least one nephew at height i] ≥ P Y h-i = q 3 -q 2 1 -(e) q 3 -q 2 -1

(1 -e q 3 -q 2 -1 ) ∞ j=4

1 -1 q j ∈ ]0, 1[. Hence, since these two probabilities belong to ]0, 1[ for all n ≥ 3 and i ≤ r -1, and belong to a smaller interval of ]0, 1[ bounded away from 0 and 1 whenever n is large enough, this provides the existence of κ l , κ u ∈]0, 1[ such that for every n ≥ 3 and i ∈ {0, . . . , r -1}, 1 -κ l ≤ P[h] [no nephews at height i] ≤ κ u .

Now, let T, T be two trees of height at least h and such that their spine decompositions are unique under height r. For every i ∈ {0, r -1}, let γ i (resp. γ i ) be the indicator function of the event that all brothers of the i-th node of the spine have no offspring. It follows from the properties of the spine decomposition that for every n ≥ 3, {γ i , 0 ≤ i ≤ r -1} form a family of independent random variables and by (8), we have

P[h] γ i = 1 ≤ κ u and P[h] γ i = 0 ≤ κ l .
Comparing the absence or presence of nephews of the spine in T and in T , and defining the constant κ = max(κ l , κ u ) < 1, we obtain:

P[h] [T = T ] ≤ κ r .

Fig. 2 .

 2 Fig. 2. A Tree of height h with a spine decomposition up height r.

nTheorem 3 .

 3 has a spine decomposition up to height r is greater than1 -c • (r/h) -c/r.Informally speaking, this theorem means than enforcing the existence of a unique spine decomposition up to some height does not really shrink the hashable domain. For instance, one may pick h = n log n and r = n log log n. With these values, trees of height h have a unique spine decomposition up to height r asymptotically almost surely. There is a constant ε ∈]0; 1[ such that if two trees sampled according to P [h]

Fig. 3 .

 3 Fig.3. Illustration of the spine decomposition (this is Figure1from[START_REF] Geiger | Elementary new proofs of classical limit theorems for Galton-Watson processes[END_REF]). This shows the Galton-Watson tree conditionned on non-extinction at generation n and n + 1 respectively. GW (k) denotes a Galton-Watson tree conditioned to be extinct at generation k. The subtrees to the right of the line of descent of the left-most particle are ordinary Galton-Watson trees.

  [Height(T) ≥ h -i] ≤ -log P [Height(T) < h -r -2] P [Height(T) ≥ h] . Moreover, because λ(•) is decreasing, λ(n)λ(n -2) λ(k)λ(k -2)λ(n -k)

  lim n→∞ -log P [Height(T) < h -r -2] P [Height(T) ≥ h]

  write P[h] [•] as a shorthand for this conditionnal probability. By construction, each brother of the i-th node of the spine (0 ≤ i ≤ r -1) has no offspring with probabilitye := P T = ∅ Height(T) ≤ h -r = P [T = ∅] P [Height(T) ≤ h -r] = n (0) P [Height(T) ≤ h -r].

Table 1 .

 1 Experimental results on Algorithm 2.

	2	0s	68s	3	1	4
	22 2	28s	9h45m	4	13 400
	28 2	4913s	2h15m	5	8	64

Table 2 .

 2 Experimental results on Algorithm 3

	n q generating U and V finding collisions |U | N
	16 2	3.6 s	1s	64	6
	24 2	123 s	13s	836 5
	32 2	61 min	200s	11585 2
	40 2	31 h	2h	165794 7

A Expected Progeny and Variance

By definition the expected progeny is:

Via an analog of lemma 2, this can be rephrased in terms of the properties of a random linear map h. Indeed, it is shown in [START_REF] Dubois | An efficient provable distinguisher for hfe[END_REF] that: p n,k = P dim ker D x f = k y ∈ ker D x f = P dim ker h = k x, y ∈ ker h And therefore:

The sum is in fact the expected cardinality of the kernel of a random linear map known to vanish on a fixed 2-dimensional subspace:

Thus, to establish the expression of µ, we determine the expected cardinality of the kernel of a random linear map h known to vanish on a fixed subspace F of dimension s. Even though this seems to be an elementary question, we could not find the result in the existing literature. Lemma 4. Let h be a uniformly random endomorphism of (F q )

n , vanishing on a subspace F of (F q )

n , with dim F = s. Then:

This lemma establishes the expression of µ (and we postpone its proof a little bit). Let us now turn our attention to the variance σ 2 :

Thanks to the relation between p n,k and random linear maps outlined above, we see that σ 2 is in fact exactly the variance of the cardinality of the kernel of a random linear map known to vanish on two fixed vectors.

Lemma 5. Let h be a uniformly random endomorphism of (F q )

n , vanishing on a subspace F of (F q )

n , with dim F = s. Then the variance of the cardinality of its kernel is:

This establishes the expression of σ 2 . We know give the proofs of the two lemma.

Proof (of lemma 4).

A combinatorial and/or elementary argument completely eluded us. We therefore use the method of "creative telescoping" to establish the result by induction on n. First, we notice that the announced results holds when n = s. Let us therefore assume n > s. We denote by T (n, k, s) the hairy term under the sum. It is a q-hypergeometric term because if we set X = q n and Y = q k , we see that the two following ratios are rational functions of X and Y :

We thus used the q-analog of Zeilberger's algorithm [START_REF] Wilf | An algorithmic proof theory for hypergeometric (ordinary and "q") multisum/integral identities[END_REF] (as implemented in Maple [START_REF] Monagan | Maple 10 Programming Guide[END_REF]), and it found the nice recurrence relation:

where: a = q n+1 + q n+s+1 -q s+1 b = q n+1 + q n+1+s -q s g(n, k, s) = q k -q s q k -1 q n+s+1 -q n+s+2 -q k+s + q n+k+1 + q n+k+s+1 q 2k (q n+1 -q k ) T (n, k, s)

The point is that summing ( ) over k = s, . . . , n -1 yields:

At this point, it is easy to find that g(n, s, s) = 0, and we check (using a computer algebra system!) that:

Thus, we have established that:

Thus, if the result holds at rank n, then it also holds at rank n + 1.

Proof (of lemma 5). The variance is:

We will first demonstrate by induction on n ≥ s that:

When n = s, we should have U n = q 2n , and looking at (♣) carefully reveals that our expression of U n simplifies to this value. Let us therefore assume n > s, and let us again denote by T (n, k, s) the hairy term under the sum. It is again a q-hypergeometric term, and running the q-analog of Zeilberger's algorithm yields:

where: a = -q n+s+2 + q s+1+2n + q 1+2n + q 2s+2 -q 2s+n+1 -q s+1+n -q 2s+2+n + q 2s+2n+1 + q s+2+2n b = -q 1+2n + q n+s -q s+1+2n + q s+1+n -q 2s + q 2s+n+1 + q 2s+n -q 2s+2n+1 -q s+2+2n

g is a complicated term with a singularity when n + 1 = k. We again notice that g(n, s, s) = 0 and that:

So that summing ( ) over k = s, . . . , n -1 and exploiting the previous equation yields:

By induction hypothesis, (♣) holds at rank n. Plugging the expression of U n into this recurrence relation and simplifying shows that (♣) holds at rank n + 1please use a computer algebra system if you really want to verify this. Moving back to the expression of V n , it is not difficult to verify that the result of the lemma holds.