opcodeSha256 treats the top item of the data stack as raw bytes and replaces it with sha256(data). Stack transformation: [... x1] -> [... sha256(x1)]
(op *opcode, data []byte, vm *Engine)
| 1904 | // |
| 1905 | // Stack transformation: [... x1] -> [... sha256(x1)] |
| 1906 | func opcodeSha256(op *opcode, data []byte, vm *Engine) error { |
| 1907 | buf, err := vm.dstack.PopByteArray() |
| 1908 | if err != nil { |
| 1909 | return err |
| 1910 | } |
| 1911 | |
| 1912 | hash := sha256.Sum256(buf) |
| 1913 | vm.dstack.PushByteArray(hash[:]) |
| 1914 | return nil |
| 1915 | } |
| 1916 | |
| 1917 | // opcodeHash160 treats the top item of the data stack as raw bytes and replaces |
| 1918 | // it with ripemd160(sha256(data)). |
nothing calls this directly
no test coverage detected
searching dependent graphs…