Skip to content

Commit

Permalink
format code
Browse files Browse the repository at this point in the history
  • Loading branch information
olehnikolaiev committed Mar 22, 2023
1 parent 3053514 commit 149a371
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 16 deletions.
2 changes: 1 addition & 1 deletion SGXWalletServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ Json::Value SGXWalletServer::blsSignMessageHashImpl(const string &_keyShareName,
throw SGXException(INVALID_BLS_HEX,
string(__FUNCTION__) + ":Invalid bls hex");
}

value = readFromDb(_keyShareName);

if (!bls_sign(value->c_str(), hashTmp.c_str(), t, n, signature.data())) {
Expand Down
31 changes: 17 additions & 14 deletions zmq_src/ZMQClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -546,25 +546,28 @@ bool ZMQClient::generateBLSPrivateKey(const string &blsKeyName) {
CHECK_STATE(result);
return result->getStatus() == 0;

Json::Value ZMQClient::getDecryptionShares(const string& blsKeyName, const Json::Value& publicDecryptionValues) {
Json::Value ZMQClient::getDecryptionShares(
const string &blsKeyName, const Json::Value &publicDecryptionValues) {
Json::Value p;
p["type"] = ZMQMessage::GET_DECRYPTION_SHARE_REQ;
p["blsKeyName"] = blsKeyName;
p["publicDecryptionValues"] = publicDecryptionValues["publicDecryptionValues"];
auto result = dynamic_pointer_cast<GetDecryptionShareRspMessage>(doRequestReply(p));
p["publicDecryptionValues"] =
publicDecryptionValues["publicDecryptionValues"];
auto result =
dynamic_pointer_cast<GetDecryptionShareRspMessage>(doRequestReply(p));
CHECK_STATE(result);
CHECK_STATE(result->getStatus() == 0);
return result->getShare();
}
}

std::string ZMQClient::popProve(const string &blsKeyName) {
Json::Value p;
p["blsKeyName"] = blsKeyName;
p["type"] = ZMQMessage::POP_PROVE_REQ;
auto result = dynamic_pointer_cast<popProveRspMessage>(doRequestReply(p));
CHECK_STATE(result);
CHECK_STATE(result->getStatus() == 0);
return result->getPopProve();
}
std::string ZMQClient::popProve(const string &blsKeyName) {
Json::Value p;
p["blsKeyName"] = blsKeyName;
p["type"] = ZMQMessage::POP_PROVE_REQ;
auto result = dynamic_pointer_cast<popProveRspMessage>(doRequestReply(p));
CHECK_STATE(result);
CHECK_STATE(result->getStatus() == 0);
return result->getPopProve();
}

uint64_t ZMQClient::getProcessID() { return syscall(__NR_gettid); }
uint64_t ZMQClient::getProcessID() { return syscall(__NR_gettid); }
2 changes: 1 addition & 1 deletion zmq_src/ZMQServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ void ZMQServer::doOneServerLoop() {
msg, identity);

incomingQueue.at(index).enqueue(element);
}
}

} catch (ExitRequestedException &) {
throw;
Expand Down

0 comments on commit 149a371

Please sign in to comment.