github.com/cloudflare/circl@v1.5.0/ecc/p384/p384_generic.go (about) 1 //go:build purego || (!amd64 && !arm64) 2 // +build purego !amd64,!arm64 3 4 package p384 5 6 import ( 7 "crypto/elliptic" 8 "math/big" 9 ) 10 11 type curve struct{ elliptic.Curve } 12 13 func P384() Curve { return curve{elliptic.P384()} } 14 15 // CombinedMult calculates P=mG+nQ, where G is the generator and Q=(x,y,z). 16 // The scalars m and n are integers in big-endian form. Non-constant time. 17 func (c curve) CombinedMult(xQ, yQ *big.Int, m, n []byte) (xP, yP *big.Int) { 18 x1, y1 := c.ScalarBaseMult(m) 19 x2, y2 := c.ScalarMult(xQ, yQ, n) 20 return c.Add(x1, y1, x2, y2) 21 }