We instantiate the
By now, both instantiations work with the same number of field elements
According to the recommendations by Grassi, et al., we choose
$$
\begin{align*}
R_F &= 8 &&\text{(including 2 rounds security margin)},
\
R_p &= 57 &&\text{(including
We describe the primitive
-
the two input elements
$x_0$ ,$x_1$ are loaded additively to the (initialized) internal state$\vec s = (s_0,s_1,s_2)$ , i.e. $$ (s_0,s_1,s_2) \leftarrow (s_0,s_1,s_2)+ (x_0,x_1,0), $$ -
then the
$POSEIDON_{\pi}$ random permutation is applied to$(s_0,s_1,s_2)$ , consisting of $$ \begin{align*} R_f &=R_F/2 = 4 &&\text{full rounds} \ R_p &= 57 & &\text{partial rounds, and another} \ R_f &=R_F/2 = 4 &&\text{full rounds}, \end{align*} $$ see the pics below. -
The output
$PH_F(x_0,x_1)$ is the most ''outer'' element$s_0'$ of the internal state$(s_0',s_1',s_2')$ .
Domain extension for hashing further pairs of input
The round dependent vector of round constants
$$
\vec c_0,\vec c_1, \ldots, \vec c_{R_F + R_p-1} \in F^3
$$
are derived via a linear recursion, an 80 bit Grain LFSR, which is initialized by encoding (or hashing) our context (i.e., the base field
For efficiency reasons, our
-
public
$\vec s=(s_0,s_1,s_2)$ from$F^3$ for the initial internal state, -
public variables
$x_1$ ,$x_2\in F$ as input to be hashed, -
public variables
$\vec s'=(s_0',s_1',s_2')$ from$F^3$ for the internal state after applying the$POSEIDON_\pi$ , where$s_0'\in F$ is the output of the hash, -
private witnesses
$(w_{k,1},w_{k,2},w_{k,3})\in F^3$ , where$k=0,2,\ldots,R_F+R_p$ for the internal wires of each of the rounds. -
enforces $$ \vec w_0 = \vec s + (x_0,x_1,0)+ c_0, $$
$$ \begin{align*} \vec w_k &= PHRf(k,\vec w_{k-1}) & k&=1,\ldots,R_f, \ \vec w_k &= PHRp(k,\vec w_{k-1}) & k&=R_f+1,\ldots, R_f+R_p, \ \vec w_k &= PHRf(k,\vec w_{k-1}) & k&=R_f+R_p+1, \ldots, 2\cdot R_f+R_p-1, \end{align*} $$
and finally $$ \vec s' = PHRf(2\cdot R_f+ R_p,\vec w_{2\cdot R_f+R_p}), $$ where the vector of round constants in the latter is set to
$(0,0,0)$ .
The circuit is as described by Grassi, et al., where S-Box, Mix-Layer, and Add-Round-Constant are merged into a (shifted) round.
-
public variables
$x$ and$y$ from$F$ , -
private witness
$b$ from$F$ . -
enforces $$ \begin{align} 0 &= b\cdot (1-b), \ b &= x\cdot y, \ 0 &= (1-b)\cdot (x-y). \end{align} $$
In these constraints,
-
public index to address the round constants
$c_{k,1}, c_{k,2}, c_{k,3}$ . -
public variable
$x_1,x_2,x_3$ , and$y_1,y_2,y_3$ from$F$ , -
enforces $$ y_i = c_{k,i} + \sum_{j=1}^3 m_{i,j}\cdot SBox(x_j), \quad i=1,2,3 $$
-
public index
$k$ to address the round constants$c_{k,1}, c_{k,2}, c_{k,3}$ . -
public variable
$x_1,x_2,x_3$ , and$y_1,y_2,y_3$ from$F$ , -
enforces $$ \begin{align} y_i &= c_{k,i} + \sum_{j=1}^2 m_{i,j}\cdot x_j + m_{i,3}\cdot SBox(x_3), & i=1,2,3 \end{align} $$
Basically the number
- classical differential (Biham, Shamer 1991, 1993), linear (Matsui, 1993) and truncated differential (Knudsen, 1994) cryptanalysis,
- rebound attacks (Lamberger, et al. 2009, Mendel, et al., 2009),
- Multiple-of-$n$ and mixed differential cryptanalysis (Grassi, et al., 2017),
- Invariant subspace attack (Leander, et al., 2011),
- Integral/Square attack (Damen, et al., 1997).
We follow the recommendations of Grassi, et al. and choose
Once the number of full rounds
For both instantiations (over