From a42fbf4f1e3a294987c09d2bd305d970073efd2c Mon Sep 17 00:00:00 2001 From: bytemare <3641580+bytemare@users.noreply.github.com> Date: Mon, 7 Oct 2024 16:00:11 +0200 Subject: [PATCH] remove unreachable code Signed-off-by: bytemare <3641580+bytemare@users.noreply.github.com> --- coordinator.go | 11 ++--------- encoding.go | 2 +- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/coordinator.go b/coordinator.go index 7ad9aa3..f0c8588 100644 --- a/coordinator.go +++ b/coordinator.go @@ -41,8 +41,8 @@ func (s *Signature) Clear() { // The coordinator should verify this signature using the group public key before publishing or releasing the signature. // This aggregate signature will verify if and only if all signature shares are valid. If an invalid share is identified // a reasonable approach is to remove the signer from the set of allowed participants in future runs of FROST. If verify -// is set to true, AggregateSignatures will automatically verify the signature shares and the output signature, and will -// return an error with the first encountered invalid signature share. +// is set to true, AggregateSignatures will automatically verify the signature shares, and will return an error on the +// first encountered invalid signature share func (c *Configuration) AggregateSignatures( message []byte, sigShares []*SignatureShare, @@ -75,13 +75,6 @@ func (c *Configuration) AggregateSignatures( return nil, err } - // Verify the final signature. Failure is unlikely to happen, as the signature is valid if the signature shares are. - if verify { - if err = VerifySignature(c.Ciphersuite, message, signature, c.GroupPublicKey); err != nil { - return nil, err - } - } - return signature, nil } diff --git a/encoding.go b/encoding.go index 0f04951..8b7c420 100644 --- a/encoding.go +++ b/encoding.go @@ -755,7 +755,7 @@ func (s *signatureShadow) init(g ecc.Group) { func unmarshalJSON(data []byte, target shadowInit) error { g, err := encoding.JSONReGetGroup(string(data)) if err != nil { - return err + return fmt.Errorf("%w", err) } target.init(g)