func (r *round1) Finalize(out chan<- *round.Message) (round.Session, error) {
	s_iBytes, err := r.s_i.MarshalBinary()
	if err != nil {
		return r, err
	}
	hashKey := make([]byte, 32)
	blake3.DeriveKey(deriveHashKeyContext, s_iBytes[:], hashKey)
	nonceHasher, _ := blake3.NewKeyed(hashKey)
	_, _ = nonceHasher.Write(r.Hash().Sum())
	_, _ = nonceHasher.Write(r.M)
	a := make([]byte, 32)
	_, _ = rand.Read(a)
	_, _ = nonceHasher.Write(a)
	nonceDigest := nonceHasher.Digest()
	d_i := sample.ScalarUnit(nonceDigest, r.Group())
	e_i := sample.ScalarUnit(nonceDigest, r.Group())
	D_i := d_i.ActOnBase()
	E_i := e_i.ActOnBase()
	err = r.BroadcastMessage(out, &broadcast2{D_i: D_i, E_i: E_i})
	if err != nil {
		return r, err
	}
	return &round2{
		round1: r,
		d_i:    d_i,
		e_i:    e_i,
		D:      map[party.ID]curve.Point{r.SelfID(): D_i},
		E:      map[party.ID]curve.Point{r.SelfID(): E_i},
	}, nil
}
Finalize implements round.Round.
package sign
import (
	"crypto/rand"
	"github.com/taurusgroup/multi-party-sig/internal/round"
	"github.com/taurusgroup/multi-party-sig/pkg/math/curve"
	"github.com/taurusgroup/multi-party-sig/pkg/math/sample"
	"github.com/taurusgroup/multi-party-sig/pkg/party"
	"github.com/zeebo/blake3"
)
type round1 struct {
	*round.Helper
	taproot bool
	M messageHash
	Y curve.Point
	YShares map[party.ID]curve.Point
	s_i curve.Scalar
}
func (r *round1) VerifyMessage(round.Message) error { return nil }
func (r *round1) StoreMessage(round.Message) error  { return nil }
const deriveHashKeyContext = "github.com/taurusgroup/multi-party-sig/frost 2021-07-30T09:48+00:00 Derive hash Key"