From 45807bff5ee93a291222d86d0670d6c4e096f153 Mon Sep 17 00:00:00 2001 From: CJentzsch Date: Fri, 12 Dec 2014 21:45:10 +0100 Subject: [PATCH] set first 12 bytes to zero in ecrecover --- libethereum/State.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libethereum/State.cpp b/libethereum/State.cpp index bd5c770cf..30290c315 100644 --- a/libethereum/State.cpp +++ b/libethereum/State.cpp @@ -67,7 +67,7 @@ bytes ecrecoverCode(bytesConstRef _in) secp256k1_start(); if (secp256k1_ecdsa_recover_compact(in.hash.data(), 32, in.r.data(), pubkey, &pubkeylen, 0, (int)(u256)in.v - 27)) ret = dev::sha3(bytesConstRef(&(pubkey[1]), 64)); - + memset(ret.data(), 0, 12); return ret.asBytes(); }