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
a2fdbcb7
Unverified
Commit
a2fdbcb7
authored
Mar 24, 2020
by
kladko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SKALE-2341 Added tags for older commits
parent
4e26af8b
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
392 additions
and
439 deletions
+392
-439
BLSCrypto.cpp
BLSCrypto.cpp
+139
-142
DKGCrypto.cpp
DKGCrypto.cpp
+241
-273
ECDSACrypto.cpp
ECDSACrypto.cpp
+3
-9
LevelDB.cpp
LevelDB.cpp
+8
-11
SEKManager.cpp
SEKManager.cpp
+0
-2
ServerInit.cpp
ServerInit.cpp
+1
-2
No files found.
BLSCrypto.cpp
View file @
a2fdbcb7
This diff is collapsed.
Click to expand it.
DKGCrypto.cpp
View file @
a2fdbcb7
This diff is collapsed.
Click to expand it.
ECDSACrypto.cpp
View file @
a2fdbcb7
...
...
@@ -61,13 +61,10 @@ std::vector<std::string> genECDSAKey() {
throw
RPCException
(
status
,
errMsg
);
}
std
::
vector
<
std
::
string
>
keys
(
3
);
if
(
printDebugInfo
)
{
std
::
cerr
<<
"account key is "
<<
errMsg
<<
std
::
endl
;
std
::
cerr
<<
"enc_len is "
<<
enc_len
<<
std
::
endl
;
// std::cerr << "enc_key is " << std::endl;
// for(int i = 0 ; i < 1024; i++)
// std::cerr << (int)encr_pr_key[i] << " " ;
}
char
*
hexEncrKey
=
(
char
*
)
calloc
(
BUF_LEN
*
2
,
1
);
carray2Hex
(
encr_pr_key
,
enc_len
,
hexEncrKey
);
keys
.
at
(
0
)
=
hexEncrKey
;
...
...
@@ -77,10 +74,8 @@ std::vector<std::string> genECDSAKey() {
unsigned
long
seed
=
randGen
();
if
(
printDebugInfo
)
{
spdlog
::
debug
(
"seed is {}"
,
seed
);
std
::
cerr
<<
"strlen is "
<<
strlen
(
hexEncrKey
)
<<
std
::
endl
;
}
gmp_randstate_t
state
;
gmp_randinit_default
(
state
);
...
...
@@ -133,13 +128,12 @@ std::string getECDSAPubKey(const char *_encryptedKeyHex) {
}
string
pubKey
=
string
(
pubKeyX
.
data
())
+
string
(
pubKeyY
.
data
());
//concatPubKeyWith0x(pub_key_x, pub_key_y);//
if
(
printDebugInfo
)
{
spdlog
::
debug
(
"enc_len is {}"
,
enc_len
);
spdlog
::
debug
(
"pubkey is {}"
,
pubKey
);
spdlog
::
debug
(
"pubkey length is {}"
,
pubKey
.
length
());
spdlog
::
debug
(
"err str is {}"
,
errMsg
.
data
());
spdlog
::
debug
(
"err status is {}"
,
err_status
);
}
return
pubKey
;
}
...
...
LevelDB.cpp
View file @
a2fdbcb7
...
...
@@ -62,10 +62,10 @@ std::shared_ptr<string> LevelDB::readString(const string &_key) {
auto
status
=
db
->
Get
(
readOptions
,
_key
,
&*
result
);
if
(
printDebugInfo
)
{
spdlog
::
debug
(
"key to read from db: {}"
,
_key
);
//std::cerr << "key to read from db: " << _key << std::endl;
}
throwExceptionOnError
(
status
);
...
...
@@ -83,10 +83,10 @@ void LevelDB::writeString(const string &_key, const string &_value) {
throwExceptionOnError
(
status
);
if
(
printDebugInfo
)
{
spdlog
::
debug
(
"written key: {}"
,
_key
);
// std::cerr << "written key " << _key << std::endl;
}
}
...
...
@@ -100,10 +100,9 @@ void LevelDB::deleteDHDKGKey (const string &_key) {
throwExceptionOnError
(
status
);
if
(
printDebugInfo
)
{
spdlog
::
debug
(
"key deleted: {}"
,
full_key
);
//std::cerr << "key deleted " << full_key << std::endl;
}
}
void
LevelDB
::
deleteTempNEK
(
const
string
&
_key
){
...
...
@@ -130,10 +129,9 @@ void LevelDB::deleteKey(const string &_key){
throwExceptionOnError
(
status
);
if
(
printDebugInfo
)
{
spdlog
::
debug
(
"key deleted: {}"
,
_key
);
// std::cerr << "key deleted " << _key << std::endl;
}
}
...
...
@@ -219,10 +217,9 @@ void LevelDB::writeDataUnique(const string & Name, const string &value) {
}
writeString
(
key
,
value
);
if
(
printDebugInfo
)
{
spdlog
::
debug
(
"{}"
,
Name
,
" is written to db"
);
//std::cerr << Name << " is written to db " << std::endl;
}
}
...
...
SEKManager.cpp
View file @
a2fdbcb7
...
...
@@ -231,8 +231,6 @@ void init_SEK(){
gen_SEK
();
}
else
{
if
(
printDebugInfo
)
spdlog
::
info
(
"going to set SEK from db"
);
set_SEK
(
encr_SEK_ptr
);
}
}
...
...
ServerInit.cpp
View file @
a2fdbcb7
...
...
@@ -77,9 +77,8 @@ void initEnclave() {
}
#endif
if
(
printDebugInfo
)
{
spdlog
::
debug
(
"SGX_DEBUG_FLAG = {}"
,
SGX_DEBUG_FLAG
);
}
status
=
sgx_create_enclave_search
(
ENCLAVE_NAME
,
SGX_DEBUG_FLAG
,
&
token
,
&
updated
,
&
eid
,
0
);
...
...
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