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
4e2605dc
Unverified
Commit
4e2605dc
authored
Mar 26, 2020
by
kladko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SKALE-2341 Added tags for older commits
parent
84111099
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
SGXWalletServer.cpp
SGXWalletServer.cpp
+11
-0
No files found.
SGXWalletServer.cpp
View file @
4e2605dc
...
@@ -285,6 +285,7 @@ Json::Value SGXWalletServer::generateECDSAKeyImpl() {
...
@@ -285,6 +285,7 @@ Json::Value SGXWalletServer::generateECDSAKeyImpl() {
result
[
"encryptedKey"
]
=
keys
.
at
(
0
);
result
[
"encryptedKey"
]
=
keys
.
at
(
0
);
result
[
"publicKey"
]
=
keys
.
at
(
1
);
result
[
"publicKey"
]
=
keys
.
at
(
1
);
result
[
"PublicKey"
]
=
keys
.
at
(
1
);
result
[
"keyName"
]
=
keyName
;
result
[
"keyName"
]
=
keyName
;
}
catch
(
RPCException
&
_e
)
{
}
catch
(
RPCException
&
_e
)
{
...
@@ -389,6 +390,7 @@ Json::Value SGXWalletServer::getPublicECDSAKeyImpl(const string &_keyName) {
...
@@ -389,6 +390,7 @@ Json::Value SGXWalletServer::getPublicECDSAKeyImpl(const string &_keyName) {
result
[
"status"
]
=
0
;
result
[
"status"
]
=
0
;
result
[
"errorMessage"
]
=
""
;
result
[
"errorMessage"
]
=
""
;
result
[
"publicKey"
]
=
""
;
result
[
"publicKey"
]
=
""
;
result
[
"PublicKey"
]
=
""
;
string
publicKey
;
string
publicKey
;
...
@@ -401,6 +403,7 @@ Json::Value SGXWalletServer::getPublicECDSAKeyImpl(const string &_keyName) {
...
@@ -401,6 +403,7 @@ Json::Value SGXWalletServer::getPublicECDSAKeyImpl(const string &_keyName) {
spdlog
::
debug
(
"PublicKey {}"
,
publicKey
);
spdlog
::
debug
(
"PublicKey {}"
,
publicKey
);
spdlog
::
debug
(
"PublicKey length {}"
,
publicKey
.
length
());
spdlog
::
debug
(
"PublicKey length {}"
,
publicKey
.
length
());
result
[
"PublicKey"
]
=
publicKey
;
result
[
"publicKey"
]
=
publicKey
;
result
[
"publicKey"
]
=
publicKey
;
}
catch
(
RPCException
&
_e
)
{
}
catch
(
RPCException
&
_e
)
{
...
@@ -465,6 +468,7 @@ Json::Value SGXWalletServer::getVerificationVectorImpl(const string &_polyName,
...
@@ -465,6 +468,7 @@ Json::Value SGXWalletServer::getVerificationVectorImpl(const string &_polyName,
vector
<
string
>
cur_coef
=
verifVector
.
at
(
i
);
vector
<
string
>
cur_coef
=
verifVector
.
at
(
i
);
for
(
int
j
=
0
;
j
<
4
;
j
++
)
{
for
(
int
j
=
0
;
j
<
4
;
j
++
)
{
result
[
"verificationVector"
][
i
][
j
]
=
cur_coef
.
at
(
j
);
result
[
"verificationVector"
][
i
][
j
]
=
cur_coef
.
at
(
j
);
result
[
"Verification Vector"
][
i
][
j
]
=
cur_coef
.
at
(
j
);
}
}
}
}
...
@@ -473,6 +477,7 @@ Json::Value SGXWalletServer::getVerificationVectorImpl(const string &_polyName,
...
@@ -473,6 +477,7 @@ Json::Value SGXWalletServer::getVerificationVectorImpl(const string &_polyName,
result
[
"status"
]
=
_e
.
status
;
result
[
"status"
]
=
_e
.
status
;
result
[
"errorMessage"
]
=
_e
.
errString
;
result
[
"errorMessage"
]
=
_e
.
errString
;
result
[
"verificationVector"
]
=
""
;
result
[
"verificationVector"
]
=
""
;
result
[
"Verification Vector"
]
=
""
;
}
}
return
result
;
return
result
;
...
@@ -513,6 +518,7 @@ Json::Value SGXWalletServer::getSecretShareImpl(const string &_polyName, const J
...
@@ -513,6 +518,7 @@ Json::Value SGXWalletServer::getSecretShareImpl(const string &_polyName, const J
result
[
"status"
]
=
_e
.
status
;
result
[
"status"
]
=
_e
.
status
;
result
[
"errorMessage"
]
=
_e
.
errString
;
result
[
"errorMessage"
]
=
_e
.
errString
;
result
[
"secretShare"
]
=
""
;
result
[
"secretShare"
]
=
""
;
result
[
"SecretShare"
]
=
""
;
}
}
return
result
;
return
result
;
...
@@ -631,6 +637,7 @@ Json::Value SGXWalletServer::getBLSPublicKeyShareImpl(const string &_blsKeyName)
...
@@ -631,6 +637,7 @@ Json::Value SGXWalletServer::getBLSPublicKeyShareImpl(const string &_blsKeyName)
vector
<
string
>
public_key_vect
=
GetBLSPubKey
(
encryptedKeyHex_ptr
->
c_str
());
vector
<
string
>
public_key_vect
=
GetBLSPubKey
(
encryptedKeyHex_ptr
->
c_str
());
for
(
uint8_t
i
=
0
;
i
<
4
;
i
++
)
{
for
(
uint8_t
i
=
0
;
i
<
4
;
i
++
)
{
result
[
"blsPublicKeyShare"
][
i
]
=
public_key_vect
.
at
(
i
);
result
[
"blsPublicKeyShare"
][
i
]
=
public_key_vect
.
at
(
i
);
result
[
"BlsPublicKeyShare"
][
i
]
=
public_key_vect
.
at
(
i
);
}
}
}
catch
(
RPCException
&
_e
)
{
}
catch
(
RPCException
&
_e
)
{
...
@@ -659,6 +666,7 @@ Json::Value SGXWalletServer::complaintResponseImpl(const string &_polyName, int
...
@@ -659,6 +666,7 @@ Json::Value SGXWalletServer::complaintResponseImpl(const string &_polyName, int
result
[
"share*G2"
]
=
*
shareG2_ptr
;
result
[
"share*G2"
]
=
*
shareG2_ptr
;
result
[
"dhKey"
]
=
DHKey
;
result
[
"dhKey"
]
=
DHKey
;
result
[
"DHKey"
]
=
DHKey
;
}
catch
(
RPCException
&
_e
)
{
}
catch
(
RPCException
&
_e
)
{
cerr
<<
" err str "
<<
_e
.
errString
<<
endl
;
cerr
<<
" err str "
<<
_e
.
errString
<<
endl
;
...
@@ -694,10 +702,12 @@ Json::Value SGXWalletServer::isPolyExistsImpl(const string &_polyName) {
...
@@ -694,10 +702,12 @@ Json::Value SGXWalletServer::isPolyExistsImpl(const string &_polyName) {
try
{
try
{
std
::
shared_ptr
<
std
::
string
>
poly_str_ptr
=
LevelDB
::
getLevelDb
()
->
readString
(
_polyName
);
std
::
shared_ptr
<
std
::
string
>
poly_str_ptr
=
LevelDB
::
getLevelDb
()
->
readString
(
_polyName
);
result
[
"IsExist"
]
=
true
;
result
[
"IsExist"
]
=
true
;
result
[
"exists"
]
=
true
;
result
[
"status"
]
=
0
;
result
[
"status"
]
=
0
;
result
[
"errorMessage"
]
=
""
;
result
[
"errorMessage"
]
=
""
;
if
(
poly_str_ptr
==
nullptr
)
{
if
(
poly_str_ptr
==
nullptr
)
{
result
[
"IsExist"
]
=
false
;
result
[
"IsExist"
]
=
false
;
result
[
"exists"
]
=
false
;
result
[
"status"
]
=
0
;
result
[
"status"
]
=
0
;
result
[
"errorMessage"
]
=
""
;
result
[
"errorMessage"
]
=
""
;
}
}
...
@@ -706,6 +716,7 @@ Json::Value SGXWalletServer::isPolyExistsImpl(const string &_polyName) {
...
@@ -706,6 +716,7 @@ Json::Value SGXWalletServer::isPolyExistsImpl(const string &_polyName) {
result
[
"status"
]
=
_e
.
status
;
result
[
"status"
]
=
_e
.
status
;
result
[
"errorMessage"
]
=
_e
.
errString
;
result
[
"errorMessage"
]
=
_e
.
errString
;
result
[
"IsExist"
]
=
false
;
result
[
"IsExist"
]
=
false
;
result
[
"exists"
]
=
false
;
}
}
return
result
;
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