Skip to content

Commit

Permalink
Merge pull request #11 from harmony-one/v2.0
Browse files Browse the repository at this point in the history
use constants to remove Init delay
  • Loading branch information
coolcottontail authored Sep 24, 2019
2 parents 8faa76a + bc4b34d commit 620379d
Show file tree
Hide file tree
Showing 8 changed files with 12,319 additions and 40 deletions.
5 changes: 4 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@ module github.com/harmony-one/vdf

go 1.12

require github.com/stretchr/testify v1.3.0
require (
github.com/stretchr/testify v1.3.0
golang.org/x/tools v0.0.0-20190924052046-3ac2a5bbd98a // indirect
)
8 changes: 8 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,11 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/tools v0.0.0-20190924052046-3ac2a5bbd98a h1:DJzZ1GRmbjp7ihxzAN6UTVpVMi6k4CXZEr7A3wi2kRA=
golang.org/x/tools v0.0.0-20190924052046-3ac2a5bbd98a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
1 change: 0 additions & 1 deletion src/test/discriminant_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ func TestEntropyFromSeed(t *testing.T) {

func TestDiscriminant(t *testing.T) {
seed := []byte{0xab, 0xcd}
vdf_go.Init()
n := vdf_go.CreateDiscriminant(seed, 2048)
s := fmt.Sprintf("%02x", vdf_go.EncodeBigIntBigEndian(n))
assert.Equal(t, "ffff550d4074f264c4db9fb6c4af4e4a1aa6d700b3cf3601388d37aea312fc9b512581a8fa6f3575ae3d34c6b12401838da34360678a2f43178c43c96a46a2bd682db7fa63085c1a65053e738b158efdc4d952c549e6891d87d2de794132869bb5cefcf28193359f182358692be7b864413ee985893565046cc165994fb18f49ca75a8ec65ba1ef7450c53210943fde31c5c553f882b5fdadd8f3c1baa85309b68bd02ba526d8a1aabe5dc0aaa483d0fe230e5c6c6165d7d79184646e2909076b0eea3926a9b17f184b61588c90e5175e3a99ab343bb97859c0cde75a607a6e46a94f95580521f8ebaeeb58e587b39434a218dbcecc5cd365932926990c84c84fe29", s, "they should be equal")
Expand Down
2 changes: 1 addition & 1 deletion src/test/square_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func TestTwoSquarePerformance(t *testing.T) {
for k := 0; k < 10; k++ {
seed := make([]byte, 32)
rand.Read(seed)
vdf_go.Init()

D := vdf_go.CreateDiscriminant(seed, 2048)
x := vdf_go.NewClassGroupFromAbDiscriminant(big.NewInt(2), big.NewInt(1), D)

Expand Down
3 changes: 2 additions & 1 deletion src/test/vdf_module_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,5 @@ func TestVDFModuleRandomSeed(t *testing.T) {

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

}
}

Loading

0 comments on commit 620379d

Please sign in to comment.