aboutsummaryrefslogtreecommitdiffstats
path: root/dagger.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-01-11 05:44:53 +0800
committerobscuren <geffobscura@gmail.com>2014-01-11 05:44:53 +0800
commit8bbf879cb31e9cb28700773ed788421f9935ac36 (patch)
treeea2ab662a0577aa6238b084eda7ec9644ee35995 /dagger.go
parentf6fa4f88797030b8e83066cb262a68958953974e (diff)
downloadgo-tangerine-8bbf879cb31e9cb28700773ed788421f9935ac36.tar
go-tangerine-8bbf879cb31e9cb28700773ed788421f9935ac36.tar.gz
go-tangerine-8bbf879cb31e9cb28700773ed788421f9935ac36.tar.bz2
go-tangerine-8bbf879cb31e9cb28700773ed788421f9935ac36.tar.lz
go-tangerine-8bbf879cb31e9cb28700773ed788421f9935ac36.tar.xz
go-tangerine-8bbf879cb31e9cb28700773ed788421f9935ac36.tar.zst
go-tangerine-8bbf879cb31e9cb28700773ed788421f9935ac36.zip
Moving the ethgo to individual packages
Diffstat (limited to 'dagger.go')
-rw-r--r--dagger.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/dagger.go b/dagger.go
index 2c1976840..5aa5dd755 100644
--- a/dagger.go
+++ b/dagger.go
@@ -6,6 +6,7 @@ import (
"time"
"github.com/obscuren/sha3"
"hash"
+ "github.com/ethereum/ethutil-go"
)
type Dagger struct {
@@ -40,7 +41,7 @@ func (dag *Dagger) Search(hash, diff *big.Int) *big.Int {
dag.hash = hash
- obj := BigPow(2, 256)
+ obj := ethutil.BigPow(2, 256)
obj = obj.Div(obj, diff)
Found = false
@@ -66,7 +67,7 @@ func DaggerVerify(hash, diff, nonce *big.Int) bool {
dagger := &Dagger{}
dagger.hash = hash
- obj := BigPow(2, 256)
+ obj := ethutil.BigPow(2, 256)
obj = obj.Div(obj, diff)
return dagger.Eval(nonce).Cmp(obj) < 0
@@ -114,7 +115,7 @@ func Sum(sha hash.Hash) []byte {
}
func (dag *Dagger) Eval(N *big.Int) *big.Int {
- pow := BigPow(2, 26)
+ pow := ethutil.BigPow(2, 26)
dag.xn = N.Div(N, pow)
sha := sha3.NewKeccak256()