diff options
author | obscuren <geffobscura@gmail.com> | 2014-01-11 05:44:53 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-01-11 05:44:53 +0800 |
commit | 8bbf879cb31e9cb28700773ed788421f9935ac36 (patch) | |
tree | ea2ab662a0577aa6238b084eda7ec9644ee35995 /dagger.go | |
parent | f6fa4f88797030b8e83066cb262a68958953974e (diff) | |
download | go-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.go | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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() |