Closed CluEleSsUK closed 12 months ago
Could you please describe what you've said in a few lines of code, to make it easier for me to understand?
To use the finalExponentiate, one must do:
const Fp12 = bls.fields.Fp12 as any;// as {finalExponentiate(num: any): any;};
const exp = Fp12.finalExponentiate(bls.fields.Fp12.mul(eGS, ePHm));
We identified that we could just pass a flag to the pairing operation like so: bls.pairing(S, G, true)
so this could probably be closed (unless others want to use the finalExponentiate
separately from pairing for some reason)
updated docs 6220534
In https://github.com/drand/drand-client we use the bls12-381 curve for verifying signatures created by our network. We have a custom scheme that creates signatures on G1 rather than G2, and thus far have been performing our own pairing operations as demonstrated here.
With the newest curves version, it appears that
finalExponentiate
is on the typeFp12Utils
here which is available on theCurveType
type, which gets passed into the bls constructor here. Unfortunately, as defines its ownfields
param, we can't use thefinalExponentiate
function directly, without casting toany
. Other types we could cast it to are private, but even then casting feels a little ugly.Is there another suggested way to use
finalExponentiate
directly or would it be possible to expose it?Thanks for all your hard work! Your libraries have saved us a lot of pain!