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 5, 2024
1 parent fc022b1 commit 1c1c3ad
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 29 deletions.
8 changes: 4 additions & 4 deletions blssig/aggregation.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (
"github.com/filecoin-project/go-f3/internal/measurements"
"go.opentelemetry.io/otel/metric"

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

// Max size of the point cache.
Expand Down Expand Up @@ -121,7 +121,7 @@ func (v *Verifier) Aggregate(pubkeys []gpbft.PubKey) (_agg gpbft.Aggregate, _err
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,8 +4,8 @@ import (
"runtime"
"testing"

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

"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,9 +5,9 @@ import (
"context"
"errors"

"github.com/drand/kyber"
bls12381 "github.com/drand/kyber-bls12381"
"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"
"github.com/filecoin-project/go-f3/gpbft"
)

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,8 +4,8 @@ import (
"context"
"testing"

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

Expand Down
5 changes: 2 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ go 1.22

require (
github.com/Kubuxu/go-broadcast v0.0.0-20240621161059-1a8c90734cd6
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 @@ -21,6 +19,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-00010101000000-000000000000
go.opentelemetry.io/otel v1.28.0
go.opentelemetry.io/otel/metric v1.28.0
go.uber.org/multierr v1.11.0
Expand Down Expand Up @@ -144,4 +143,4 @@ require (
lukechampine.com/blake3 v1.2.1 // indirect
)

replace github.com/drand/kyber => github.com/Stebalien/kyber v1.3.2-0.20240827162216-c96a0e427578
replace go.dedis.ch/kyber/v4 => github.com/Stebalien/kyber/v4 v4.0.0-pre2.0.20240905225310-9acfb6fcce75
6 changes: 2 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGy
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/Kubuxu/go-broadcast v0.0.0-20240621161059-1a8c90734cd6 h1:yh2/1fz3ajTaeKskSWxtSBNScdRZfQ/A5nyd9+64T6M=
github.com/Kubuxu/go-broadcast v0.0.0-20240621161059-1a8c90734cd6/go.mod h1:5LOj/fF3Oc/cvJqzDiyfx4XwtBPRWUYEz+V+b13sH5U=
github.com/Stebalien/kyber v1.3.2-0.20240827162216-c96a0e427578 h1:dx1hCR7KbG1HbehvPPRJKExoI9COfy8eMg7sCidKJEs=
github.com/Stebalien/kyber v1.3.2-0.20240827162216-c96a0e427578/go.mod h1:f+mNHjiGT++CuueBrpeMhFNdKZAsy0tu03bKq9D5LPA=
github.com/Stebalien/kyber/v4 v4.0.0-pre2.0.20240905225310-9acfb6fcce75 h1:0SoYW75b+HfVy/bdgP8/gMWBNuUkiHsDpFuovFdRJfo=
github.com/Stebalien/kyber/v4 v4.0.0-pre2.0.20240905225310-9acfb6fcce75/go.mod h1:tg6jwKTYEjm94VxkFwiQy+ec9hoQvccIU989wNjXWVI=
github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1U3M=
github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY=
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c=
Expand Down Expand Up @@ -51,8 +51,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-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
6 changes: 3 additions & 3 deletions sim/signing/bls.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"errors"
"sync"

bls12381 "github.com/drand/kyber-bls12381"
"github.com/drand/kyber/pairing"
"github.com/drand/kyber/sign/bdn"
bls12381 "go.dedis.ch/kyber/v4/pairing/bls12381/kilic"
"go.dedis.ch/kyber/v4/pairing"
"go.dedis.ch/kyber/v4/sign/bdn"
"github.com/filecoin-project/go-f3/blssig"
"github.com/filecoin-project/go-f3/gpbft"
)
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,8 +5,8 @@ import (
"slices"
"testing"

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

0 comments on commit 1c1c3ad

Please sign in to comment.