diff options
author | Taylor Gerring <taylor.gerring@gmail.com> | 2015-01-21 03:22:38 +0800 |
---|---|---|
committer | Taylor Gerring <taylor.gerring@gmail.com> | 2015-01-21 03:22:38 +0800 |
commit | d92fde698031758f64fcabe7af354360a93f6326 (patch) | |
tree | 5f843fe17762e0aa87a0e790d527886f2cc8eea5 /pow/ar/ops.go | |
parent | 499bc404e818848e53c8c7f4f6d1bfe2349e97ae (diff) | |
parent | 87f50659db7a4bf194769b05f541d2ccf02f4fc8 (diff) | |
download | dexon-d92fde698031758f64fcabe7af354360a93f6326.tar dexon-d92fde698031758f64fcabe7af354360a93f6326.tar.gz dexon-d92fde698031758f64fcabe7af354360a93f6326.tar.bz2 dexon-d92fde698031758f64fcabe7af354360a93f6326.tar.lz dexon-d92fde698031758f64fcabe7af354360a93f6326.tar.xz dexon-d92fde698031758f64fcabe7af354360a93f6326.tar.zst dexon-d92fde698031758f64fcabe7af354360a93f6326.zip |
Merge branch 'develop' into jsonrpc
Diffstat (limited to 'pow/ar/ops.go')
-rw-r--r-- | pow/ar/ops.go | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/pow/ar/ops.go b/pow/ar/ops.go deleted file mode 100644 index 3a099be08..000000000 --- a/pow/ar/ops.go +++ /dev/null @@ -1,54 +0,0 @@ -package ar - -import "math/big" - -const lenops int64 = 9 - -type OpsFunc func(a, b *big.Int) *big.Int - -var ops [lenops]OpsFunc - -func init() { - ops[0] = Add - ops[1] = Mul - ops[2] = Mod - ops[3] = Xor - ops[4] = And - ops[5] = Or - ops[6] = Sub1 - ops[7] = XorSub - ops[8] = Rsh -} - -func Add(x, y *big.Int) *big.Int { - return new(big.Int).Add(x, y) -} -func Mul(x, y *big.Int) *big.Int { - return new(big.Int).Mul(x, y) -} -func Mod(x, y *big.Int) *big.Int { - return new(big.Int).Mod(x, y) -} -func Xor(x, y *big.Int) *big.Int { - return new(big.Int).Xor(x, y) -} -func And(x, y *big.Int) *big.Int { - return new(big.Int).And(x, y) -} -func Or(x, y *big.Int) *big.Int { - return new(big.Int).Or(x, y) -} -func Sub1(x, y *big.Int) *big.Int { - a := big.NewInt(-1) - a.Sub(a, x) - - return a -} -func XorSub(x, y *big.Int) *big.Int { - t := Sub1(x, nil) - - return t.Xor(t, y) -} -func Rsh(x, y *big.Int) *big.Int { - return new(big.Int).Rsh(x, uint(y.Uint64()%64)) -} |