diff options
author | obscuren <geffobscura@gmail.com> | 2014-12-02 07:03:53 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-12-02 07:03:53 +0800 |
commit | 2df8ad6307d741d0a6d2f746d53f97c7b27ad796 (patch) | |
tree | 778c60ff0d3b9e8a69844ea131e5876a80cc0150 /vm/address.go | |
parent | a052357872217d5e99e7ee1a7a4b524b53addcdd (diff) | |
download | go-tangerine-2df8ad6307d741d0a6d2f746d53f97c7b27ad796.tar go-tangerine-2df8ad6307d741d0a6d2f746d53f97c7b27ad796.tar.gz go-tangerine-2df8ad6307d741d0a6d2f746d53f97c7b27ad796.tar.bz2 go-tangerine-2df8ad6307d741d0a6d2f746d53f97c7b27ad796.tar.lz go-tangerine-2df8ad6307d741d0a6d2f746d53f97c7b27ad796.tar.xz go-tangerine-2df8ad6307d741d0a6d2f746d53f97c7b27ad796.tar.zst go-tangerine-2df8ad6307d741d0a6d2f746d53f97c7b27ad796.zip |
Added state tests
Diffstat (limited to 'vm/address.go')
-rw-r--r-- | vm/address.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/vm/address.go b/vm/address.go index 235143b34..86ae705bc 100644 --- a/vm/address.go +++ b/vm/address.go @@ -31,12 +31,16 @@ func sha256Func(in []byte) []byte { } func ripemd160Func(in []byte) []byte { - return ethutil.RightPadBytes(crypto.Ripemd160(in), 32) + return ethutil.LeftPadBytes(crypto.Ripemd160(in), 32) } func ecrecoverFunc(in []byte) []byte { // In case of an invalid sig. Defaults to return nil defer func() { recover() }() - return crypto.Ecrecover(in) + hash := in[:32] + v := ethutil.BigD(in[32:64]).Bytes()[0] - 27 + sig := append(in[64:], v) + + return crypto.Sha3(crypto.Ecrecover(append(hash, sig...))[1:]) } |