diff options
| author | Nicholas Rodrigues Lordello <[email protected]> | 2025-08-01 14:49:14 +0200 |
|---|---|---|
| committer | Nicholas Rodrigues Lordello <[email protected]> | 2025-08-01 14:49:14 +0200 |
| commit | 89f936fff830cd245d47fb5fb6e109c56216c7af (patch) | |
| tree | 966252ee41c40c721d8918701bc0728d92101f25 /lib/pairing.mli | |
| parent | 08c921a5ca703233185e9021d8cc50b620d08a39 (diff) | |
Batched Pairing Computation
We batch pairing computations for efficient checking. This allows to
more efficiently implement things like BLS signatures (where we check
that some pairing dot another is equal to 1). This is because the
exponentiation in Fp12 is a _huge_ computational effort (and what takes
the most time in the pairing computation).
It looks like `@noble/curves` implements a pairing to another `Gt` that
is much more efficient to compute (as we do not need to untwist
coordinates at all, meaning no field inversion, and no computations in
Fp12), but I will hold off on implementing this until there is an actual
need for it (in case the current pairing implementation is too slow).
Diffstat (limited to 'lib/pairing.mli')
| -rw-r--r-- | lib/pairing.mli | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/pairing.mli b/lib/pairing.mli index a76343d..3d63df6 100644 --- a/lib/pairing.mli +++ b/lib/pairing.mli @@ -40,10 +40,9 @@ module Gt : sig end end -val e' : G1.t -> G2.t -> Fields.Fp12.t -(** [e p q] is the elliptic curve pairing of [p] and [q] without final - exponentiation. This is useful when you only want to compare pairings, - without actually mapping them to [Gt]. *) - val e : G1.t -> G2.t -> Gt.t (** [e p q] is the elliptic curve pairing of [p] and [q]. *) + +val check : (G1.t * G2.t) list -> bool +(** [check pairs] checks whether the product of the pairings is equal to + [Gt.id]. *) |
