func CofactorMultiply(r, p *Ge25519) {
	var t1 ge25519p1p1
	var t2 Ge25519
	doubleP1p1(&t1, p)    
	p1p1ToFull(&t2, &t1)  
	doubleP1p1(&t1, &t2)  
	p1p1ToFull(&t2, &t1)  
	doubleP1p1(&t1, &t2)  
	p1p1ToFull(r, &t1)    
}
CofactorMultiply multiplies the full group element by the cofactor (8).
package ge25519
import (
	"bytes"
	"github.com/oasisprotocol/ed25519/internal/curve25519"
)
func geSub(r *ge25519p1p1, p *Ge25519, q *ge25519pniels) {
	var t0 curve25519.Bignum25519
	curve25519.Add(&r.x, &p.y, &p.x)
	curve25519.Sub(&r.y, &p.y, &p.x)
	curve25519.Mul(&r.z, &r.x, &q.ysubx)
	curve25519.Mul(&r.y, &r.y, &q.xaddy)
	curve25519.Mul(&r.t, &q.t2d, &p.t)
	curve25519.Mul(&r.x, &p.z, &q.z)
	curve25519.Add(&t0, &r.x, &r.x)
	curve25519.Sub(&r.x, &r.z, &r.y)
	curve25519.Add(&r.y, &r.z, &r.y)
	curve25519.SubAfterBasic(&r.z, &t0, &r.t)
	curve25519.AddAfterBasic(&r.t, &t0, &r.t)
}
func ProjectiveToExtended(r, p *Ge25519) {
	curve25519.Mul(&r.x, &p.x, &p.z)
	curve25519.Mul(&r.y, &p.y, &p.z)
	curve25519.Square(&r.z, &p.z)
	curve25519.Mul(&r.t, &p.x, &p.y)
}
func CofactorEqual(p, q *Ge25519) bool {
	var t1 ge25519pniels
	var t2 ge25519p1p1
	var t3 Ge25519
	fullToPniels(&t1, q)
	geSub(&t2, p, &t1)          
	p1p1ToFull(&t3, &t2)        
	CofactorMultiply(&t3, &t3)  
	return IsNeutralVartime(&t3)
}