Skip to content

Commit

Permalink
Merge pull request #113 from keep-network/snark1-for-go-step3
Browse files Browse the repository at this point in the history
CurveSNARK1 exposed from mcl

After merging keep-network/go-dfinity-crypto#1 we update revision
constraint for go-dfinity-crypto to the newest one and switch the
Init curve to CurveSNARK1.
  • Loading branch information
Shadowfiend authored May 17, 2018
2 parents 8bc8089 + 8d24ea1 commit 8af1b3e
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 45 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ RUN apk add --update --no-cache \

FROM runtime AS cbuild

ENV BN_VERSION=d1a44d2f242692601b3e150b59044ab82f265b65
ENV BN_VERSION=1c96f7053ea1ebcdbe9f59ce46c79023ef6f8ba0

RUN apk add --update --no-cache \
clang \
Expand All @@ -28,7 +28,7 @@ RUN apk add --update --no-cache \
rm -rf /var/cache/apk && mkdir /var/cache/apk && \
rm -rf /usr/share/man

RUN git clone https://github.com/dfinity/bn /bn && \
RUN git clone https://github.com/keep-network/bn /bn && \
cd /bn && \
git reset --hard $BN_VERSION && \
make install && make && \
Expand Down
66 changes: 29 additions & 37 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

[[constraint]]
name = "github.com/dfinity/go-dfinity-crypto"
revision = "1db358303499a9879dd640c71f831897e06e9ddf"
revision = "1cfc23c8f712378febdf621f27e49dd67846e901"
source = "https://github.com/keep-network/go-dfinity-crypto.git"

[[constraint]]
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
)

func main() {
bls.Init(bls.CurveFp382_1)
bls.Init(bls.CurveSNARK1)

chainHandle := local.Connect()
chainCounter := chainHandle.BlockCounter()
Expand Down
6 changes: 3 additions & 3 deletions pkg/beacon/relay/dkg/dkg.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package dkg

import (
"fmt"
"math/rand"

"github.com/dfinity/go-dfinity-crypto/rand"
"github.com/keep-network/keep-core/pkg/chain"
"github.com/keep-network/keep-core/pkg/net"
"github.com/keep-network/keep-core/pkg/thresholdgroup"
Expand Down Expand Up @@ -34,10 +34,10 @@ func ExecuteDKG(
groupSize int,
threshold int,
) (*thresholdgroup.Member, error) {
// Generate a nonzero memberID; loop until rand.NewRand returns something
// Generate a nonzero memberID; loop until rand.Int31 returns something
// other than 0, hopefully no more than once :)
memberID := "0"
for memberID = rand.NewRand().String(); memberID == "0"; {
for memberID = fmt.Sprintf("%v", rand.Int31()); memberID == "0"; {
}
fmt.Printf("[member:%v] Initializing member.\n", memberID)
localMember := thresholdgroup.NewMember(memberID, threshold, groupSize)
Expand Down
2 changes: 1 addition & 1 deletion pkg/beacon/relay/dkg/marshaling_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

func TestMain(m *testing.M) {
bls.Init(bls.CurveFp382_1)
bls.Init(bls.CurveSNARK1)

os.Exit(m.Run())
}
Expand Down

0 comments on commit 8af1b3e

Please sign in to comment.