func (s *NYMSigner) Sign(message []byte) ([]byte, error) {
	rand, err := s.Curve.Rand()
	if err != nil {
		return nil, err
	}
	skRandomness := s.Curve.NewRandomZr(rand)
	bfRandomness := s.Curve.NewRandomZr(rand)
	com := s.NYMParams[0].Mul(skRandomness)
	com.Add(s.NYMParams[1].Mul(bfRandomness))
	sig := &NYMSig{}
	sig.Challenge = s.Curve.HashToZr(append(message, GetG1Array(s.NYMParams, []*math.G1{s.NYM, com}).Bytes()...))
	sig.SK = s.Curve.ModMul(sig.Challenge, s.SK, s.Curve.GroupOrder)
	sig.SK = s.Curve.ModAdd(sig.SK, skRandomness, s.Curve.GroupOrder)
	sig.BF = s.Curve.ModMul(sig.Challenge, s.BF, s.Curve.GroupOrder)
	sig.BF = s.Curve.ModAdd(sig.BF, bfRandomness, s.Curve.GroupOrder)
	bytes, err := sig.Serialize()
	if err != nil {
		return nil, errors.Errorf("failed to serialized nym signature")
	}
	return bytes, nil
}
sign message anonymously using Schnorr signature
package common
import (
	"encoding/json"
	"github.com/IBM/mathlib"
	"github.com/pkg/errors"
)
type NYMSigner struct {
	*NYMVerifier
	SK *math.Zr
	BF *math.Zr
}
func (s *NYMSigner) Serialize() ([]byte, error) {
	return s.NYMVerifier.Serialize()
}