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
178bc543
Unverified
Commit
178bc543
authored
Nov 09, 2020
by
kladko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SKALE-3480-remove-set-DKG-poly-call
parent
90460056
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
21 deletions
+14
-21
DKGCrypto.cpp
DKGCrypto.cpp
+5
-11
VERSION
VERSION
+1
-1
secure_enclave.c
secure_enclave/secure_enclave.c
+1
-1
secure_enclave.edl
secure_enclave/secure_enclave.edl
+4
-0
testw.cpp
testw.cpp
+3
-8
No files found.
DKGCrypto.cpp
View file @
178bc543
...
...
@@ -197,7 +197,7 @@ vector <vector<string>> getVerificationVectorMult(const std::string& encryptedPo
vector
<
vector
<
string
>>
result
(
t
);
for
(
size_
t
i
=
0
;
i
<
t
;
++
i
)
{
for
(
in
t
i
=
0
;
i
<
t
;
++
i
)
{
libff
::
alt_bn128_G2
current_coefficient
;
current_coefficient
.
X
.
c0
=
libff
::
alt_bn128_Fq
(
verificationVector
[
i
][
0
].
c_str
());
current_coefficient
.
X
.
c1
=
libff
::
alt_bn128_Fq
(
verificationVector
[
i
][
1
].
c_str
());
...
...
@@ -224,7 +224,7 @@ getSecretShares(const string &_polyName, const char *_encryptedPolyHex, const ve
CHECK_STATE
(
_encryptedPolyHex
);
vector
<
char
>
hexEncrKey
(
BUF_LEN
,
0
);
vector
<
char
>
errMsg
1
(
BUF_LEN
,
0
);
vector
<
char
>
errMsg
(
BUF_LEN
,
0
);
vector
<
uint8_t
>
encrDKGPoly
(
BUF_LEN
,
0
);
int
errStatus
=
0
;
uint64_t
encLen
=
0
;
...
...
@@ -256,27 +256,21 @@ getSecretShares(const string &_polyName, const char *_encryptedPolyHex, const ve
sgx_status_t
status
=
SGX_SUCCESS
;
status
=
trustedGetEncryptedSecretShare
(
eid
,
&
errStatus
,
errMsg
.
data
(),
encrDKGPoly
.
data
(),
encLen
,
e
rrMsg1
.
data
(),
e
ncryptedSkey
.
data
(),
&
decLen
,
encryptedSkey
.
data
(),
&
decLen
,
currentShare
.
data
(),
sShareG2
.
data
(),
pubKeyB
.
data
(),
_t
,
_n
,
i
+
1
);
HANDLE_TRUSTED_FUNCTION_ERROR
(
status
,
errStatus
,
errMsg
1
.
data
());
HANDLE_TRUSTED_FUNCTION_ERROR
(
status
,
errStatus
,
errMsg
.
data
());
spdlog
::
debug
(
"cur_share is {}"
,
currentShare
.
data
());
result
+=
string
(
currentShare
.
data
());
spdlog
::
debug
(
"dec len is {}"
,
decLen
);
hexEncrKey
=
carray2Hex
(
encryptedSkey
.
data
(),
decLen
);
string
dhKeyName
=
"DKG_DH_KEY_"
+
_polyName
+
"_"
+
to_string
(
i
)
+
":"
;
spdlog
::
debug
(
"hexEncr DH Key: { }"
,
hexEncrKey
.
data
());
spdlog
::
debug
(
"name to write to db is {}"
,
dhKeyName
);
string
shareG2_name
=
"shareG2_"
+
_polyName
+
"_"
+
to_string
(
i
)
+
":"
;
spdlog
::
debug
(
"name to write to db is {}"
,
shareG2_name
);
spdlog
::
debug
(
"s_shareG2: {}"
,
sShareG2
.
data
());
SGXWalletServer
::
writeDataToDB
(
dhKeyName
,
hexEncrKey
.
data
());
SGXWalletServer
::
writeDataToDB
(
shareG2_name
,
sShareG2
.
data
());
...
...
VERSION
View file @
178bc543
1.58.6
\ No newline at end of file
1.58.7
\ No newline at end of file
secure_enclave/secure_enclave.c
View file @
178bc543
...
...
@@ -868,7 +868,7 @@ void trustedGetEncryptedSecretShare(int *errStatus, char *errString,
LOG_DEBUG
(
__FUNCTION__
);
trustedSetEncryptedDkgPoly
(
errS
tatus
,
errString
,
_encrypted_poly
,
_enc_len
);
trustedSetEncryptedDkgPoly
(
&
s
tatus
,
errString
,
_encrypted_poly
,
_enc_len
);
CHECK_STATUS2
(
"trustedSetEncryptedDkgPoly failed with status %d "
);
...
...
secure_enclave/secure_enclave.edl
View file @
178bc543
...
...
@@ -88,6 +88,10 @@ enclave {
[out, count = 3072] uint8_t* decrypted_dkg_secret
);
public void trustedGetEncryptedSecretShare(
[out]int *errStatus,
[out, count = SMALL_BUF_SIZE] char *err_string,
...
...
testw.cpp
View file @
178bc543
...
...
@@ -370,20 +370,15 @@ TEST_CASE_METHOD(TestFixture, "DKG AES encrypted secret shares test", "[dkg-aes-
REQUIRE
(
status
==
SGX_SUCCESS
);
REQUIRE
(
errStatus
==
SGX_SUCCESS
);
uint64_t
enc_len
=
encLen
;
PRINT_SRC_LINE
status
=
trustedSetEncryptedDkgPoly
(
eid
,
&
errStatus
,
errMsg
.
data
(),
encryptedDKGSecret
.
data
(),
enc_len
);
REQUIRE
(
status
==
SGX_SUCCESS
);
REQUIRE
(
errStatus
==
SGX_SUCCESS
);
vector
<
uint8_t
>
encrPRDHKey
(
BUF_LEN
,
0
);
string
pub_keyB
=
SAMPLE_PUBLIC_KEY_B
;
vector
<
char
>
s_shareG2
(
BUF_LEN
,
0
);
PRINT_SRC_LINE
status
=
trustedGetEncryptedSecretShare
(
eid
,
&
errStatus
,
errMsg
.
data
(),
encrPRDHKey
.
data
(),
&
encLen
,
status
=
trustedGetEncryptedSecretShare
(
eid
,
&
errStatus
,
errMsg
.
data
(),
encryptedDKGSecret
.
data
(),
encLen
,
encrPRDHKey
.
data
(),
&
encLen
,
result
.
data
(),
s_shareG2
.
data
(),
(
char
*
)
pub_keyB
.
data
(),
2
,
2
,
1
);
...
...
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