phoreproject / bls

Go implementation of the BLS12-381 pairing
Apache License 2.0
89 stars 31 forks source link

add CompareTwoPairings #14

Closed herumi closed 4 years ago

herumi commented 4 years ago

The Verify function computes e(P1, Q1) == e(P2, Q2) where e is pairing. But Pairing(P, Q) = FE(ML(P, Q)) where ML is MillerLoop and FE is FinalExponentiation. e(P1, Q1) == e(P2, Q2) <=> e(P1, Q1) e(-P2, Q2) == 1 <=> FE(ML(P1, Q1) ML(P2, Q2)) == 1 then I added CompareTwoPairings, which can reduce one FE. I got the following speed on Core i7-7700 3.6GHz:

meyer9 commented 4 years ago

Thank you for the contribution! Merged.