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