diff --git a/SGXWalletServer.cpp b/SGXWalletServer.cpp index f00725ee..c3d8644c 100644 --- a/SGXWalletServer.cpp +++ b/SGXWalletServer.cpp @@ -316,9 +316,6 @@ SGXWalletServer::blsSignMessageHashImpl(const string &_keyShareName, const strin if (hashTmp[0] == '0' && (hashTmp[1] == 'x' || hashTmp[1] == 'X')) { hashTmp.erase(hashTmp.begin(), hashTmp.begin() + 2); } - while (hashTmp[0] == '0') { - hashTmp.erase(hashTmp.begin(), hashTmp.begin() + 1); - } if (!checkHex(hashTmp)) { throw SGXException(INVALID_BLS_HEX, string(__FUNCTION__) + ":Invalid bls hex"); @@ -327,7 +324,7 @@ SGXWalletServer::blsSignMessageHashImpl(const string &_keyShareName, const strin value = readFromDb(_keyShareName); - if (!bls_sign(value->c_str(), _messageHash.c_str(), t, n, signature.data())) { + if (!bls_sign(value->c_str(), hashTmp.c_str(), t, n, signature.data())) { throw SGXException(COULD_NOT_BLS_SIGN, ":Could not bls sign data "); }