This PR is a work in progress to use gnark as a direct dependency (as much as possible) instead of using their tool to generate code.
A high-level summary is:
For our Fp we use gnark.bls12-381.Fr directly, with some extra helper methods. (Similar take to a previous attempt)
I created a Makefile rule to quickly regenerate our Fr, since there's no package in gnark for that. I regenerated the code with the latest (v0.11.0) gnark version, so we have the latest version for a field of these characteristics. With the new version of gnark, we can do make gen-fr and it will regenerate again.
Went a bit further and used gnark/ecc/bls12-381/bandersnatch package directly, with some extra helper methods. So, also using gnark for the curve.
I keep our in our Fp extra methods, our faster square root algorithm. This is important to allow banderwagon to deserialize points faster.
Generally, I make adjustments here and there to accommodate new APIs. I'll go in more detail in PR comments when opening, but nothing surprising.
This PR is a work in progress to use gnark as a direct dependency (as much as possible) instead of using their tool to generate code.
A high-level summary is:
gnark.bls12-381.Fr
directly, with some extra helper methods. (Similar take to a previous attempt)Makefile
rule to quickly regenerate our Fr, since there's no package in gnark for that. I regenerated the code with the latest (v0.11.0) gnark version, so we have the latest version for a field of these characteristics. With the new version of gnark, we can domake gen-fr
and it will regenerate again.gnark/ecc/bls12-381/bandersnatch
package directly, with some extra helper methods. So, also using gnark for the curve.banderwagon
to deserialize points faster.This is still a WIP.