Open Pratyush opened 5 years ago
Here is a ML in projective coordinates for SW6 curve: https://github.com/EYBlockchain/zk-swap-libff/blob/ey/libff/algebra/curves/sw6/sw6_pairing.cpp and for SW6_BIS (field size of 761 bits): https://github.com/EYBlockchain/zk-swap-libff/blob/ey/libff/algebra/curves/sw6_bis/sw6_bis_pairing.cpp
Awesome! Do you mind I port over the implementation to Rust? Is it under the MIT license?
Yes, it is MIT you can port it to Rust. I am working btw on porting SW6_BIS to Rust and do a PR here if you want.
Yes, that would be great!
Currently the Miller loop for SW6 uses affine coordinates, which makes the loop much slower than necessary. Moving to projective coordinates should speed up the loop significantly.
One can use the MNT6 miller loop code as a reference point to get this working. Indeed, a prior version of the SW6 ML code was basically a port of the MNT6 code, but it had incorrect constants, and so the pairing result was incorrect. This (incorrect) version was ~4x faster than the current (correct) version.