diff options
Diffstat (limited to 'core/vm/common.go')
-rw-r--r-- | core/vm/common.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/core/vm/common.go b/core/vm/common.go index 7702b2a86..6b8c4667b 100644 --- a/core/vm/common.go +++ b/core/vm/common.go @@ -24,7 +24,7 @@ import ( ) // calculates the memory size required for a step -func calcMemSize(off, l *big.Int) *big.Int { +func CalcMemSize(off, l *big.Int) *big.Int { if l.Sign() == 0 { return common.Big0 } @@ -34,7 +34,7 @@ func calcMemSize(off, l *big.Int) *big.Int { // getData returns a slice from the data based on the start and size and pads // up to size with zero's. This function is overflow safe. -func getData(data []byte, start uint64, size uint64) []byte { +func GetData(data []byte, start uint64, size uint64) []byte { length := uint64(len(data)) if start > length { start = length @@ -48,7 +48,7 @@ func getData(data []byte, start uint64, size uint64) []byte { // getDataBig returns a slice from the data based on the start and size and pads // up to size with zero's. This function is overflow safe. -func getDataBig(data []byte, start *big.Int, size *big.Int) []byte { +func GetDataBig(data []byte, start *big.Int, size *big.Int) []byte { dlen := big.NewInt(int64(len(data))) s := math.BigMin(start, dlen) @@ -58,12 +58,12 @@ func getDataBig(data []byte, start *big.Int, size *big.Int) []byte { // bigUint64 returns the integer casted to a uint64 and returns whether it // overflowed in the process. -func bigUint64(v *big.Int) (uint64, bool) { +func BigUint64(v *big.Int) (uint64, bool) { return v.Uint64(), v.BitLen() > 64 } // toWordSize returns the ceiled word size required for memory expansion. -func toWordSize(size uint64) uint64 { +func ToWordSize(size uint64) uint64 { if size > math.MaxUint64-31 { return math.MaxUint64/32 + 1 } @@ -71,7 +71,7 @@ func toWordSize(size uint64) uint64 { return (size + 31) / 32 } -func allZero(b []byte) bool { +func AllZero(b []byte) bool { for _, byte := range b { if byte != 0 { return false |