diff --git a/blssig/aggregation.go b/blssig/aggregation.go index ea468305..22e5bc9a 100644 --- a/blssig/aggregation.go +++ b/blssig/aggregation.go @@ -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. @@ -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) } diff --git a/blssig/cache_test.go b/blssig/cache_test.go index 91d564f7..33eb651a 100644 --- a/blssig/cache_test.go +++ b/blssig/cache_test.go @@ -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" ) diff --git a/blssig/signer.go b/blssig/signer.go index 9c3cf6f8..f7618778 100644 --- a/blssig/signer.go +++ b/blssig/signer.go @@ -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) diff --git a/blssig/verifier.go b/blssig/verifier.go index ad6c746d..1dece32f 100644 --- a/blssig/verifier.go +++ b/blssig/verifier.go @@ -7,10 +7,9 @@ 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" @@ -18,7 +17,6 @@ import ( ) type Verifier struct { - suite pairing.Suite scheme *bdn.Scheme keyGroup kyber.Group @@ -29,7 +27,6 @@ type Verifier struct { func VerifierWithKeyOnG1() *Verifier { suite := bls12381.NewBLS12381Suite() return &Verifier{ - suite: suite, scheme: bdn.NewSchemeOnG2(suite), keyGroup: suite.G1(), } diff --git a/blssig/verifier_test.go b/blssig/verifier_test.go index bced0983..b1e4551a 100644 --- a/blssig/verifier_test.go +++ b/blssig/verifier_test.go @@ -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) { diff --git a/go.mod b/go.mod index 2dfe4150..4455239c 100644 --- a/go.mod +++ b/go.mod @@ -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 @@ -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 diff --git a/go.sum b/go.sum index 00790557..e9926b05 100644 --- a/go.sum +++ b/go.sum @@ -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= @@ -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= diff --git a/sim/signing/bls.go b/sim/signing/bls.go index e9a3878d..cf551897 100644 --- a/sim/signing/bls.go +++ b/sim/signing/bls.go @@ -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) diff --git a/test/signing_suite_test.go b/test/signing_suite_test.go index 95dd9cb9..b1a4e097 100644 --- a/test/signing_suite_test.go +++ b/test/signing_suite_test.go @@ -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 (