Skip to content

Commit

Permalink
Replace drand's kyber fork with upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
Stebalien committed Sep 23, 2024
1 parent d392bbf commit 4724fef
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 27 deletions.
6 changes: 3 additions & 3 deletions blssig/aggregation.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"github.com/filecoin-project/go-f3/internal/measurements"
"go.opentelemetry.io/otel/metric"

"github.com/drand/kyber"
"github.com/drand/kyber/sign"
"go.dedis.ch/kyber/v4"
"go.dedis.ch/kyber/v4/sign"
)

// Max size of the point cache.
Expand Down Expand Up @@ -103,7 +103,7 @@ func (v *Verifier) pubkeysToMask(pubkeys []gpbft.PubKey) (*sign.Mask, error) {
kPubkeys = append(kPubkeys, point.Clone())
}

mask, err := sign.NewMask(v.suite, kPubkeys, nil)
mask, err := sign.NewMask(kPubkeys, nil)
if err != nil {
return nil, fmt.Errorf("creating key mask: %w", err)
}
Expand Down
4 changes: 2 additions & 2 deletions blssig/cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"runtime"
"testing"

bls12381 "github.com/drand/kyber-bls12381"
"github.com/drand/kyber/sign/bdn"
"github.com/stretchr/testify/require"
bls12381 "go.dedis.ch/kyber/v4/pairing/bls12381/kilic"
"go.dedis.ch/kyber/v4/sign/bdn"

"github.com/filecoin-project/go-f3/gpbft"
)
Expand Down
6 changes: 3 additions & 3 deletions blssig/signer.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import (
"context"
"errors"

"github.com/drand/kyber"
bls12381 "github.com/drand/kyber-bls12381"
"github.com/drand/kyber/sign/bdn"
"github.com/filecoin-project/go-f3/gpbft"
"go.dedis.ch/kyber/v4"
bls12381 "go.dedis.ch/kyber/v4/pairing/bls12381/kilic"
"go.dedis.ch/kyber/v4/sign/bdn"
)

var _ gpbft.Signer = (*Signer)(nil)
Expand Down
9 changes: 3 additions & 6 deletions blssig/verifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,16 @@ import (
"runtime/debug"
"sync"

"github.com/drand/kyber"
bls12381 "github.com/drand/kyber-bls12381"
"github.com/drand/kyber/pairing"
"github.com/drand/kyber/sign/bdn"
"go.dedis.ch/kyber/v4"
bls12381 "go.dedis.ch/kyber/v4/pairing/bls12381/kilic"
"go.dedis.ch/kyber/v4/sign/bdn"
"go.opentelemetry.io/otel/metric"

"github.com/filecoin-project/go-f3/gpbft"
"github.com/filecoin-project/go-f3/internal/measurements"
)

type Verifier struct {
suite pairing.Suite
scheme *bdn.Scheme
keyGroup kyber.Group

Expand All @@ -29,7 +27,6 @@ type Verifier struct {
func VerifierWithKeyOnG1() *Verifier {
suite := bls12381.NewBLS12381Suite()
return &Verifier{
suite: suite,
scheme: bdn.NewSchemeOnG2(suite),
keyGroup: suite.G1(),
}
Expand Down
4 changes: 2 additions & 2 deletions blssig/verifier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"context"
"testing"

bls12381 "github.com/drand/kyber-bls12381"
"github.com/drand/kyber/sign/bdn"
"github.com/stretchr/testify/require"
bls12381 "go.dedis.ch/kyber/v4/pairing/bls12381/kilic"
"go.dedis.ch/kyber/v4/sign/bdn"
)

func BenchmarkBLSSigning(b *testing.B) {
Expand Down
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ module github.com/filecoin-project/go-f3
go 1.22

require (
github.com/drand/kyber v1.3.1
github.com/drand/kyber-bls12381 v0.3.1
github.com/filecoin-project/go-bitfield v0.2.4
github.com/filecoin-project/go-clock v0.1.0
github.com/filecoin-project/go-state-types v0.14.0
Expand All @@ -22,6 +20,7 @@ require (
github.com/stretchr/testify v1.9.0
github.com/urfave/cli/v2 v2.25.5
github.com/whyrusleeping/cbor-gen v0.1.1
go.dedis.ch/kyber/v4 v4.0.0-pre2.0.20240916105431-b283c0cdd30a
go.opentelemetry.io/otel v1.28.0
go.opentelemetry.io/otel/metric v1.28.0
go.uber.org/multierr v1.11.0
Expand Down
6 changes: 2 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3
github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=
github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/drand/kyber v1.3.1 h1:E0p6M3II+loMVwTlAp5zu4+GGZFNiRfq02qZxzw2T+Y=
github.com/drand/kyber v1.3.1/go.mod h1:f+mNHjiGT++CuueBrpeMhFNdKZAsy0tu03bKq9D5LPA=
github.com/drand/kyber-bls12381 v0.3.1 h1:KWb8l/zYTP5yrvKTgvhOrk2eNPscbMiUOIeWBnmUxGo=
github.com/drand/kyber-bls12381 v0.3.1/go.mod h1:H4y9bLPu7KZA/1efDg+jtJ7emKx+ro3PU7/jWUVt140=
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/elastic/gosigar v0.12.0/go.mod h1:iXRIGg2tLnu7LBdpqzyQfGDEidKCfWcCMS0WKyPWoMs=
github.com/elastic/gosigar v0.14.2 h1:Dg80n8cr90OZ7x+bAax/QjoW/XqTI11RmA79ZwIm9/4=
Expand Down Expand Up @@ -436,6 +432,8 @@ github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
go.dedis.ch/fixbuf v1.0.3 h1:hGcV9Cd/znUxlusJ64eAlExS+5cJDIyTyEG+otu5wQs=
go.dedis.ch/fixbuf v1.0.3/go.mod h1:yzJMt34Wa5xD37V5RTdmp38cz3QhMagdGoem9anUalw=
go.dedis.ch/kyber/v4 v4.0.0-pre2.0.20240916105431-b283c0cdd30a h1:FF9ZER1DSNuJWcpC/P9AJ9LpswxPxyyQ65YTOqdzDd0=
go.dedis.ch/kyber/v4 v4.0.0-pre2.0.20240916105431-b283c0cdd30a/go.mod h1:tg6jwKTYEjm94VxkFwiQy+ec9hoQvccIU989wNjXWVI=
go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA=
go.opentelemetry.io/otel v1.28.0 h1:/SqNcYk+idO0CxKEUOtKQClMK/MimZihKYMruSMViUo=
go.opentelemetry.io/otel v1.28.0/go.mod h1:q68ijF8Fc8CnMHKyzqL6akLO46ePnjkgfIMIjUIX9z4=
Expand Down
6 changes: 3 additions & 3 deletions sim/signing/bls.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import (
"errors"
"sync"

bls12381 "github.com/drand/kyber-bls12381"
"github.com/drand/kyber/pairing"
"github.com/drand/kyber/sign/bdn"
"github.com/filecoin-project/go-f3/blssig"
"github.com/filecoin-project/go-f3/gpbft"
"go.dedis.ch/kyber/v4/pairing"
bls12381 "go.dedis.ch/kyber/v4/pairing/bls12381/kilic"
"go.dedis.ch/kyber/v4/sign/bdn"
)

var _ Backend = (*BLSBackend)(nil)
Expand Down
4 changes: 2 additions & 2 deletions test/signing_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import (
"slices"
"testing"

bls12381 "github.com/drand/kyber-bls12381"
"github.com/drand/kyber/sign/bdn"
"github.com/filecoin-project/go-f3/blssig"
"github.com/filecoin-project/go-f3/gpbft"
"github.com/filecoin-project/go-f3/sim/signing"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
bls12381 "go.dedis.ch/kyber/v4/pairing/bls12381/kilic"
"go.dedis.ch/kyber/v4/sign/bdn"
)

type (
Expand Down

0 comments on commit 4724fef

Please sign in to comment.