ethcrypto => crypto
This commit is contained in:
+4
-4
@@ -3,7 +3,7 @@ package vm
|
||||
import (
|
||||
"math/big"
|
||||
|
||||
"github.com/ethereum/go-ethereum/ethcrypto"
|
||||
"github.com/ethereum/go-ethereum/crypto"
|
||||
"github.com/ethereum/go-ethereum/ethutil"
|
||||
)
|
||||
|
||||
@@ -27,16 +27,16 @@ var Precompiled = map[uint64]*PrecompiledAddress{
|
||||
}
|
||||
|
||||
func sha256Func(in []byte) []byte {
|
||||
return ethcrypto.Sha256(in)
|
||||
return crypto.Sha256(in)
|
||||
}
|
||||
|
||||
func ripemd160Func(in []byte) []byte {
|
||||
return ethutil.RightPadBytes(ethcrypto.Ripemd160(in), 32)
|
||||
return ethutil.RightPadBytes(crypto.Ripemd160(in), 32)
|
||||
}
|
||||
|
||||
func ecrecoverFunc(in []byte) []byte {
|
||||
// In case of an invalid sig. Defaults to return nil
|
||||
defer func() { recover() }()
|
||||
|
||||
return ethcrypto.Ecrecover(in)
|
||||
return crypto.Ecrecover(in)
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"math/big"
|
||||
|
||||
"github.com/ethereum/go-ethereum/ethcrypto"
|
||||
"github.com/ethereum/go-ethereum/crypto"
|
||||
"github.com/ethereum/go-ethereum/ethutil"
|
||||
)
|
||||
|
||||
@@ -391,7 +391,7 @@ func (self *Vm) RunClosure(closure *Closure) (ret []byte, err error) {
|
||||
case SHA3:
|
||||
require(2)
|
||||
size, offset := stack.Popn()
|
||||
data := ethcrypto.Sha3(mem.Get(offset.Int64(), size.Int64()))
|
||||
data := crypto.Sha3(mem.Get(offset.Int64(), size.Int64()))
|
||||
|
||||
stack.Push(ethutil.BigD(data))
|
||||
|
||||
@@ -627,7 +627,7 @@ func (self *Vm) RunClosure(closure *Closure) (ret []byte, err error) {
|
||||
)
|
||||
|
||||
// Generate a new address
|
||||
addr := ethcrypto.CreateAddress(closure.Address(), closure.object.Nonce)
|
||||
addr := crypto.CreateAddress(closure.Address(), closure.object.Nonce)
|
||||
closure.object.Nonce++
|
||||
|
||||
closure.UseGas(closure.Gas)
|
||||
|
||||
+3
-3
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"math/big"
|
||||
|
||||
"github.com/ethereum/go-ethereum/ethcrypto"
|
||||
"github.com/ethereum/go-ethereum/crypto"
|
||||
"github.com/ethereum/go-ethereum/ethstate"
|
||||
"github.com/ethereum/go-ethereum/ethutil"
|
||||
)
|
||||
@@ -519,7 +519,7 @@ func (self *DebugVm) RunClosure(closure *Closure) (ret []byte, err error) {
|
||||
// 0x20 range
|
||||
case SHA3:
|
||||
size, offset := stack.Popn()
|
||||
data := ethcrypto.Sha3(mem.Get(offset.Int64(), size.Int64()))
|
||||
data := crypto.Sha3(mem.Get(offset.Int64(), size.Int64()))
|
||||
|
||||
stack.Push(ethutil.BigD(data))
|
||||
|
||||
@@ -785,7 +785,7 @@ func (self *DebugVm) RunClosure(closure *Closure) (ret []byte, err error) {
|
||||
|
||||
// Generate a new address
|
||||
n := state.GetNonce(closure.Address())
|
||||
addr := ethcrypto.CreateAddress(closure.Address(), n)
|
||||
addr := crypto.CreateAddress(closure.Address(), n)
|
||||
state.SetNonce(closure.Address(), n+1)
|
||||
|
||||
self.Printf(" (*) %x", addr).Endl()
|
||||
|
||||
Reference in New Issue
Block a user