func CreateShares(nodes []pcmn.Node, secret big.Int, threshold int) (*[]pcmn.PrimaryShare, *[]common.Point, error) {
	polynomial := *generateRandomZeroPolynomial(secret, threshold)
	shares := getShares(polynomial, nodes)
	pubPoly := GetCommit(polynomial)
	return &shares, &pubPoly, nil
}
use this instead of CreateAndPrepareShares
package pvss
import (
	"crypto/ecdsa"
	"crypto/rand"
	"errors"
	"log"
	"math/big"
	"sort"
	ethCrypto "github.com/ethereum/go-ethereum/crypto"
	logging "github.com/sirupsen/logrus"
	"github.com/torusresearch/torus-common/common"
	"github.com/torusresearch/torus-common/secp256k1"
	pcmn "github.com/torusresearch/torus-node/common"
)
func RandomPoly(secret big.Int, threshold int) *pcmn.PrimaryPolynomial {
	return generateRandomZeroPolynomial(secret, threshold)
}
func RandomBigInt() *big.Int {
	randomInt, _ := rand.Int(rand.Reader, secp256k1.GeneratorOrder)
	return randomInt
}
func PolyEval(polynomial pcmn.PrimaryPolynomial, x big.Int) *big.Int {
	return polyEval(polynomial, int(x.Int64()))
}
func polyEval(polynomial pcmn.PrimaryPolynomial, x int) *big.Int {  
	xi := big.NewInt(int64(x))
	sum := new(big.Int)
	sum.Add(sum, &polynomial.Coeff[0])
	for i := 1; i < polynomial.Threshold; i++ {
		tmp := new(big.Int).Mul(xi, &polynomial.Coeff[i])
		sum.Add(sum, tmp)
		sum.Mod(sum, secp256k1.GeneratorOrder)
		xi.Mul(xi, big.NewInt(int64(x)))
		xi.Mod(xi, secp256k1.GeneratorOrder)
	}
	return sum
}
func getShares(polynomial pcmn.PrimaryPolynomial, nodes []pcmn.Node) []pcmn.PrimaryShare {
	shares := make([]pcmn.PrimaryShare, len(nodes))
	for i, node := range nodes {
		shares[i] = pcmn.PrimaryShare{Index: node.Index, Value: *polyEval(polynomial, node.Index)}
	}
	return shares
}
func GetCommit(polynomial pcmn.PrimaryPolynomial) []common.Point {
	commits := make([]common.Point, polynomial.Threshold)
	for i := range commits {
		commits[i] = common.BigIntToPoint(secp256k1.Curve.ScalarBaseMult(polynomial.Coeff[i].Bytes()))
	}
	return commits
}
func AddCommitments(commitments ...[]common.Point) (sumCommit []common.Point) {
	for i := range commitments[0] {
		var sumPt common.Point
		for _, commitment := range commitments {
			sumPt = common.BigIntToPoint(secp256k1.Curve.Add(&sumPt.X, &sumPt.Y, &commitment[i].X, &commitment[i].Y))
		}
		sumCommit = append(sumCommit, sumPt)
	}
	return
}
func AddPolynomials(poly1 pcmn.PrimaryPolynomial, poly2 pcmn.PrimaryPolynomial) *pcmn.PrimaryPolynomial {
	var sumPoly []big.Int
	if poly1.Threshold != poly2.Threshold {
		logging.Error("thresholds of two polynomials are not equal")
		return &pcmn.PrimaryPolynomial{Coeff: sumPoly, Threshold: 0}
	}
	if len(poly1.Coeff) != len(poly2.Coeff) {
		logging.Error("order of two polynomials are not equal")
		return &pcmn.PrimaryPolynomial{Coeff: sumPoly, Threshold: 0}
	}
	for i := range poly1.Coeff {
		tmpCoeff := new(big.Int).Add(&poly1.Coeff[i], &poly2.Coeff[i])
		sumPoly = append(sumPoly, *new(big.Int).Mod(tmpCoeff, secp256k1.GeneratorOrder))
	}
	return &pcmn.PrimaryPolynomial{Coeff: sumPoly, Threshold: poly1.Threshold}
}
func generateRandomZeroPolynomial(secret big.Int, threshold int) *pcmn.PrimaryPolynomial {
	coeff := make([]big.Int, threshold)
	coeff[0] = secret                 
	for i := 1; i < threshold; i++ {  
		coeff[i] = *RandomBigInt()
	}
	return &pcmn.PrimaryPolynomial{Coeff: coeff, Threshold: threshold}
}
func Signcrypt(recipientPubKey common.Point, data []byte, privKey big.Int) (*pcmn.Signcryption, error) {
	r := RandomBigInt()
	rG := common.BigIntToPoint(secp256k1.Curve.ScalarBaseMult(r.Bytes()))
	rU := common.BigIntToPoint(secp256k1.Curve.ScalarMult(&recipientPubKey.X, &recipientPubKey.Y, r.Bytes()))
	ciphertext, err := AESencrypt(rU.X.Bytes(), data)
	if err != nil {
		return nil, err
	}
	cb := data
	cb = append(cb[:], rG.X.Bytes()...)
	hashed := secp256k1.Keccak256(cb)
	h := new(big.Int).SetBytes(hashed)
	h.Mod(h, secp256k1.GeneratorOrder)
	szecret := new(big.Int)
	temp := new(big.Int)
	temp.Mul(h, r)
	temp.Mod(temp, secp256k1.GeneratorOrder)
	szecret.Sub(&privKey, temp)
	szecret.Mod(szecret, secp256k1.GeneratorOrder)
	return &pcmn.Signcryption{Ciphertext: *ciphertext, R: rG, Signature: *szecret}, nil
}
func bytes32(bytes []byte) [32]byte {
	tmp := [32]byte{}
	copy(tmp[:], bytes)
	return tmp
}
func ECDSASignBytes(b []byte, privKey *big.Int) []byte {
	return ECDSASign(string(b), privKey)
}
func ECDSASign(s string, privKey *big.Int) []byte {
	pubKey := common.BigIntToPoint(secp256k1.Curve.ScalarBaseMult(privKey.Bytes()))
	ecdsaPrivKey := &ecdsa.PrivateKey{
		PublicKey: ecdsa.PublicKey{
			Curve: secp256k1.Curve,
			X:     &pubKey.X,
			Y:     &pubKey.Y,
		},
		D: privKey,
	}
	hashRaw := secp256k1.Keccak256([]byte(s))
	signature, err := ethCrypto.Sign(hashRaw, ecdsaPrivKey)
	if err != nil {
		log.Fatal(err)
	}
	return signature
}
func ECDSAVerify(str string, pubKey *common.Point, signature []byte) bool {
	r := new(big.Int)
	s := new(big.Int)
	r.SetBytes(signature[:32])
	s.SetBytes(signature[32:64])
	ecdsaPubKey := &ecdsa.PublicKey{
		Curve: secp256k1.Curve,
		X:     &(*pubKey).X,
		Y:     &(*pubKey).Y,
	}
	return ecdsa.Verify(
		ecdsaPubKey,
		secp256k1.Keccak256([]byte(str)),
		r,
		s,
	)
}
func ECDSAVerifyBytes(b []byte, pubKey *common.Point, signature []byte) bool {
	return ECDSAVerify(string(b), pubKey, signature)
}
func UnSignCrypt(signcryption pcmn.Signcryption, privKey big.Int, senderPubKey common.Point) (*[]byte, error) {
	xR := common.BigIntToPoint(secp256k1.Curve.ScalarMult(&signcryption.R.X, &signcryption.R.Y, privKey.Bytes()))
	M, err := AESdecrypt(xR.X.Bytes(), signcryption.Ciphertext)
	if err != nil {
		return nil, err
	}
	cb := []byte(*M)
	cb = append(cb[:], signcryption.R.X.Bytes()...)
	hashed := secp256k1.Keccak256(cb)
	h := new(big.Int).SetBytes(hashed)
	h.Mod(h, secp256k1.GeneratorOrder)
	sG := common.BigIntToPoint(secp256k1.Curve.ScalarBaseMult(signcryption.Signature.Bytes()))
	hR := common.BigIntToPoint(secp256k1.Curve.ScalarMult(&signcryption.R.X, &signcryption.R.Y, h.Bytes()))
	testsenderPubKey := common.BigIntToPoint(secp256k1.Curve.Add(&sG.X, &sG.Y, &hR.X, &hR.Y))
	if senderPubKey.X.Cmp(&testsenderPubKey.X) != 0 {
		logging.WithFields(logging.Fields{
			"sign":             senderPubKey.X.Cmp(&testsenderPubKey.X),
			"senderPubKey":     senderPubKey,
			"testsenderPubKey": testsenderPubKey,
		}).Debug()
		return nil, errors.New("sending node PK does not register with signcryption unsigncrypt")
	}
	return M, nil
}
func signcryptShare(nodePubKey common.Point, share big.Int, privKey big.Int) (*pcmn.Signcryption, error) {
	r := RandomBigInt()
	rG := common.BigIntToPoint(secp256k1.Curve.ScalarBaseMult(r.Bytes()))
	rU := common.BigIntToPoint(secp256k1.Curve.ScalarMult(&nodePubKey.X, &nodePubKey.Y, r.Bytes()))
	ciphertext, err := AESencrypt(rU.X.Bytes(), share.Bytes())
	if err != nil {
		return nil, err
	}
	cb := share.Bytes()
	cb = append(cb[:], rG.X.Bytes()...)
	hashed := secp256k1.Keccak256(cb)
	h := new(big.Int).SetBytes(hashed)
	h.Mod(h, secp256k1.GeneratorOrder)
	szecret := new(big.Int)
	temp := new(big.Int)
	temp.Mul(h, r)
	temp.Mod(temp, secp256k1.GeneratorOrder)
	szecret.Sub(&privKey, temp)
	szecret.Mod(szecret, secp256k1.GeneratorOrder)
	return &pcmn.Signcryption{Ciphertext: *ciphertext, R: rG, Signature: *szecret}, nil
}
func batchSigncryptShare(nodeList []pcmn.Node, shares []pcmn.PrimaryShare, privKey big.Int) ([]*pcmn.SigncryptedOutput, error) {
	signcryptedShares := make([]*pcmn.SigncryptedOutput, len(nodeList))
	for i := range nodeList {
		temp, err := signcryptShare(nodeList[i].PubKey, shares[i].Value, privKey)
		if err != nil {
			return nil, err
		}
		signcryptedShares[i] = &pcmn.SigncryptedOutput{NodePubKey: nodeList[i].PubKey, NodeIndex: shares[i].Index, SigncryptedShare: *temp}
	}
	return signcryptedShares, nil
}