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
193dcbf4
Unverified
Commit
193dcbf4
authored
Sep 10, 2019
by
kladkogex
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed calls
parent
a46e2251
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
15 deletions
+56
-15
SGXWalletServer.cpp
SGXWalletServer.cpp
+40
-10
SGXWalletServer.hpp
SGXWalletServer.hpp
+16
-5
No files found.
SGXWalletServer.cpp
View file @
193dcbf4
...
...
@@ -79,7 +79,8 @@ int init_server() {
Json
::
Value
SGXWalletServer
::
importBLSKeyShare
(
int
index
,
const
std
::
string
&
_keyShare
,
const
std
::
string
&
_keyShareName
,
int
n
,
int
t
)
{
Json
::
Value
importBLSKeyShareImpl
(
int
index
,
const
std
::
string
&
_keyShare
,
const
std
::
string
&
_keyShareName
,
int
n
,
int
t
)
{
Json
::
Value
result
;
...
...
@@ -98,14 +99,15 @@ Json::Value SGXWalletServer::importBLSKeyShare(int index, const std::string& _k
return
result
;
}
Json
::
Value
SGXWalletServer
::
blsSignMessageHash
(
const
std
::
string
&
keyShareName
,
const
std
::
string
&
messageHash
)
{
Json
::
Value
blsSignMessageHashImpl
(
const
std
::
string
&
keyShareName
,
const
std
::
string
&
messageHash
)
{
Json
::
Value
result
;
result
[
"status"
]
=
0
;
result
[
"errorMessage"
]
=
""
;
result
[
"signatureShare"
]
=
""
;
try
{
readKeyShare
(
keyShareName
);
}
catch
(
RPCException
&
_e
)
{
...
...
@@ -117,7 +119,8 @@ Json::Value SGXWalletServer::blsSignMessageHash(const std::string& keyShareName,
return
result
;
}
Json
::
Value
SGXWalletServer
::
importECDSAKey
(
const
std
::
string
&
key
,
const
std
::
string
&
keyName
)
{
Json
::
Value
importECDSAKeyImpl
(
const
std
::
string
&
key
,
const
std
::
string
&
keyName
)
{
Json
::
Value
result
;
result
[
"status"
]
=
0
;
result
[
"errorMessage"
]
=
""
;
...
...
@@ -125,7 +128,9 @@ Json::Value SGXWalletServer::importECDSAKey(const std::string& key, const std::s
return
result
;
}
Json
::
Value
SGXWalletServer
::
generateECDSAKey
(
const
std
::
string
&
_keyName
)
{
Json
::
Value
generateECDSAKeyImpl
(
const
std
::
string
&
_keyName
)
{
Json
::
Value
result
;
...
...
@@ -140,7 +145,11 @@ Json::Value SGXWalletServer::generateECDSAKey(const std::string& _keyName) {
result
[
"errorMessage"
]
=
_e
.
errString
;
}
}
Json
::
Value
SGXWalletServer
::
ecdsaSignMessageHash
(
const
std
::
string
&
_keyName
,
const
std
::
string
&
messageHash
)
{
Json
::
Value
ecdsaSignMessageHashImpl
(
const
std
::
string
&
_keyName
,
const
std
::
string
&
messageHash
)
{
Json
::
Value
result
;
result
[
"status"
]
=
0
;
result
[
"errorMessage"
]
=
""
;
...
...
@@ -157,10 +166,31 @@ Json::Value SGXWalletServer::ecdsaSignMessageHash(const std::string& _keyName,
return
result
;
}
Json
::
Value
SGXWalletServer
::
generateECDSAKey
(
const
std
::
string
&
_keyName
)
{
return
generateECDSAKeyImpl
(
_keyName
);
}
Json
::
Value
SGXWalletServer
::
ecdsaSignMessageHash
(
const
std
::
string
&
_keyName
,
const
std
::
string
&
messageHash
)
{
ecdsaSignMessageHashImpl
(
_keyName
,
messageHash
);
}
Json
::
Value
SGXWalletServer
::
importBLSKeyShare
(
int
index
,
const
std
::
string
&
_keyShare
,
const
std
::
string
&
_keyShareName
,
int
n
,
int
t
)
{
return
importBLSKeyShareImpl
(
index
,
_keyShare
,
_keyShareName
,
n
,
t
);
}
Json
::
Value
SGXWalletServer
::
blsSignMessageHash
(
const
std
::
string
&
keyShareName
,
const
std
::
string
&
messageHash
)
{
return
blsSignMessageHashImpl
(
keyShareName
,
messageHash
);
}
Json
::
Value
SGXWalletServer
::
importECDSAKey
(
const
std
::
string
&
key
,
const
std
::
string
&
keyName
)
{
return
importECDSAKeyImpl
(
key
,
keyName
);
}
shared_ptr
<
string
>
SGXWalletServer
::
readKeyShare
(
const
string
&
_keyShareName
)
{
shared_ptr
<
string
>
readKeyShare
(
const
string
&
_keyShareName
)
{
auto
keyShareStr
=
levelDb
->
readString
(
"BLSKEYSHARE:"
+
_keyShareName
);
...
...
@@ -173,7 +203,7 @@ shared_ptr<string> SGXWalletServer::readKeyShare(const string& _keyShareName) {
}
void
SGXWalletServer
::
writeKeyShare
(
const
string
&
_keyShareName
,
const
string
&
value
)
{
void
writeKeyShare
(
const
string
&
_keyShareName
,
const
string
&
value
)
{
auto
key
=
"BLSKEYSHARE:"
+
_keyShareName
;
...
...
@@ -185,10 +215,10 @@ void SGXWalletServer::writeKeyShare(const string& _keyShareName, const string& v
levelDb
->
writeString
(
key
,
value
);
}
shared_ptr
<
std
::
string
>
SGXWalletServer
::
readECDSAKey
(
const
string
&
_keyShare
)
{
shared_ptr
<
std
::
string
>
readECDSAKey
(
const
string
&
_keyShare
)
{
}
void
SGXWalletServer
::
writeECDSAKey
(
const
string
&
_keyShare
,
const
string
&
value
)
{
void
writeECDSAKey
(
const
string
&
_keyShare
,
const
string
&
value
)
{
}
\ No newline at end of file
SGXWalletServer.hpp
View file @
193dcbf4
...
...
@@ -25,17 +25,28 @@ public:
virtual
Json
::
Value
ecdsaSignMessageHash
(
const
std
::
string
&
keyShareName
,
const
std
::
string
&
messageHash
);
void
writeKeyShare
(
const
string
&
_keyShare
,
const
string
&
value
);
shared_ptr
<
std
::
string
>
readKeyShare
(
const
string
&
_keyShare
);
void
writeECDSAKey
(
const
string
&
_key
,
const
string
&
value
);
shared_ptr
<
std
::
string
>
readECDSAKey
(
const
string
&
_key
)
;
}
;
};
void
writeKeyShare
(
const
string
&
_keyShare
,
const
string
&
value
);
shared_ptr
<
std
::
string
>
readKeyShare
(
const
string
&
_keyShare
);
void
writeECDSAKey
(
const
string
&
_key
,
const
string
&
value
);
shared_ptr
<
std
::
string
>
readECDSAKey
(
const
string
&
_key
);
Json
::
Value
importBLSKeyShareImpl
(
int
index
,
const
std
::
string
&
keyShare
,
const
std
::
string
&
keyShareName
,
int
n
,
int
t
);
Json
::
Value
blsSignMessageHashImpl
(
const
std
::
string
&
keyShareName
,
const
std
::
string
&
messageHash
);
Json
::
Value
importECDSAKeyImpl
(
const
std
::
string
&
key
,
const
std
::
string
&
keyName
);
Json
::
Value
generateECDSAKeyImpl
(
const
std
::
string
&
keyName
);
Json
::
Value
ecdsaSignMessageHashImpl
(
const
std
::
string
&
keyShareName
,
const
std
::
string
&
messageHash
);
...
...
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