func (e *Engine) AddPairInv(g1 *PointG1, g2 *PointG2) *Engine {
	ng1 := e.G1.New().Set(g1)
	e.G1.Neg(ng1, g1)
	e.AddPair(ng1, g2)
	return e
}
AddPairInv adds a G1, G2 point pair to pairing engine. G1 point is negated.
package bls12381
type pair struct {
	g1 *PointG1
	g2 *PointG2
}
func newPair(g1 *PointG1, g2 *PointG2) pair {
	return pair{g1, g2}
}
type Engine struct {
	G1   *G1
	G2   *G2
	fp12 *fp12
	fp2  *fp2
	pairingEngineTemp
	pairs []pair
}
func NewEngine() *Engine {
	fp2 := newFp2()
	fp6 := newFp6(fp2)
	fp12 := newFp12(fp6)
	g1 := NewG1()
	g2 := newG2(fp2)
	return &Engine{
		fp2:               fp2,
		fp12:              fp12,
		G1:                g1,
		G2:                g2,
		pairingEngineTemp: newEngineTemp(),
	}
}
type pairingEngineTemp struct {
	t2  [9]*fe2
	t12 [3]fe12
}
func newEngineTemp() pairingEngineTemp {
	t2 := [9]*fe2{}
	for i := 0; i < len(t2); i++ {
		t2[i] = &fe2{}
	}
	t12 := [3]fe12{}
	return pairingEngineTemp{t2, t12}
}
func (e *Engine) AddPair(g1 *PointG1, g2 *PointG2) *Engine {
	p := newPair(g1, g2)
	if !(e.G1.IsZero(p.g1) || e.G2.IsZero(p.g2)) {
		e.G1.Affine(p.g1)
		e.G2.Affine(p.g2)
		e.pairs = append(e.pairs, p)
	}
	return e
}