func (Public) Domain() string {
	return "Public Data"
}
Domain implements hash.WriterToWithDomain.
package config
import (
	"errors"
	"fmt"
	"io"
	"math"
	"github.com/taurusgroup/multi-party-sig/internal/bip32"
	"github.com/taurusgroup/multi-party-sig/internal/params"
	"github.com/taurusgroup/multi-party-sig/internal/types"
	"github.com/taurusgroup/multi-party-sig/pkg/math/curve"
	"github.com/taurusgroup/multi-party-sig/pkg/math/polynomial"
	"github.com/taurusgroup/multi-party-sig/pkg/paillier"
	"github.com/taurusgroup/multi-party-sig/pkg/party"
	"github.com/taurusgroup/multi-party-sig/pkg/pedersen"
)
type Config struct {
	Group curve.Curve
	ID party.ID
	Threshold int
	ECDSA curve.Scalar
	ElGamal curve.Scalar
	Paillier *paillier.SecretKey
	RID types.RID
	ChainKey types.RID
	Public map[party.ID]*Public
}
type Public struct {
	ECDSA curve.Point
	ElGamal curve.Point
	Paillier *paillier.PublicKey
	Pedersen *pedersen.Parameters
}
func (c *Config) PublicPoint() curve.Point {
	sum := c.Group.NewPoint()
	partyIDs := make([]party.ID, 0, len(c.Public))
	for j := range c.Public {
		partyIDs = append(partyIDs, j)
	}
	l := polynomial.Lagrange(c.Group, partyIDs)
	for j, partyJ := range c.Public {
		sum = sum.Add(l[j].Act(partyJ.ECDSA))
	}
	return sum
}
func (c *Config) PartyIDs() party.IDSlice {
	ids := make([]party.ID, 0, len(c.Public))
	for j := range c.Public {
		ids = append(ids, j)
	}
	return party.NewIDSlice(ids)
}
func (c *Config) WriteTo(w io.Writer) (total int64, err error) {
	if c == nil {
		return 0, io.ErrUnexpectedEOF
	}
	var n int64
	n, err = types.ThresholdWrapper(c.Threshold).WriteTo(w)
	total += n
	if err != nil {
		return
	}
	partyIDs := c.PartyIDs()
	n, err = partyIDs.WriteTo(w)
	total += n
	if err != nil {
		return
	}
	n, err = c.RID.WriteTo(w)
	total += n
	if err != nil {
		return
	}
	for _, j := range partyIDs {
		n, err = c.Public[j].WriteTo(w)
		total += n
		if err != nil {
			return
		}
	}
	return
}
func (c *Config) Domain() string {
	return "CMP Config"
}