Unverified Commit 301f585f authored by Oleh Nikolaiev's avatar Oleh Nikolaiev Committed by GitHub

Merge branch 'develop' into bug/fix-0x-bls-sign

parents 5d8506fa 513ec71a
...@@ -982,7 +982,7 @@ SGXWalletServer::createBLSPrivateKeyV2Impl(const string &_blsKeyName, const stri ...@@ -982,7 +982,7 @@ SGXWalletServer::createBLSPrivateKeyV2Impl(const string &_blsKeyName, const stri
RETURN_SUCCESS(result); RETURN_SUCCESS(result);
} }
Json::Value SGXWalletServer::getDecryptionShareImpl(const std::string& blsKeyName, const std::string& publicDecryptionValue) { Json::Value SGXWalletServer::getDecryptionSharesImpl(const std::string& blsKeyName, const Json::Value& publicDecryptionValues) {
spdlog::info("Entering {}", __FUNCTION__); spdlog::info("Entering {}", __FUNCTION__);
INIT_RESULT(result) INIT_RESULT(result)
...@@ -991,6 +991,13 @@ Json::Value SGXWalletServer::getDecryptionShareImpl(const std::string& blsKeyNam ...@@ -991,6 +991,13 @@ Json::Value SGXWalletServer::getDecryptionShareImpl(const std::string& blsKeyNam
throw SGXException(BLS_SIGN_INVALID_KS_NAME, string(__FUNCTION__) + ":Invalid BLSKey name"); throw SGXException(BLS_SIGN_INVALID_KS_NAME, string(__FUNCTION__) + ":Invalid BLSKey name");
} }
if (!publicDecryptionValues.isArray()) {
throw SGXException(INVALID_DECRYPTION_VALUE_FORMAT,
string(__FUNCTION__) + ":Public decryption values should be an array");
}
for (int i = 0; i < publicDecryptionValues.size(); ++i) {
std::string publicDecryptionValue = publicDecryptionValues[i].asString();
if ( publicDecryptionValue.length() < 7 || publicDecryptionValue.length() > 78 * 4 ) { if ( publicDecryptionValue.length() < 7 || publicDecryptionValue.length() > 78 * 4 ) {
throw SGXException(INVALID_DECRYPTION_VALUE_FORMAT, string(__FUNCTION__) + ":Invalid publicDecryptionValue format"); throw SGXException(INVALID_DECRYPTION_VALUE_FORMAT, string(__FUNCTION__) + ":Invalid publicDecryptionValue format");
} }
...@@ -998,8 +1005,9 @@ Json::Value SGXWalletServer::getDecryptionShareImpl(const std::string& blsKeyNam ...@@ -998,8 +1005,9 @@ Json::Value SGXWalletServer::getDecryptionShareImpl(const std::string& blsKeyNam
shared_ptr<string> encryptedKeyHex_ptr = readFromDb(blsKeyName); shared_ptr<string> encryptedKeyHex_ptr = readFromDb(blsKeyName);
vector<string> decryptionValueVector = calculateDecryptionShare(encryptedKeyHex_ptr->c_str(), publicDecryptionValue); vector<string> decryptionValueVector = calculateDecryptionShare(encryptedKeyHex_ptr->c_str(), publicDecryptionValue);
for (uint8_t i = 0; i < 4; ++i) { for (uint8_t j = 0; j < 4; ++j) {
result["decryptionShare"][i] = decryptionValueVector.at(i); result["decryptionShares"][i][j] = decryptionValueVector.at(j);
}
} }
} HANDLE_SGX_EXCEPTION(result) } HANDLE_SGX_EXCEPTION(result)
...@@ -1106,8 +1114,8 @@ SGXWalletServer::createBLSPrivateKeyV2(const string &blsKeyName, const string &e ...@@ -1106,8 +1114,8 @@ SGXWalletServer::createBLSPrivateKeyV2(const string &blsKeyName, const string &e
return createBLSPrivateKeyV2Impl(blsKeyName, ethKeyName, polyName, SecretShare, t, n); return createBLSPrivateKeyV2Impl(blsKeyName, ethKeyName, polyName, SecretShare, t, n);
} }
Json::Value SGXWalletServer::getDecryptionShare(const std::string& blsKeyName, const std::string& publicDecryptionValue) { Json::Value SGXWalletServer::getDecryptionShares(const std::string& blsKeyName, const Json::Value& publicDecryptionValues) {
return getDecryptionShareImpl(blsKeyName, publicDecryptionValue); return getDecryptionSharesImpl(blsKeyName, publicDecryptionValues);
} }
shared_ptr <string> SGXWalletServer::readFromDb(const string &name, const string &prefix) { shared_ptr <string> SGXWalletServer::readFromDb(const string &name, const string &prefix) {
......
...@@ -113,7 +113,7 @@ public: ...@@ -113,7 +113,7 @@ public:
virtual Json::Value createBLSPrivateKeyV2(const std::string& blsKeyName, const std::string& ethKeyName, const std::string& polyName, const std::string & SecretShare, int t, int n); virtual Json::Value createBLSPrivateKeyV2(const std::string& blsKeyName, const std::string& ethKeyName, const std::string& polyName, const std::string & SecretShare, int t, int n);
virtual Json::Value getDecryptionShare(const std::string& blsKeyName, const std::string& publicDecryptionValue); virtual Json::Value getDecryptionShares(const std::string& blsKeyName, const Json::Value& publicDecryptionValues);
static shared_ptr<string> readFromDb(const string &name, const string &prefix = ""); static shared_ptr<string> readFromDb(const string &name, const string &prefix = "");
...@@ -173,7 +173,7 @@ public: ...@@ -173,7 +173,7 @@ public:
static Json::Value createBLSPrivateKeyV2Impl(const std::string& blsKeyName, const std::string& ethKeyName, const std::string& polyName, const std::string & SecretShare, int t, int n); static Json::Value createBLSPrivateKeyV2Impl(const std::string& blsKeyName, const std::string& ethKeyName, const std::string& polyName, const std::string & SecretShare, int t, int n);
static Json::Value getDecryptionShareImpl(const std::string& KeyName, const std::string& publicDecryptionValue); static Json::Value getDecryptionSharesImpl(const std::string& KeyName, const Json::Value& publicDecryptionValues);
static void printDB(); static void printDB();
......
...@@ -63,7 +63,7 @@ class AbstractStubServer : public jsonrpc::AbstractServer<AbstractStubServer> ...@@ -63,7 +63,7 @@ class AbstractStubServer : public jsonrpc::AbstractServer<AbstractStubServer>
this->bindAndAddMethod(jsonrpc::Procedure("dkgVerificationV2", jsonrpc::PARAMS_BY_NAME, jsonrpc::JSON_OBJECT, "publicShares",jsonrpc::JSON_STRING, "ethKeyName",jsonrpc::JSON_STRING, "secretShare",jsonrpc::JSON_STRING,"t",jsonrpc::JSON_INTEGER, "n",jsonrpc::JSON_INTEGER, "index",jsonrpc::JSON_INTEGER, NULL), &AbstractStubServer::dkgVerificationV2I); this->bindAndAddMethod(jsonrpc::Procedure("dkgVerificationV2", jsonrpc::PARAMS_BY_NAME, jsonrpc::JSON_OBJECT, "publicShares",jsonrpc::JSON_STRING, "ethKeyName",jsonrpc::JSON_STRING, "secretShare",jsonrpc::JSON_STRING,"t",jsonrpc::JSON_INTEGER, "n",jsonrpc::JSON_INTEGER, "index",jsonrpc::JSON_INTEGER, NULL), &AbstractStubServer::dkgVerificationV2I);
this->bindAndAddMethod(jsonrpc::Procedure("createBLSPrivateKeyV2", jsonrpc::PARAMS_BY_NAME, jsonrpc::JSON_OBJECT, "blsKeyName",jsonrpc::JSON_STRING, "ethKeyName",jsonrpc::JSON_STRING, "polyName", jsonrpc::JSON_STRING, "secretShare",jsonrpc::JSON_STRING,"t", jsonrpc::JSON_INTEGER,"n",jsonrpc::JSON_INTEGER, NULL), &AbstractStubServer::createBLSPrivateKeyV2I); this->bindAndAddMethod(jsonrpc::Procedure("createBLSPrivateKeyV2", jsonrpc::PARAMS_BY_NAME, jsonrpc::JSON_OBJECT, "blsKeyName",jsonrpc::JSON_STRING, "ethKeyName",jsonrpc::JSON_STRING, "polyName", jsonrpc::JSON_STRING, "secretShare",jsonrpc::JSON_STRING,"t", jsonrpc::JSON_INTEGER,"n",jsonrpc::JSON_INTEGER, NULL), &AbstractStubServer::createBLSPrivateKeyV2I);
this->bindAndAddMethod(jsonrpc::Procedure("getDecryptionShare", jsonrpc::PARAMS_BY_NAME, jsonrpc::JSON_OBJECT, "blsKeyName",jsonrpc::JSON_STRING,"publicDecryptionValue",jsonrpc::JSON_STRING, NULL), &AbstractStubServer::getDecryptionShareI); this->bindAndAddMethod(jsonrpc::Procedure("getDecryptionShares", jsonrpc::PARAMS_BY_NAME, jsonrpc::JSON_OBJECT, "blsKeyName",jsonrpc::JSON_STRING,"publicDecryptionValues",jsonrpc::JSON_ARRAY, NULL), &AbstractStubServer::getDecryptionSharesI);
} }
inline virtual void importBLSKeyShareI(const Json::Value &request, Json::Value &response) inline virtual void importBLSKeyShareI(const Json::Value &request, Json::Value &response)
...@@ -163,9 +163,9 @@ class AbstractStubServer : public jsonrpc::AbstractServer<AbstractStubServer> ...@@ -163,9 +163,9 @@ class AbstractStubServer : public jsonrpc::AbstractServer<AbstractStubServer>
response = this->createBLSPrivateKeyV2(request["blsKeyName"].asString(), request["ethKeyName"].asString(), request["polyName"].asString(),request["secretShare"].asString(),request["t"].asInt(), request["n"].asInt()); response = this->createBLSPrivateKeyV2(request["blsKeyName"].asString(), request["ethKeyName"].asString(), request["polyName"].asString(),request["secretShare"].asString(),request["t"].asInt(), request["n"].asInt());
} }
inline virtual void getDecryptionShareI(const Json::Value &request, Json::Value &response) inline virtual void getDecryptionSharesI(const Json::Value &request, Json::Value &response)
{ {
response = this->getDecryptionShare(request["blsKeyName"].asString(), request["publicDecryptionValue"].asString()); response = this->getDecryptionShares(request["blsKeyName"].asString(), request["publicDecryptionValues"]);
} }
virtual Json::Value importBLSKeyShare(const std::string& keyShare, const std::string& keyShareName) = 0; virtual Json::Value importBLSKeyShare(const std::string& keyShare, const std::string& keyShareName) = 0;
...@@ -194,7 +194,7 @@ class AbstractStubServer : public jsonrpc::AbstractServer<AbstractStubServer> ...@@ -194,7 +194,7 @@ class AbstractStubServer : public jsonrpc::AbstractServer<AbstractStubServer>
virtual Json::Value dkgVerificationV2( const std::string& publicShares, const std::string& ethKeyName, const std::string& SecretShare, int t, int n, int index) = 0; virtual Json::Value dkgVerificationV2( const std::string& publicShares, const std::string& ethKeyName, const std::string& SecretShare, int t, int n, int index) = 0;
virtual Json::Value createBLSPrivateKeyV2(const std::string& blsKeyName, const std::string& ethKeyName, const std::string& polyName, const std::string & SecretShare, int t, int n) = 0; virtual Json::Value createBLSPrivateKeyV2(const std::string& blsKeyName, const std::string& ethKeyName, const std::string& polyName, const std::string & SecretShare, int t, int n) = 0;
virtual Json::Value getDecryptionShare(const std::string& KeyName, const std::string& publicDecryptionValue) = 0; virtual Json::Value getDecryptionShares(const std::string& KeyName, const Json::Value& publicDecryptionValues) = 0;
}; };
#endif //JSONRPC_CPP_STUB_ABSTRACTSTUBSERVER_H_ #endif //JSONRPC_CPP_STUB_ABSTRACTSTUBSERVER_H_
...@@ -121,7 +121,7 @@ string __ERR_STRING__ = string("SGX enclave call to ") + \ ...@@ -121,7 +121,7 @@ string __ERR_STRING__ = string("SGX enclave call to ") + \
__FUNCTION__ + " failed with status:" \ __FUNCTION__ + " failed with status:" \
+ to_string(__STATUS__) + \ + to_string(__STATUS__) + \
" Err message:" + __ERR_MSG__; \ " Err message:" + __ERR_MSG__; \
BOOST_THROW_EXCEPTION(SGXException(-102, string(__ERR_MSG__))); \ BOOST_THROW_EXCEPTION(SGXException(-102, string(__ERR_STRING__))); \
}\ }\
\ \
if (__ERR_STATUS__ != 0) {\ if (__ERR_STATUS__ != 0) {\
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
<ISVSVN>3</ISVSVN> <ISVSVN>3</ISVSVN>
<StackMaxSize>0x200000</StackMaxSize> <StackMaxSize>0x200000</StackMaxSize>
<HeapMaxSize>0x200000</HeapMaxSize> <HeapMaxSize>0x200000</HeapMaxSize>
<TCSNum>20</TCSNum> <TCSNum>25</TCSNum>
<TCSMaxNum>20</TCSMaxNum> <TCSMaxNum>25</TCSMaxNum>
<TCSMinPool>20</TCSMinPool> <TCSMinPool>25</TCSMinPool>
<TCSPolicy>0</TCSPolicy> <TCSPolicy>0</TCSPolicy>
<!-- Recommend changing 'DisableDebug' to 1 to make the enclave undebuggable for enclave release --> <!-- Recommend changing 'DisableDebug' to 1 to make the enclave undebuggable for enclave release -->
<DisableDebug>0</DisableDebug> <DisableDebug>0</DisableDebug>
......
...@@ -214,13 +214,13 @@ class StubClient : public jsonrpc::Client ...@@ -214,13 +214,13 @@ class StubClient : public jsonrpc::Client
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
} }
Json::Value getDecryptionShare(const std::string& blsKeyName, const std::string& publicDecryptionValue) Json::Value getDecryptionShares(const std::string& blsKeyName, const Json::Value& publicDecryptionValues)
{ {
Json::Value p; Json::Value p;
p["blsKeyName"] = blsKeyName; p["blsKeyName"] = blsKeyName;
p["publicDecryptionValue"] = publicDecryptionValue; p["publicDecryptionValues"] = publicDecryptionValues["publicDecryptionValues"];
Json::Value result = this->CallMethod("getDecryptionShare",p); Json::Value result = this->CallMethod("getDecryptionShares",p);
if (result.isObject()) if (result.isObject())
return result; return result;
else else
......
...@@ -1248,21 +1248,43 @@ TEST_CASE_METHOD(TestFixture, "Test decryption share for threshold encryption", ...@@ -1248,21 +1248,43 @@ TEST_CASE_METHOD(TestFixture, "Test decryption share for threshold encryption",
libff::alt_bn128_Fr key = libff::alt_bn128_Fr( libff::alt_bn128_Fr key = libff::alt_bn128_Fr(
"6507625568967977077291849236396320012317305261598035438182864059942098934847"); "6507625568967977077291849236396320012317305261598035438182864059942098934847");
libff::alt_bn128_G2 decryption_value = libff::alt_bn128_G2::random_element(); libff::alt_bn128_G2 decryption_value1 = libff::alt_bn128_G2::random_element();
decryption_value.to_affine_coordinates(); libff::alt_bn128_G2 decryption_value2 = libff::alt_bn128_G2::random_element();
auto decrytion_value_str = convertG2ToString( decryption_value, ':' ); decryption_value1.to_affine_coordinates();
auto decryption_share = c.getDecryptionShare( name, decrytion_value_str )["decryptionShare"]; decryption_value2.to_affine_coordinates();
libff::alt_bn128_G2 share; auto decrytion_value_str1 = convertG2ToString( decryption_value1, ':' );
share.Z = libff::alt_bn128_Fq2::one(); auto decrytion_value_str2 = convertG2ToString( decryption_value2, ':' );
share.X.c0 = libff::alt_bn128_Fq( decryption_share[0].asCString() ); Json::Value publicDecryptionValues;
share.X.c1 = libff::alt_bn128_Fq( decryption_share[1].asCString() ); publicDecryptionValues["publicDecryptionValues"][0] = decrytion_value_str1;
share.Y.c0 = libff::alt_bn128_Fq( decryption_share[2].asCString() ); publicDecryptionValues["publicDecryptionValues"][1] = decrytion_value_str2;
share.Y.c1 = libff::alt_bn128_Fq( decryption_share[3].asCString() );
REQUIRE( share == key * decryption_value ); auto decryptionShares = c.getDecryptionShares( name, publicDecryptionValues );
auto decryption_share1 = decryptionShares["decryptionShares"][0];
auto decryption_share2 = decryptionShares["decryptionShares"][1];
libff::alt_bn128_G2 share1;
share1.Z = libff::alt_bn128_Fq2::one();
share1.X.c0 = libff::alt_bn128_Fq( decryption_share1[0].asCString() );
share1.X.c1 = libff::alt_bn128_Fq( decryption_share1[1].asCString() );
share1.Y.c0 = libff::alt_bn128_Fq( decryption_share1[2].asCString() );
share1.Y.c1 = libff::alt_bn128_Fq( decryption_share1[3].asCString() );
REQUIRE( share1 == key * decryption_value1 );
libff::alt_bn128_G2 share2;
share2.Z = libff::alt_bn128_Fq2::one();
share2.X.c0 = libff::alt_bn128_Fq( decryption_share2[0].asCString() );
share2.X.c1 = libff::alt_bn128_Fq( decryption_share2[1].asCString() );
share2.Y.c0 = libff::alt_bn128_Fq( decryption_share2[2].asCString() );
share2.Y.c1 = libff::alt_bn128_Fq( decryption_share2[3].asCString() );
REQUIRE( share2 == key * decryption_value2 );
} }
TEST_CASE_METHOD(TestFixture, "Test decryption share for threshold encryption via zmq", "[te-decryption-share-zmq]") { TEST_CASE_METHOD(TestFixture, "Test decryption share for threshold encryption via zmq", "[te-decryption-share-zmq]") {
...@@ -1277,21 +1299,43 @@ TEST_CASE_METHOD(TestFixture, "Test decryption share for threshold encryption vi ...@@ -1277,21 +1299,43 @@ TEST_CASE_METHOD(TestFixture, "Test decryption share for threshold encryption vi
libff::alt_bn128_Fr key = libff::alt_bn128_Fr( libff::alt_bn128_Fr key = libff::alt_bn128_Fr(
"6507625568967977077291849236396320012317305261598035438182864059942098934847"); "6507625568967977077291849236396320012317305261598035438182864059942098934847");
libff::alt_bn128_G2 decryption_value = libff::alt_bn128_G2::random_element(); libff::alt_bn128_G2 decryption_value1 = libff::alt_bn128_G2::random_element();
decryption_value.to_affine_coordinates(); libff::alt_bn128_G2 decryption_value2 = libff::alt_bn128_G2::random_element();
decryption_value1.to_affine_coordinates();
decryption_value2.to_affine_coordinates();
auto decrytion_value_str1 = convertG2ToString( decryption_value1, ':' );
auto decrytion_value_str2 = convertG2ToString( decryption_value2, ':' );
Json::Value publicDecryptionValues;
publicDecryptionValues["publicDecryptionValues"][0] = decrytion_value_str1;
publicDecryptionValues["publicDecryptionValues"][1] = decrytion_value_str2;
auto decryptionShares = client->getDecryptionShares( name, publicDecryptionValues );
auto decryption_share1 = decryptionShares[0];
auto decryption_share2 = decryptionShares[1];
libff::alt_bn128_G2 share1;
share1.Z = libff::alt_bn128_Fq2::one();
share1.X.c0 = libff::alt_bn128_Fq( decryption_share1[0].asCString() );
share1.X.c1 = libff::alt_bn128_Fq( decryption_share1[1].asCString() );
share1.Y.c0 = libff::alt_bn128_Fq( decryption_share1[2].asCString() );
share1.Y.c1 = libff::alt_bn128_Fq( decryption_share1[3].asCString() );
auto decrytion_value_str = convertG2ToString( decryption_value, ':' ); REQUIRE( share1 == key * decryption_value1 );
auto decryption_share = client->getDecryptionShare( name, decrytion_value_str );
libff::alt_bn128_G2 share; libff::alt_bn128_G2 share2;
share.Z = libff::alt_bn128_Fq2::one(); share2.Z = libff::alt_bn128_Fq2::one();
share.X.c0 = libff::alt_bn128_Fq( decryption_share[0].asCString() ); share2.X.c0 = libff::alt_bn128_Fq( decryption_share2[0].asCString() );
share.X.c1 = libff::alt_bn128_Fq( decryption_share[1].asCString() ); share2.X.c1 = libff::alt_bn128_Fq( decryption_share2[1].asCString() );
share.Y.c0 = libff::alt_bn128_Fq( decryption_share[2].asCString() ); share2.Y.c0 = libff::alt_bn128_Fq( decryption_share2[2].asCString() );
share.Y.c1 = libff::alt_bn128_Fq( decryption_share[3].asCString() ); share2.Y.c1 = libff::alt_bn128_Fq( decryption_share2[3].asCString() );
REQUIRE( share == key * decryption_value ); REQUIRE( share2 == key * decryption_value2 );
} }
TEST_CASE_METHOD(TestFixtureZMQSign, "ZMQ-ecdsa", "[zmq-ecdsa]") { TEST_CASE_METHOD(TestFixtureZMQSign, "ZMQ-ecdsa", "[zmq-ecdsa]") {
......
...@@ -265,11 +265,11 @@ Json::Value deleteBLSKeyReqMessage::process() { ...@@ -265,11 +265,11 @@ Json::Value deleteBLSKeyReqMessage::process() {
Json::Value GetDecryptionShareReqMessage::process() { Json::Value GetDecryptionShareReqMessage::process() {
auto blsKeyName = getStringRapid("blsKeyName"); auto blsKeyName = getStringRapid("blsKeyName");
auto publicDecryptionValue = getStringRapid("publicDecryptionValue"); auto publicDecryptionValues = getJsonValueRapid("publicDecryptionValues");
if (checkKeyOwnership && !isKeyByOwner(blsKeyName, getStringRapid("cert"))) { if (checkKeyOwnership && !isKeyByOwner(blsKeyName, getStringRapid("cert"))) {
throw std::invalid_argument("Only owner of the key can access it"); throw std::invalid_argument("Only owner of the key can access it");
} }
auto result = SGXWalletServer::getDecryptionShareImpl(blsKeyName, publicDecryptionValue); auto result = SGXWalletServer::getDecryptionSharesImpl(blsKeyName, publicDecryptionValues);
result["type"] = ZMQMessage::GET_DECRYPTION_SHARE_RSP; result["type"] = ZMQMessage::GET_DECRYPTION_SHARE_RSP;
return result; return result;
} }
...@@ -255,7 +255,7 @@ public: ...@@ -255,7 +255,7 @@ public:
virtual Json::Value process(); virtual Json::Value process();
Json::Value getShare() { Json::Value getShare() {
return getJsonValueRapid("decryptionShare"); return getJsonValueRapid("decryptionShares");
} }
}; };
......
...@@ -496,11 +496,11 @@ bool ZMQClient::deleteBLSKey(const string& blsKeyName) { ...@@ -496,11 +496,11 @@ bool ZMQClient::deleteBLSKey(const string& blsKeyName) {
return result->isSuccessful(); return result->isSuccessful();
} }
Json::Value ZMQClient::getDecryptionShare(const string& blsKeyName, const string& publicDecryptionValue) { Json::Value ZMQClient::getDecryptionShares(const string& blsKeyName, const Json::Value& publicDecryptionValues) {
Json::Value p; Json::Value p;
p["type"] = ZMQMessage::GET_DECRYPTION_SHARE_REQ; p["type"] = ZMQMessage::GET_DECRYPTION_SHARE_REQ;
p["blsKeyName"] = blsKeyName; p["blsKeyName"] = blsKeyName;
p["publicDecryptionValue"] = publicDecryptionValue; p["publicDecryptionValues"] = publicDecryptionValues["publicDecryptionValues"];
auto result = dynamic_pointer_cast<GetDecryptionShareRspMessage>(doRequestReply(p)); auto result = dynamic_pointer_cast<GetDecryptionShareRspMessage>(doRequestReply(p));
CHECK_STATE(result); CHECK_STATE(result);
CHECK_STATE(result->getStatus() == 0); CHECK_STATE(result->getStatus() == 0);
......
...@@ -122,7 +122,7 @@ public: ...@@ -122,7 +122,7 @@ public:
bool deleteBLSKey(const string& blsKeyName); bool deleteBLSKey(const string& blsKeyName);
Json::Value getDecryptionShare(const string& blsKeyName, const string& publicDecryptionValue); Json::Value getDecryptionShares(const string& blsKeyName, const Json::Value& publicDecryptionValues);
}; };
......
...@@ -233,6 +233,7 @@ pair <string, shared_ptr<zmq::message_t>> ZMQServer::receiveMessage() { ...@@ -233,6 +233,7 @@ pair <string, shared_ptr<zmq::message_t>> ZMQServer::receiveMessage() {
} }
auto result = string((char *) reqMsg->data(), reqMsg->size()); auto result = string((char *) reqMsg->data(), reqMsg->size());
spdlog::debug("Received request via ZMQ server: {}", result);
return {result, identity}; return {result, identity};
} }
...@@ -255,6 +256,7 @@ void ZMQServer::sendToClient(Json::Value &_result, shared_ptr <zmq::message_t> & ...@@ -255,6 +256,7 @@ void ZMQServer::sendToClient(Json::Value &_result, shared_ptr <zmq::message_t> &
if (!s_send(*socket, replyStr)) { if (!s_send(*socket, replyStr)) {
exit(-16); exit(-16);
} }
spdlog::debug("Send response to client: {}", replyStr);
} catch (ExitRequestedException) { } catch (ExitRequestedException) {
throw; throw;
} catch (exception &e) { } catch (exception &e) {
......
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