func (p *p256) ScalarMult(a *p256, n *big.Int) *p256 {
	if a.IsZero() {
		return p.SetInfinity()
	}
	cmp := n.Cmp(big.NewInt(0))
	if cmp == 0 {
		return p.SetInfinity()
	}
	n = Mod(n, CURVE.N)
	bn := n.Bytes()
	resx, resy := CURVE.ScalarMult(a.X, a.Y, bn)
	p.X = resx
	p.Y = resy
	return p
}
/*
ScalarMul encapsulates the scalar Multiplication Algorithm from secp256k1.
package zkproofs
import (
	"bytes"
	"crypto/sha256"
	"errors"
	"math/big"
	"strconv"
	"../byteconversion"
	"github.com/ethereum/go-ethereum/crypto/secp256k1"
)
var (
	CURVE = secp256k1.S256()
	GX    = CURVE.Gx
	GY    = CURVE.Gy
)
type p256 struct {
	X, Y *big.Int
}
type PedersenCommitment = p256
func (p *p256) IsZero() bool {
	c1 := (p.X == nil || p.Y == nil)
	if !c1 {
		z := new(big.Int).SetInt64(0)
		return p.X.Cmp(z) == 0 && p.Y.Cmp(z) == 0
	}
	return true
}
func (p *p256) Neg(a *p256) *p256 {
	if a.IsZero() {
		return p.SetInfinity()
	}
	one := new(big.Int).SetInt64(1)
	mone := new(big.Int).Sub(CURVE.N, one)
	p.ScalarMult(p, mone)
	return p
}
func (p *p256) Add(a, b *p256) *p256 {
	if a.IsZero() {
		p.X = b.X
		p.Y = b.Y
		return p
	} else if b.IsZero() {
		p.X = b.X
		p.Y = b.Y
		return p
	}
	if a.X.Cmp(b.X) == 0 {
		p.X = new(big.Int)
		p.Y = new(big.Int)
		return p
	}
	resx, resy := CURVE.Add(a.X, a.Y, b.X, b.Y)
	p.X = resx
	p.Y = resy
	return p
}
func (p *p256) Double(a *p256) *p256 {
	if a.IsZero() {
		return p.SetInfinity()
	}
	resx, resy := CURVE.Double(a.X, a.Y)
	p.X = resx
	p.Y = resy
	return p
}