https://zkhack.dev/events/puzzle1.html
WINDOW_SIZE = 1;NUM_WINDOWS = 256
, CRH will generate Points according to the rng
. Let's use present them.There are messages:
Let use represent the Matrix, use represent Vectors:
and if we have a new message , we can get it's signature by
I think it would be dangerous to
The problem is that when hash to curve, first hash to field then , will be dangerous.
Even though we know how to do it, there are still difficulties. In Rust, there are almost no libraries that can find the inverse of a matrix whose elements are in a finite field. I tried two linear algebra libraries, but they directly returned f32. In Sage, when multiplying a matrix by a vector, the data types of the matrix and vector are not allowed to be inconsistent:
So, we need use sage to find out the , then use Rust to get the vector and calculate the signature by
we first used the sage code here to print the matrix's inverse(a_inv
), then we need copy the a_inv
's values to rust code and finish the solution.
Whole code: https://github.com/flyq/zkhack-bls-pedersen