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
6e432708
Unverified
Commit
6e432708
authored
Mar 23, 2020
by
kladko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SKALE-2341 Added tags for older commits
parent
c6be9d1b
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
151 additions
and
184 deletions
+151
-184
DKGCrypto.cpp
DKGCrypto.cpp
+11
-11
SGXWalletServer.cpp
SGXWalletServer.cpp
+28
-60
testw.cpp
testw.cpp
+112
-113
No files found.
DKGCrypto.cpp
View file @
6e432708
...
...
@@ -213,8 +213,8 @@ string get_secret_shares(const string& polyName, const char* encryptedPolyHex, c
//char *hexEncrKey = (char *) calloc(2 * BUF_LEN, 1);
for
(
int
i
=
0
;
i
<
n
;
i
++
){
uint8_t
encrypted
_s
key
[
BUF_LEN
];
memset
(
encrypted
_s
key
,
0
,
BUF_LEN
);
uint8_t
encrypted
S
key
[
BUF_LEN
];
memset
(
encrypted
S
key
,
0
,
BUF_LEN
);
uint32_t
dec_len
;
char
cur_share
[
193
];
...
...
@@ -231,11 +231,11 @@ string get_secret_shares(const string& polyName, const char* encryptedPolyHex, c
}
if
(
!
encryptKeys
)
get_encr_sshare
(
eid
,
&
err_status
,
errMsg1
,
encrypted_skey
,
&
dec_len
,
cur_share
,
s_shareG2
,
pubKeyB
,
t
,
n
,
i
+
1
);
else
get_encr_sshare_aes
(
eid
,
&
err_status
,
errMsg1
,
encrypted_skey
,
&
dec_len
,
get_encr_sshare
(
eid
,
&
err_status
,
errMsg1
,
encryptedSkey
,
&
dec_len
,
cur_share
,
s_shareG2
,
pubKeyB
,
t
,
n
,
i
+
1
);
else
get_encr_sshare_aes
(
eid
,
&
err_status
,
errMsg1
,
encryptedSkey
,
&
dec_len
,
cur_share
,
s_shareG2
,
pubKeyB
,
t
,
n
,
i
+
1
);
if
(
err_status
!=
0
){
throw
RPCException
(
-
666
,
errMsg1
);
}
...
...
@@ -251,17 +251,17 @@ string get_secret_shares(const string& polyName, const char* encryptedPolyHex, c
}
carray2Hex
(
encrypted
_s
key
,
dec_len
,
hexEncrKey
);
carray2Hex
(
encrypted
S
key
,
dec_len
,
hexEncrKey
);
string
DHKey_n
ame
=
"DKG_DH_KEY_"
+
polyName
+
"_"
+
to_string
(
i
)
+
":"
;
string
dhKeyN
ame
=
"DKG_DH_KEY_"
+
polyName
+
"_"
+
to_string
(
i
)
+
":"
;
cerr
<<
"hexEncr DH Key: "
<<
hexEncrKey
<<
endl
;
SGXWalletServer
::
writeDataToDB
(
DHKey_n
ame
,
hexEncrKey
);
spdlog
::
debug
(
"hexEncr DH Key: { }"
,
hexEncrKey
)
;
SGXWalletServer
::
writeDataToDB
(
dhKeyN
ame
,
hexEncrKey
);
string
shareG2_name
=
"shareG2_"
+
polyName
+
"_"
+
to_string
(
i
)
+
":"
;
if
(
printDebugInfo
)
{
spdlog
::
info
(
"name to write to db is {}"
,
DHKey_n
ame
);
spdlog
::
info
(
"name to write to db is {}"
,
dhKeyN
ame
);
spdlog
::
info
(
"name to write to db is {}"
,
shareG2_name
);
spdlog
::
info
(
"s_shareG2: {}"
,
s_shareG2
);
}
...
...
SGXWalletServer.cpp
View file @
6e432708
This diff is collapsed.
Click to expand it.
testw.cpp
View file @
6e432708
This diff is collapsed.
Click to expand it.
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