diff --git a/tss/key/reshare/update_round3.go b/tss/key/reshare/update_round3.go index 00727af..b71c0b4 100644 --- a/tss/key/reshare/update_round3.go +++ b/tss/key/reshare/update_round3.go @@ -59,6 +59,10 @@ func (info *RefreshInfo) DKGStep3(msgs []*tss.Message) (*tss.KeyStep3Data, error xi.Y = new(big.Int).Add(xi.Y, content.Share.Y) ujPoint := verifiers[msg.From][0] + // filter 0*G + if ujPoint.X.Cmp(big.NewInt(0)) == 0 || ujPoint.Y.Cmp(big.NewInt(0)) == 0 { + continue + } point, err := curves.NewECPoint(curve, ujPoint.X, ujPoint.Y) if err != nil { return nil, err @@ -74,6 +78,9 @@ func (info *RefreshInfo) DKGStep3(msgs []*tss.Message) (*tss.KeyStep3Data, error v[j] = curves.ScalarToPoint(curve, big.NewInt(0)) for _, verifier := range verifiers { + if !verifier[j].IsOnCurve() { + continue + } v[j], err = v[j].Add(verifier[j]) if err != nil { return nil, err diff --git a/tss/key/reshare/update_round_test.go b/tss/key/reshare/update_round_test.go index fcfbcc3..9dada0e 100644 --- a/tss/key/reshare/update_round_test.go +++ b/tss/key/reshare/update_round_test.go @@ -3,14 +3,15 @@ package reshare import ( "crypto/elliptic" "fmt" - "github.com/decred/dcrd/dcrec/edwards/v2" + "github.com/decred/dcrd/dcrec/secp256k1/v2" "github.com/okx/threshold-lib/tss" "github.com/okx/threshold-lib/tss/key/dkg" "testing" ) func TestRefresh(t *testing.T) { - curve := edwards.Edwards() + // curve := edwards.Edwards() + curve := secp256k1.S256() p1Data, p2Data, p3Data := KeyGen(curve) // Reset private key share by 1, 3 devoteList := [2]int{1, 3}