Problem: A new algebraic hash function
(Proposer: Jordi Baylina)
Can you find a collision for the following hash function?
Let ; this number is prime.
Our hash function is defined as follows.
is built as a composition of 30 “rounds”. Each “round” is a function . To compute :
- pad the input with four 0’s to form ;
- apply the round functions in succession; and
- return the first four entries of the output vector.
Of the 30 rounds, the first 4 and last 4 rounds are “full rounds”. The 22 intermediate rounds are “partial rounds”.
Each full round takes an input vector , and:
- adds a constant vector to (the vector is different in each round)
- raises each entry of to the 7th power
- applies a linear transformation (i.e. a 12-by-12 matrix ) to (the vector is the same in each round).
A partial round is the same as a full round, except that the second step only raises the first entry of to the 7th power: .
Motivation and discussion
We want hash functions that can be evaluated efficiently inside a STARK. This means the function should be made of algebraic operations in the field , where is the prime mentioned above.
The Poseidon hash function is a SNARK-friendly algebraic hash function, but it is designed for a prime field with .
For collision-resistance, we need the hash values to be at least bits. Working over a 64-bit field, this means the hash should output 4 field elements, rather than 1.
This new hash function, like Poseidon, is composed of a succession of “rounds”, each a composition of a linear function with a low-degree polynomial nonlinearity.