diff --git a/sign/bls/bls.go b/sign/bls/bls.go index c32fd3d10..64e82cd70 100644 --- a/sign/bls/bls.go +++ b/sign/bls/bls.go @@ -83,7 +83,7 @@ func (s *scheme) Sign(private kyber.Scalar, msg []byte) ([]byte, error) { return sig, nil } -func (s *scheme) Verify(X kyber.Point, msg, sig []byte) error { +func (s *scheme) Verify(x kyber.Point, msg, sig []byte) error { hashable, ok := s.sigGroup.Point().(hashablePoint) if !ok { return errors.New("bls: point needs to implement hashablePoint") @@ -93,7 +93,7 @@ func (s *scheme) Verify(X kyber.Point, msg, sig []byte) error { if err := sigPoint.UnmarshalBinary(sig); err != nil { return err } - if !s.pairing(X, HM, sigPoint) { + if !s.pairing(x, HM, sigPoint) { return errors.New("bls: invalid signature") } return nil @@ -111,9 +111,9 @@ func (s *scheme) AggregateSignatures(sigs ...[]byte) ([]byte, error) { return sig.MarshalBinary() } -func (s *scheme) AggregatePublicKeys(Xs ...kyber.Point) kyber.Point { +func (s *scheme) AggregatePublicKeys(xs ...kyber.Point) kyber.Point { aggregated := s.keyGroup.Point() - for _, X := range Xs { + for _, X := range xs { aggregated.Add(aggregated, X) } return aggregated diff --git a/sign/bls/bls_test.go b/sign/bls/bls_test.go index ffa024edb..8dd736b5b 100644 --- a/sign/bls/bls_test.go +++ b/sign/bls/bls_test.go @@ -222,6 +222,7 @@ func BenchmarkBLSVerifyAggregate(b *testing.B) { sig2, err := scheme.Sign(private2, msg) require.Nil(b, err) sig, err := scheme.AggregateSignatures(sig1, sig2) + require.Nil(b, err) key := scheme.AggregatePublicKeys(public1, public2) b.ResetTimer() for i := 0; i < b.N; i++ { @@ -242,7 +243,7 @@ func BenchmarkBLSVerifyBatchVerify(b *testing.B) { private, public := scheme.NewKeyPair(random.New()) privates[i] = private publics[i] = public - msg := make([]byte, 64, 64) + msg := make([]byte, 64) _, err := rand.Read(msg) require.Nil(b, err) msgs[i] = msg diff --git a/sign/cosi/cosi_test.go b/sign/cosi/cosi_test.go index 6cabc4e43..e16500511 100644 --- a/sign/cosi/cosi_test.go +++ b/sign/cosi/cosi_test.go @@ -161,13 +161,9 @@ func TestMask(t *testing.T) { n := 17 // Generate key pairs - var kps []*key.Pair - var privates []kyber.Scalar var publics []kyber.Point for i := 0; i < n; i++ { kp := key.NewKeyPair(testSuite) - kps = append(kps, kp) - privates = append(privates, kp.Private) publics = append(publics, kp.Public) } diff --git a/sign/schnorr/schnorr.go b/sign/schnorr/schnorr.go index 130890df4..0c3723b83 100644 --- a/sign/schnorr/schnorr.go +++ b/sign/schnorr/schnorr.go @@ -28,25 +28,25 @@ type Suite interface { kyber.Random } -type SchnorrScheme struct { +type Scheme struct { s Suite } func NewScheme(s Suite) sign.Scheme { - return &SchnorrScheme{s} + return &Scheme{s} } -func (s *SchnorrScheme) NewKeyPair(random cipher.Stream) (kyber.Scalar, kyber.Point) { +func (s *Scheme) NewKeyPair(random cipher.Stream) (kyber.Scalar, kyber.Point) { priv := s.s.Scalar().Pick(random) pub := s.s.Point().Mul(priv, nil) return priv, pub } -func (s *SchnorrScheme) Sign(private kyber.Scalar, msg []byte) ([]byte, error) { +func (s *Scheme) Sign(private kyber.Scalar, msg []byte) ([]byte, error) { return Sign(s.s, private, msg) } -func (s *SchnorrScheme) Verify(public kyber.Point, msg, sig []byte) error { +func (s *Scheme) Verify(public kyber.Point, msg, sig []byte) error { return Verify(s.s, public, msg, sig) }