Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
sgxwallet
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
董子豪
sgxwallet
Commits
6abbcc3e
Unverified
Commit
6abbcc3e
authored
Aug 13, 2020
by
kladko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "SKALE-3067-cleanup-sgx"
This reverts commit
16e1dd98
.
parent
16e1dd98
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
12 deletions
+22
-12
SGXWalletServer.cpp
SGXWalletServer.cpp
+22
-12
No files found.
SGXWalletServer.cpp
View file @
6abbcc3e
...
...
@@ -187,7 +187,10 @@ SGXWalletServer::importBLSKeyShareImpl(const string &_keyShare, const string &_k
result
[
"encryptedKeyShare"
]
=
encryptedKeyShareHex
;
writeKeyShare
(
_keyShareName
,
encryptedKeyShareHex
,
_index
,
n
,
t
);
}
HANDLE_SGX_EXCEPTION
(
result
)
}
catch
(
SGXException
&
_e
)
{
result
[
"status"
]
=
_e
.
status
;
result
[
"errorMessage"
]
=
_e
.
errString
;
}
RETURN_SUCCESS
(
result
);
}
...
...
@@ -391,7 +394,6 @@ Json::Value SGXWalletServer::generateDKGPolyImpl(const string &_polyName, int _t
Json
::
Value
SGXWalletServer
::
getVerificationVectorImpl
(
const
string
&
_polyName
,
int
_t
,
int
_n
)
{
INIT_RESULT
(
result
)
result
[
"verificationVector"
]
=
""
;
vector
<
vector
<
string
>>
verifVector
;
try
{
...
...
@@ -412,7 +414,12 @@ Json::Value SGXWalletServer::getVerificationVectorImpl(const string &_polyName,
result
[
"verificationVector"
][
i
][
j
]
=
currentCoef
.
at
(
j
);
}
}
}
HANDLE_SGX_EXCEPTION
(
result
)
}
catch
(
SGXException
&
_e
)
{
cerr
<<
" err str "
<<
_e
.
errString
<<
endl
;
result
[
"status"
]
=
_e
.
status
;
result
[
"errorMessage"
]
=
_e
.
errString
;
result
[
"verificationVector"
]
=
""
;
}
return
result
;
}
...
...
@@ -420,9 +427,6 @@ Json::Value SGXWalletServer::getVerificationVectorImpl(const string &_polyName,
Json
::
Value
SGXWalletServer
::
getSecretShareImpl
(
const
string
&
_polyName
,
const
Json
::
Value
&
_pubKeys
,
int
_t
,
int
_n
)
{
INIT_RESULT
(
result
);
result
[
"secretShare"
]
=
""
;
result
[
"SecretShare"
]
=
""
;
try
{
if
(
_pubKeys
.
size
()
!=
(
uint64_t
)
_n
)
{
throw
SGXException
(
INVALID_DKG_PARAMS
,
"invalid number of public keys"
);
...
...
@@ -446,7 +450,12 @@ Json::Value SGXWalletServer::getSecretShareImpl(const string &_polyName, const J
string
s
=
trustedGetSecretShares
(
_polyName
,
encrPoly
->
c_str
(),
pubKeysStrs
,
_t
,
_n
);
result
[
"secretShare"
]
=
s
;
}
HANDLE_SGX_EXCEPTION
(
result
);
}
catch
(
SGXException
&
_e
)
{
result
[
"status"
]
=
_e
.
status
;
result
[
"errorMessage"
]
=
_e
.
errString
;
result
[
"secretShare"
]
=
""
;
result
[
"SecretShare"
]
=
""
;
}
return
result
;
}
...
...
@@ -454,9 +463,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
)
{
INIT_RESULT
(
result
)
result
[
"result"
]
=
false
;
result
[
"result"
]
=
true
;
try
{
if
(
!
checkECDSAKeyName
(
_ethKeyName
))
{
...
...
@@ -477,9 +484,12 @@ Json::Value SGXWalletServer::dkgVerificationImpl(const string &_publicShares, co
if
(
!
verifyShares
(
_publicShares
.
c_str
(),
_secretShare
.
c_str
(),
encryptedKeyHex_ptr
->
c_str
(),
_t
,
_n
,
_index
))
{
result
[
"result"
]
=
false
;
}
}
HANDLE_SGX_EXCEPTION
(
result
)
}
catch
(
SGXException
&
_e
)
{
result
[
"status"
]
=
_e
.
status
;
result
[
"errorMessage"
]
=
_e
.
errString
;
result
[
"result"
]
=
false
;
}
result
[
"result"
]
=
true
;
return
result
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment