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
41843cf8
Unverified
Commit
41843cf8
authored
Jun 05, 2020
by
Oleh Nikolaiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SKALE-2002 clean up
parent
fb830e75
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
14 deletions
+0
-14
DKGCrypto.cpp
DKGCrypto.cpp
+0
-14
No files found.
DKGCrypto.cpp
View file @
41843cf8
...
...
@@ -104,15 +104,12 @@ string gen_dkg_poly(int _t) {
}
vector
<
vector
<
string
>>
get_verif_vect
(
const
char
*
encryptedPolyHex
,
int
t
,
int
n
)
{
vector
<
char
>
errMsg1
(
BUF_LEN
,
0
);
int
errStatus
=
0
;
spdlog
::
debug
(
"got encr poly size {}"
,
char_traits
<
char
>::
length
(
encryptedPolyHex
));
vector
<
char
>
pubShares
(
10000
,
0
);
uint64_t
encLen
=
0
;
...
...
@@ -152,13 +149,11 @@ vector<vector<string>> get_verif_vect(const char *encryptedPolyHex, int t, int n
string
trustedGetSecretShares
(
const
string
&
_polyName
,
const
char
*
_encryptedPolyHex
,
const
vector
<
string
>
&
_publicKeys
,
int
_t
,
int
_n
)
{
vector
<
char
>
errMsg1
(
BUF_LEN
,
0
);
vector
<
char
>
hexEncrKey
(
BUF_LEN
,
0
);
int
errStatus
=
0
;
uint64_t
encLen
=
0
;
vector
<
uint8_t
>
encrDKGPoly
(
BUF_LEN
,
0
);
if
(
!
hex2carray2
(
_encryptedPolyHex
,
&
encLen
,
encrDKGPoly
.
data
(),
6100
))
{
...
...
@@ -173,7 +168,6 @@ string trustedGetSecretShares(const string &_polyName, const char *_encryptedPol
string
result
;
for
(
int
i
=
0
;
i
<
_n
;
i
++
)
{
vector
<
uint8_t
>
encryptedSkey
(
BUF_LEN
,
0
);
uint32_t
decLen
;
...
...
@@ -252,10 +246,8 @@ verifyShares(const char *publicShares, const char *encr_sshare, const char *encr
}
bool
CreateBLSShare
(
const
string
&
blsKeyName
,
const
char
*
s_shares
,
const
char
*
encryptedKeyHex
)
{
spdlog
::
debug
(
"ENTER CreateBLSShare"
);
// char* errMsg1 = (char*) calloc(1024,1);
char
errMsg
[
BUF_LEN
];
int
errStatus
=
0
;
...
...
@@ -278,21 +270,17 @@ bool CreateBLSShare(const string &blsKeyName, const char *s_shares, const char *
spdlog
::
error
(
"status {}"
,
errStatus
);
throw
SGXException
(
ERROR_IN_ENCLAVE
,
"Create BLS private key failed in enclave"
);
}
else
{
char
hexBLSKey
[
2
*
BUF_LEN
];
carray2Hex
(
encr_bls_key
,
enc_bls_len
,
hexBLSKey
);
SGXWalletServer
::
writeDataToDB
(
blsKeyName
,
hexBLSKey
);
return
true
;
}
}
vector
<
string
>
GetBLSPubKey
(
const
char
*
encryptedKeyHex
)
{
char
errMsg1
[
BUF_LEN
];
int
errStatus
=
0
;
...
...
@@ -323,7 +311,6 @@ vector<string> GetBLSPubKey(const char *encryptedKeyHex) {
}
string
decryptDHKey
(
const
string
&
polyName
,
int
ind
)
{
vector
<
char
>
errMsg1
(
1024
,
0
);
int
errStatus
=
0
;
...
...
@@ -342,7 +329,6 @@ string decryptDHKey(const string &polyName, int ind) {
spdlog
::
debug
(
"encr DH key length is {}"
,
dhEncLen
);
spdlog
::
debug
(
"hex encr DH key length is {}"
,
hexEncrKeyPtr
->
length
());
char
DHKey
[
ECDSA_SKEY_LEN
];
trustedDecryptKeyAES
(
eid
,
&
errStatus
,
errMsg1
.
data
(),
encryptedDHKey
,
dhEncLen
,
DHKey
);
...
...
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