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
4a53d7a3
Unverified
Commit
4a53d7a3
authored
Aug 13, 2020
by
kladko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SKALE-3067-cleanup-sgx
parent
6abbcc3e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
18 deletions
+11
-18
SGXWalletServer.cpp
SGXWalletServer.cpp
+11
-17
TestUtils.cpp
TestUtils.cpp
+0
-1
No files found.
SGXWalletServer.cpp
View file @
4a53d7a3
...
...
@@ -426,6 +426,8 @@ 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
)
{
...
...
@@ -450,14 +452,10 @@ Json::Value SGXWalletServer::getSecretShareImpl(const string &_polyName, const J
string
s
=
trustedGetSecretShares
(
_polyName
,
encrPoly
->
c_str
(),
pubKeysStrs
,
_t
,
_n
);
result
[
"secretShare"
]
=
s
;
}
catch
(
SGXException
&
_e
)
{
result
[
"status"
]
=
_e
.
status
;
result
[
"errorMessage"
]
=
_e
.
errString
;
result
[
"secretShare"
]
=
""
;
result
[
"SecretShare"
]
=
""
;
}
result
[
"SecretShare"
]
=
s
;
}
HANDLE_SGX_EXCEPTION
(
result
)
return
result
;
RETURN_SUCCESS
(
result
)
}
Json
::
Value
SGXWalletServer
::
dkgVerificationImpl
(
const
string
&
_publicShares
,
const
string
&
_ethKeyName
,
...
...
@@ -500,8 +498,6 @@ SGXWalletServer::createBLSPrivateKeyImpl(const string &_blsKeyName, const string
try
{
if
(
_secretShare
.
length
()
!=
(
uint64_t
)
_n
*
192
)
{
spdlog
::
error
(
"Invalid secret share length - {}"
,
_secretShare
.
length
());
spdlog
::
error
(
"Secret share - {}"
,
_secretShare
);
throw
SGXException
(
INVALID_SECRET_SHARES_LENGTH
,
"Invalid secret share length"
);
}
if
(
!
checkECDSAKeyName
(
_ethKeyName
))
{
...
...
@@ -539,7 +535,7 @@ SGXWalletServer::createBLSPrivateKeyImpl(const string &_blsKeyName, const string
}
HANDLE_SGX_EXCEPTION
(
result
)
return
result
;
RETURN_SUCCESS
(
result
)
;
}
Json
::
Value
SGXWalletServer
::
getBLSPublicKeyShareImpl
(
const
string
&
_blsKeyName
)
{
...
...
@@ -550,8 +546,6 @@ Json::Value SGXWalletServer::getBLSPublicKeyShareImpl(const string &_blsKeyName)
throw
SGXException
(
INVALID_BLS_NAME
,
"Invalid BLSKey name"
);
}
shared_ptr
<
string
>
encryptedKeyHex_ptr
=
readFromDb
(
_blsKeyName
);
spdlog
::
debug
(
"encr_bls_key_share is {}"
,
*
encryptedKeyHex_ptr
);
spdlog
::
debug
(
"length is {}"
,
encryptedKeyHex_ptr
->
length
());
vector
<
string
>
public_key_vect
=
GetBLSPubKey
(
encryptedKeyHex_ptr
->
c_str
());
for
(
uint8_t
i
=
0
;
i
<
4
;
i
++
)
{
...
...
@@ -578,7 +572,7 @@ Json::Value SGXWalletServer::complaintResponseImpl(const string &_polyName, int
result
[
"dhKey"
]
=
DHKey
;
}
HANDLE_SGX_EXCEPTION
(
result
)
return
result
;
RETURN_SUCCESS
(
result
)
;
}
Json
::
Value
SGXWalletServer
::
multG2Impl
(
const
string
&
_x
)
{
...
...
@@ -591,7 +585,7 @@ Json::Value SGXWalletServer::multG2Impl(const string &_x) {
}
}
HANDLE_SGX_EXCEPTION
(
result
)
return
result
;
RETURN_SUCCESS
(
result
)
;
}
Json
::
Value
SGXWalletServer
::
isPolyExistsImpl
(
const
string
&
_polyName
)
{
...
...
@@ -607,18 +601,18 @@ Json::Value SGXWalletServer::isPolyExistsImpl(const string &_polyName) {
}
}
HANDLE_SGX_EXCEPTION
(
result
)
return
result
;
RETURN_SUCCESS
(
result
)
;
}
Json
::
Value
SGXWalletServer
::
getServerStatusImpl
()
{
INIT_RESULT
(
result
)
return
result
;
RETURN_SUCCESS
(
result
)
}
Json
::
Value
SGXWalletServer
::
getServerVersionImpl
()
{
INIT_RESULT
(
result
)
result
[
"version"
]
=
TOSTRING
(
SGXWALLET_VERSION
);
return
result
;
RETURN_SUCCESS
(
result
)
}
Json
::
Value
SGXWalletServer
::
deleteBlsKeyImpl
(
const
std
::
string
&
name
)
{
...
...
TestUtils.cpp
View file @
4a53d7a3
...
...
@@ -184,7 +184,6 @@ void TestUtils::sendRPCRequest() {
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
);
...
...
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