func (d Decommitment) WriteTo(w io.Writer) (int64, error) {
	if d == nil {
		return 0, io.ErrUnexpectedEOF
	}
	n, err := w.Write(d)
	return int64(n), err
}
WriteTo implements the io.WriterTo interface for Decommitment.
package hash
import (
	"bytes"
	"crypto/rand"
	"errors"
	"fmt"
	"io"
	"github.com/taurusgroup/multi-party-sig/internal/params"
)
type (
	Commitment   []byte
	Decommitment []byte
)
func (c Commitment) WriteTo(w io.Writer) (int64, error) {
	if c == nil {
		return 0, io.ErrUnexpectedEOF
	}
	n, err := w.Write(c)
	return int64(n), err
}
func (Commitment) Domain() string {
	return "Commitment"
}
func (c Commitment) Validate() error {
	if l := len(c); l != DigestLengthBytes {
		return fmt.Errorf("commitment: incorrect length (got %d, expected %d)", l, DigestLengthBytes)
	}
	for _, b := range c {
		if b != 0 {
			return nil
		}
	}
	return errors.New("commitment: commitment is 0")
}