Skip to content

Commit 620379d

Browse files
Merge pull request #11 from harmony-one/v2.0
use constants to remove Init delay
2 parents 8faa76a + bc4b34d commit 620379d

8 files changed

Lines changed: 12319 additions & 40 deletions

File tree

go.mod

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,7 @@ module github.com/harmony-one/vdf
22

33
go 1.12
44

5-
require github.com/stretchr/testify v1.3.0
5+
require (
6+
github.com/stretchr/testify v1.3.0
7+
golang.org/x/tools v0.0.0-20190924052046-3ac2a5bbd98a // indirect
8+
)

go.sum

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,11 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
55
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
66
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
77
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
8+
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
9+
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
10+
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
11+
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
12+
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
13+
golang.org/x/tools v0.0.0-20190924052046-3ac2a5bbd98a h1:DJzZ1GRmbjp7ihxzAN6UTVpVMi6k4CXZEr7A3wi2kRA=
14+
golang.org/x/tools v0.0.0-20190924052046-3ac2a5bbd98a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
15+
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=

src/test/discriminant_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ func TestEntropyFromSeed(t *testing.T) {
2424

2525
func TestDiscriminant(t *testing.T) {
2626
seed := []byte{0xab, 0xcd}
27-
vdf_go.Init()
2827
n := vdf_go.CreateDiscriminant(seed, 2048)
2928
s := fmt.Sprintf("%02x", vdf_go.EncodeBigIntBigEndian(n))
3029
assert.Equal(t, "ffff550d4074f264c4db9fb6c4af4e4a1aa6d700b3cf3601388d37aea312fc9b512581a8fa6f3575ae3d34c6b12401838da34360678a2f43178c43c96a46a2bd682db7fa63085c1a65053e738b158efdc4d952c549e6891d87d2de794132869bb5cefcf28193359f182358692be7b864413ee985893565046cc165994fb18f49ca75a8ec65ba1ef7450c53210943fde31c5c553f882b5fdadd8f3c1baa85309b68bd02ba526d8a1aabe5dc0aaa483d0fe230e5c6c6165d7d79184646e2909076b0eea3926a9b17f184b61588c90e5175e3a99ab343bb97859c0cde75a607a6e46a94f95580521f8ebaeeb58e587b39434a218dbcecc5cd365932926990c84c84fe29", s, "they should be equal")

src/test/square_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func TestTwoSquarePerformance(t *testing.T) {
3939
for k := 0; k < 10; k++ {
4040
seed := make([]byte, 32)
4141
rand.Read(seed)
42-
vdf_go.Init()
42+
4343
D := vdf_go.CreateDiscriminant(seed, 2048)
4444
x := vdf_go.NewClassGroupFromAbDiscriminant(big.NewInt(2), big.NewInt(1), D)
4545

src/test/vdf_module_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,5 @@ func TestVDFModuleRandomSeed(t *testing.T) {
7373

7474
assert.Equal(t, true, vdf.Verify(output), "failed verifying proof")
7575

76-
}
76+
}
77+

0 commit comments

Comments
 (0)