Commit e59e5644 authored by yann300's avatar yann300

extract sha3 input

parent 72e1b875
......@@ -212,8 +212,13 @@ function getSha3Input (stack, memory) {
memoryStart = parseInt(memStartDec) * 2
var memLengthDec = (new ethutil.BN(memoryLength.replace('0x', ''), 16).toString(10))
memoryLength = parseInt(memLengthDec) * 2
var memoryHex = memory.join('')
var sha3Input = memoryHex.substr(memoryStart, memoryLength)
var subMemoryIndex = Math.floor(memoryStart / 32)
var sha3Input = ''
while (sha3Input.length < memoryLength) {
sha3Input += memory[subMemoryIndex]
subMemoryIndex++
}
return sha3Input
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment