public static GT Pairing(G1 x, G2 y) { var res = new GT(); res.SetPairingOf(x, y); return(res); }
public static GT MillerLoop(G1 x, G2 y) { unsafe { GT res; MclBls12381.Imports.MclBnMillerLoop.Value(&res, &x, &y); return(res); } }
public void SetPairingOf(G1 x, G2 y) { unsafe { fixed(GT *ptr = &this) { MclBls12381.Imports.MclBnPairing.Value(ptr, &x, &y); } } }
public static G1 EvaluatePolynomial(G1[] poly, Fr at) { unsafe { var res = new G1(); fixed(G1 *cVec = poly) Imports.MclBnG1EvaluatePolynomial.Value(&res, cVec, (ulong)poly.Length, &at); return(res); } }
public static G1 LagrangeInterpolate(Fr[] xs, G1[] ys) { if (xs.Length != ys.Length) { throw new ArgumentException("arrays are unequal length"); } unsafe { var res = new G1(); fixed(Fr *xVec = xs) fixed(G1 * yVec = ys) Imports.MclBnG1LagrangeInterpolation.Value(&res, xVec, yVec, (ulong)xs.Length); return(res); } }