A Full-Round Collision in Poseidon

Authors

QED

Category

Deep Dive

Published

September 14, 2026

A Full-Round Collision in Poseidon

Anthropic’s HAWK post showed that LLMs can do actual cryptanalysis research. Since then, we have been exploring LLM-based cryptanalysis across a range of targets.

With ChatGPT Pro, we constructed a full 28-round collision for the Poseidon Cryptanalysis Initiative’s Poseidon1 Collision challenge. Two distinct messages with the required prefix produce identical 16-word outputs under the challenge’s reference implementation.

The challenge

In this challenge, the Poseidon function operates over the prime field Fp\mathbb F_p, where p=231−224+1p=2^{31}-2^{24}+1, with a 16-word state in Fp16\mathbb F_p^{16}. Its 28 rounds consist of four full rounds, twenty partial rounds, and four more full rounds.

Poseidon's 28-round pipeline: four full rounds, twenty partial rounds, and four full rounds.

If xrx_r is the state entering round rr, then

xr+1=MSr(xr+c(r)),x_{r+1}=M S_r\left(x_r+c^{(r)}\right),

where c(r)c^{(r)} is the public round constant and SrS_r is the full or partial S-box layer.

A full-round S-box layer cubes every coordinate, whereas a partial-round layer cubes only coordinate 0.

Write PMP_M for the complete 28-round permutation. The challenge uses feed-forward compression:

HM(X)=PM(X)+X.H_M(X)=P_M(X)+X.

The full-collision goal is to find two distinct inputs X+X^+ and X−X^- such that

X0+=X0−=0xc09de4,HM(X+)=HM(X−).X_0^+=X_0^-=\texttt{0xc09de4}, \qquad H_M(X^+)=H_M(X^-).

The challenge allowed submitters to choose the MDS matrix MM. We designed the collision first and the matrix second: we constructed two state trajectories that collide, then solved for the linear map MM that realizes them.

Decoupling midpoint and difference

Let xr+x_r^+ and xr−x_r^- be the two states entering round rr, with x0+=X+x_0^+=X^+ and x0−=X−x_0^-=X^-. Define their midpoint mrm_r and half-difference drd_r by

mr=xr++xr−2,dr=xr+−xr−2.m_r=\frac{x_r^++x_r^-}{2}, \qquad d_r=\frac{x_r^+-x_r^-}{2}.

Equivalently, xr+=mr+drx_r^+=m_r+d_r and xr−=mr−drx_r^-=m_r-d_r.

If the permutation ends with

m28=0,d28=−d0,m_{28}=0, \qquad d_{28}=-d_0,

then PM(X+)=−d0P_M(X^+)=-d_0 and PM(X−)=d0P_M(X^-)=d_0. Feed-forward gives

HM(X+)=m0+d0−d0=m0,HM(X−)=m0−d0+d0=m0,H_M(X^+)=m_0+d_0-d_0=m_0, \qquad H_M(X^-)=m_0-d_0+d_0=m_0,

so HM(X+)=HM(X−)H_M(X^+)=H_M(X^-).

Our construction uses two mechanisms:

  1. reset the midpoint to zero;

  2. keep control of the half-difference and return it with the opposite sign.

Together, these two mechanisms give 16 linear constraints on the same matrix MM: 14 from the midpoint reset and 2 from controlling the half-difference. These 16 constraints uniquely determine MM.

Mechanism 1: Resetting the midpoint

The first key intuition is to constrain MM so that the midpoint (mrm_r) at every even round entry becomes zero. This is possible because the cubic S-box is odd: if its two inputs are exact opposites, its outputs are also exact opposites, so their midpoint is zero.

After adding c(r)c^{(r)}, the midpoint immediately before the first S-box is sr=mr+c(r)s_r=m_r+c^{(r)}. Let the midpoint after that S-box be

ur=Sr(sr+dr)+Sr(sr−dr)2.u_r=\frac{S_r(s_r+d_r)+S_r(s_r-d_r)}{2}.

If the matrix satisfies

Mur=−c(r+1),Mu_r=-c^{(r+1)},

then the midpoint after MM is −c(r+1)-c^{(r+1)}. Adding c(r+1)c^{(r+1)} turns it into 00.

The second S-box therefore sees exact opposites. Cubing preserves that relation, and multiplying by MM preserves it again, so the block ends with

mr+2=0.m_{r+2}=0.

There are fourteen two-round blocks, so the reset eventually gives fourteen requirements

Mu0=−c(1),Mu2=−c(3),…,Mu26=−c(27).Mu_0=-c^{(1)},\quad Mu_2=-c^{(3)},\quad \ldots,\quad Mu_{26}=-c^{(27)}.

At this point, these are only requirements. The vectors uru_r depend on the half-differences entering the blocks, so they cannot be computed until the difference has been designed. We therefore leave the matrix aside and determine the half-differences first.

Mechanism 2: Keeping the difference on one coordinate

We force the half-difference at every even-round boundary to be nonzero only in coordinate 1:

dr=βre,e=(0,1,0,…,0),d_r=\beta_r e, \qquad e=(0,1,0,\ldots,0),

where βr\beta_r is the scalar amplitude of the half-difference.

During the twenty partial rounds, we keep the even-round half-difference equal to −ae-ae for one nonzero field element aa. The key is to arrange the twenty partial rounds so that the same two-round differential pattern can be repeated throughout.

Choose a vector v=(v0,…,v15)v=(v_0,\ldots,v_{15}) with

vi∈{a−1,−a−1}(i=1,…,15),v_i\in\{a^{-1},-a^{-1}\}\qquad(i=1,\ldots,15),

while v0v_0 remains free. Let ww be the vector determined by what the second partial S-box does when the midpoint is zero:

−av→partial S-box−aw.-av\xrightarrow{\text{partial S-box}}-aw.

This mechanism contributes exactly two constraints on MM:

Me=v,Mw=e.Me=v,\qquad Mw=e.

The same two constraints will be reused in every pair of partial rounds.

Now we can see the pattern of half-difference during one pair of partial rounds:

−ae→partial S-box−ae→M−av→partial S-box−aw→M−ae.\boxed{ -ae \xrightarrow{\text{partial S-box}} -ae \xrightarrow{M} -av \xrightarrow{\text{partial S-box}} -aw \xrightarrow{M} -ae. }

The full two-round blocks work similarly. The half-difference remains on coordinate 1, but its amplitude changes.

Building the trajectories

mrm_r and drd_r determine xr+,xr−x_r^{+}, x_r^{-}, and we already know m2=m4=⋯=m28=0m_2 =m_4 = \cdots =m_{28} = 0 and drd_r is determined by βr\beta_r. Therefore, we will build the solution by fixing βr\beta_r.

First, choose a nonzero field element aa at random and set β4=β6=⋯=β24=−a\beta_4=\beta_6=\cdots=\beta_{24}=-a. We can show that once aa is chosen, β26\beta_{26} and β28\beta_{28} are already fixed as well. Also, feed-forward requires the initial amplitude to be the negative of the final one, so

β0=−β28.\beta_0=-\beta_{28}.

We then solve for the amplitude immediately before the partial rounds. For the block covering rounds 2 and 3, the following relation must hold:

β23+3((c(2))1)2β2=−a.\beta_2^3 +3\left((c^{(2)})_1\right)^2\beta_2 =-a.

A root in Fp\mathbb F_p gives β2\beta_2. Finally, the first block has both endpoint amplitudes determined, β0\beta_0 and β2\beta_2. Its equation determines the required coordinate-1 value of the initial midpoint m0m_0.

The resulting sequence is shown below.

The amplitude trace crosses the opening full rounds, remains at minus a through all partial rounds, and closes with beta 28 equal to minus beta 0.

If one of the required root conditions fails, we try another aa. The remaining coordinates of m0m_0, the active coordinate v0v_0, and the passive signs of vv are still available when constructing the matrix.

Constructing the matrix

Now all conditions are known. At even rounds 2,…,262,\ldots,26, the midpoint is zero, and every half-difference is the known value βre\beta_r e. Together with the selected initial midpoint, this determines the midpoint immediately after the first S-box in every block.

The fourteen midpoint requirements and the two difference requirements are

Mur=−c(r+1)(r=0,2,…,26),Me=v,Mw=e.Mu_r=-c^{(r+1)} \quad (r=0,2,\ldots,26), \qquad Me=v, \qquad Mw=e.

Collect their sixteen source vectors and targets as the columns of two 16×1616\times16 matrices:

U=[ u0∣u2∣⋯∣u26∣e∣w ],U=\left[\,u_0\mid u_2\mid\cdots\mid u_{26}\mid e\mid w\,\right], V=[ −c(1)∣−c(3)∣⋯∣−c(27)∣v∣e ].V=\left[\,-c^{(1)}\mid-c^{(3)}\mid\cdots\mid-c^{(27)}\mid v\mid e\,\right].

The first fourteen columns encode the midpoint resets, while the last two encode difference control.

The sixteen source and target columns combine fourteen midpoint resets and two difference constraints to determine the matrix M.

All requirements are contained in MU=VMU=V. If UU is invertible, exactly one matrix satisfies them:

M=VU−1.M=VU^{-1}.

Note: MM is not automatically MDS (equivalently, every square submatrix is nonsingular), nor is it guaranteed to pass the linear-layer checks. Those properties are filters. When we experimented with random aa, more than 30% of attempts produced a valid trajectory (that is, the equations had a solution) and an MDS matrix that passed the Initiative’s checks.

Verification

We verified that the witness passes the Initiative’s verifier, and independently checked that MM is MDS. The GitHub repository contains the matrix, both inputs, and the verification code.

The construction relies on choosing MM. After reviewing this class of custom-matrix submissions, the Poseidon Group said that these submissions were outside the intended scope of the main bounty. They nevertheless described the submissions as highlighting a previously unexplored attack vector and offered us a special US$10,000 ex gratia payment.

What the construction shows

This is a failure mode of adaptive parameter selection. The round constants are not individually weak, and the matrix passes the required matrix-level checks. The collision comes from their correlation: the matrix was constructed as a function of the already specified round constants.

This does not apply when the matrix is specified, as in deployed Poseidon instances. A related parameter-selection viewpoint appeared independently in Slipway through a different Poseidon attack mechanism.

Takeaway

Since then, we have kept working on cryptanalysis using LLMs and found several meaningful results: Witness Encryption Scheme Based on Affine Determinant Programs, a major witness-encryption candidate, and A Key-Recovery Attack on TALUS v4, a candidate for the NIST post-quantum threshold call.

Cryptography broadly is moving fast right now. The McEliece cryptosystem, unbroken for nearly 50 years, is now under real cryptanalytic pressure. A claimed polynomial-time quantum algorithm for the Dihedral Coset Problem, which would have broken the lattice assumptions behind ML-KEM and ML-DSA, was soon refuted. Three independent teams found new attacks on Poseidon within weeks of each other.

At the same time, AI-assisted research is making SHA/BLAKE proving much faster, as Flock and the SNARK.fast challenge demonstrate. Justin Drake announced Ethereum’s planned move from Poseidon to SHA/BLAKE at L1. With LLMs, more efficient cryptography will emerge and will be contested super hard, and only the safe ones will survive.