Unverified Commit 1897419d authored by kladko's avatar kladko

SKALE-3067-cleanup-sgx

parent ea74ba94
......@@ -415,9 +415,7 @@ Json::Value SGXWalletServer::generateDKGPolyImpl(const string &_polyName, int _t
}
Json::Value SGXWalletServer::getVerificationVectorImpl(const string &_polyName, int _t, int _n) {
Json::Value result;
result["status"] = 0;
result["errorMessage"] = "";
INIT_RESULT(result)
vector <vector<string>> verifVector;
try {
......@@ -449,9 +447,7 @@ Json::Value SGXWalletServer::getVerificationVectorImpl(const string &_polyName,
}
Json::Value SGXWalletServer::getSecretShareImpl(const string &_polyName, const Json::Value &_pubKeys, int _t, int _n) {
Json::Value result;
result["status"] = 0;
result["errorMessage"] = "";
INIT_RESULT(result);
try {
if (_pubKeys.size() != (uint64_t) _n) {
......@@ -488,9 +484,7 @@ Json::Value SGXWalletServer::getSecretShareImpl(const string &_polyName, const J
Json::Value SGXWalletServer::dkgVerificationImpl(const string &_publicShares, const string &_ethKeyName,
const string &_secretShare, int _t, int _n, int _index) {
Json::Value result;
result["status"] = 0;
result["errorMessage"] = "";
INIT_RESULT(result)
result["result"] = true;
try {
......@@ -524,9 +518,7 @@ Json::Value SGXWalletServer::dkgVerificationImpl(const string &_publicShares, co
Json::Value
SGXWalletServer::createBLSPrivateKeyImpl(const string &_blsKeyName, const string &_ethKeyName, const string &_polyName,
const string &_secretShare, int _t, int _n) {
Json::Value result;
result["status"] = 0;
result["errorMessage"] = "";
INIT_RESULT(result)
try {
if (_secretShare.length() != (uint64_t) _n * 192) {
......
......@@ -174,14 +174,17 @@ void TestUtils::sendRPCRequest() {
vector <string> pubShares(n);
vector <string> polyNames(n);
int schainID = randGen();
int dkgID = randGen();
static atomic<int> counter(1);
int schainID = counter.fetch_add(1);
int dkgID = counter.fetch_add(1);
for (uint8_t i = 0; i < n; i++) {
ethKeys[i] = c.generateECDSAKey();
CHECK_STATE(ethKeys[i]["status"] == 0);
string polyName =
"POLY:SCHAIN_ID:" + to_string(schainID) + ":NODE_ID:" + to_string(i) + ":DKG_ID:" + to_string(dkgID);
auto response = c.generateDKGPoly(polyName, t);
cerr << response << endl;
CHECK_STATE(response["status"] == 0);
polyNames[i] = polyName;
verifVects[i] = c.getVerificationVector(polyName, t, n);
......
......@@ -3,6 +3,8 @@
#define ECDSA_ENCR_LEN 93
#define ECDSA_BIN_LEN 33
#define SMALL_BUF_SIZE 1024
#define TINY_BUF_SIZE 256
enclave {
trusted {
......
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