From 843de689dda393f932a63b04ccb117a17ebcbf6f Mon Sep 17 00:00:00 2001 From: Sun Xia Date: Thu, 18 Apr 2024 16:04:39 +0800 Subject: [PATCH] check whether the threshold and size of vs is equal (#291) * use *common.SignatureData instead of common.SignatureData to fix issue #163 * upgrade dependencies version * check the threshold and size of vs is equal * fix bug --- crypto/vss/feldman_vss.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/vss/feldman_vss.go b/crypto/vss/feldman_vss.go index 74d549dc..347af09c 100644 --- a/crypto/vss/feldman_vss.go +++ b/crypto/vss/feldman_vss.go @@ -93,7 +93,7 @@ func Create(ec elliptic.Curve, threshold int, secret *big.Int, indexes []*big.In } func (share *Share) Verify(ec elliptic.Curve, threshold int, vs Vs) bool { - if share.Threshold != threshold || vs == nil { + if share.Threshold != threshold || vs == nil || len(vs) != threshold+1 { return false } var err error