You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The cost of the final exponentiation is dominated by Expt(), which is a square-and-multiply exponentiation by the curve seed u. Currently, the squarings are implemented as in the Granger-Scott cyclotomic squaring (GS).
For the curves implemented in gnark-crypto (except for BN254), there is a series of consecutive 0's in the seed and it might be interesting to switch to the Karabina cyclotomic squaring only of this series.
Karabina's method works on compressed GT elements and saves 2 multiplications in F_p^{k/d} compared to GS, where k is the embedding degree and d the twist degree. The cost of decompression, however, is dominated by an inverse in F_p^{k/d}.
Concretely, given a series of s 0's in the seed, the trick is worth it if:
For BLS12, 1 inverse over F_p costs less than 6*s-4 muls over F_p
For BLS24, 1 inverse over F_p costs less than 18*s-16 muls over F_p
The text was updated successfully, but these errors were encountered:
If there are more than one series of 0's for which Karabina's cyclotomic square is better, one can use a Montgomery batch inverse to decompress the results of both series at once. Concretely, this happens for BLS24-315 and yields significant speedup and for BLS12-381 but with minor speedup.
The cost of the final exponentiation is dominated by
Expt()
, which is a square-and-multiply exponentiation by the curve seedu
. Currently, the squarings are implemented as in the Granger-Scott cyclotomic squaring (GS).For the curves implemented in gnark-crypto (except for BN254), there is a series of consecutive 0's in the seed and it might be interesting to switch to the Karabina cyclotomic squaring only of this series.
Karabina's method works on compressed
GT
elements and saves 2 multiplications inF_p^{k/d}
compared to GS, wherek
is the embedding degree andd
the twist degree. The cost of decompression, however, is dominated by an inverse inF_p^{k/d}
.Concretely, given a series of
s
0's in the seed, the trick is worth it if:1
inverse overF_p
costs less than6*s-4
muls overF_p
1
inverse overF_p
costs less than18*s-16
muls overF_p
The text was updated successfully, but these errors were encountered: