SKALE-2002 clean up

parent fb830e75
......@@ -104,15 +104,12 @@ string gen_dkg_poly(int _t) {
}
vector<vector<string>> get_verif_vect(const char *encryptedPolyHex, int t, int n) {
vector<char> errMsg1(BUF_LEN, 0);
int errStatus = 0;
spdlog::debug("got encr poly size {}", char_traits<char>::length(encryptedPolyHex));
vector<char> pubShares(10000, 0);
uint64_t encLen = 0;
......@@ -152,13 +149,11 @@ vector<vector<string>> get_verif_vect(const char *encryptedPolyHex, int t, int n
string trustedGetSecretShares(const string &_polyName, const char *_encryptedPolyHex, const vector<string> &_publicKeys,
int _t,
int _n) {
vector<char> errMsg1(BUF_LEN, 0);
vector<char> hexEncrKey(BUF_LEN, 0);
int errStatus = 0;
uint64_t encLen = 0;
vector<uint8_t> encrDKGPoly(BUF_LEN, 0);
if (!hex2carray2(_encryptedPolyHex, &encLen, encrDKGPoly.data(), 6100)) {
......@@ -173,7 +168,6 @@ string trustedGetSecretShares(const string &_polyName, const char *_encryptedPol
string result;
for (int i = 0; i < _n; i++) {
vector<uint8_t> encryptedSkey(BUF_LEN, 0);
uint32_t decLen;
......@@ -252,10 +246,8 @@ verifyShares(const char *publicShares, const char *encr_sshare, const char *encr
}
bool CreateBLSShare(const string &blsKeyName, const char *s_shares, const char *encryptedKeyHex) {
spdlog::debug("ENTER CreateBLSShare");
// char* errMsg1 = (char*) calloc(1024,1);
char errMsg[BUF_LEN];
int errStatus = 0;
......@@ -278,21 +270,17 @@ bool CreateBLSShare(const string &blsKeyName, const char *s_shares, const char *
spdlog::error("status {}", errStatus);
throw SGXException(ERROR_IN_ENCLAVE, "Create BLS private key failed in enclave");
} else {
char hexBLSKey[2 * BUF_LEN];
carray2Hex(encr_bls_key, enc_bls_len, hexBLSKey);
SGXWalletServer::writeDataToDB(blsKeyName, hexBLSKey);
return true;
}
}
vector<string> GetBLSPubKey(const char *encryptedKeyHex) {
char errMsg1[BUF_LEN];
int errStatus = 0;
......@@ -323,7 +311,6 @@ vector<string> GetBLSPubKey(const char *encryptedKeyHex) {
}
string decryptDHKey(const string &polyName, int ind) {
vector<char> errMsg1(1024, 0);
int errStatus = 0;
......@@ -342,7 +329,6 @@ string decryptDHKey(const string &polyName, int ind) {
spdlog::debug("encr DH key length is {}", dhEncLen);
spdlog::debug("hex encr DH key length is {}", hexEncrKeyPtr->length());
char DHKey[ECDSA_SKEY_LEN];
trustedDecryptKeyAES(eid, &errStatus, errMsg1.data(), encryptedDHKey, dhEncLen, DHKey);
......
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