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
e0ddaf50
Unverified
Commit
e0ddaf50
authored
Aug 10, 2020
by
kladko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SKALE-3067-cleanup-sgx
parent
f483367e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
12 deletions
+13
-12
DKGCrypto.cpp
DKGCrypto.cpp
+1
-1
secure_enclave.c
secure_enclave/secure_enclave.c
+5
-5
secure_enclave.edl
secure_enclave/secure_enclave.edl
+4
-3
testw.cpp
testw.cpp
+3
-3
No files found.
DKGCrypto.cpp
View file @
e0ddaf50
...
@@ -166,7 +166,7 @@ string trustedGetSecretShares(const string &_polyName, const char *_encryptedPol
...
@@ -166,7 +166,7 @@ string trustedGetSecretShares(const string &_polyName, const char *_encryptedPol
throw
SGXException
(
INVALID_HEX
,
"Invalid encryptedPolyHex"
);
throw
SGXException
(
INVALID_HEX
,
"Invalid encryptedPolyHex"
);
}
}
status
=
trustedSetEncryptedDkgPolyAES
(
eid
,
&
errStatus
,
errMsg1
.
data
(),
encrDKGPoly
.
data
(),
&
encLen
);
status
=
trustedSetEncryptedDkgPolyAES
(
eid
,
&
errStatus
,
errMsg1
.
data
(),
encrDKGPoly
.
data
(),
encLen
);
if
(
status
!=
SGX_SUCCESS
||
errStatus
!=
0
)
{
if
(
status
!=
SGX_SUCCESS
||
errStatus
!=
0
)
{
throw
SGXException
(
-
666
,
errMsg1
.
data
());
throw
SGXException
(
-
666
,
errMsg1
.
data
());
...
...
secure_enclave/secure_enclave.c
View file @
e0ddaf50
...
@@ -1562,8 +1562,8 @@ trustedGenDkgSecretAES(int *errStatus, char *errString, uint8_t *encrypted_dkg_s
...
@@ -1562,8 +1562,8 @@ trustedGenDkgSecretAES(int *errStatus, char *errString, uint8_t *encrypted_dkg_s
void
void
trustedDecryptDkgSecretAES
(
int
*
errStatus
,
char
*
errString
,
uint8_t
*
encrypted_dkg_secret
,
trustedDecryptDkgSecretAES
(
int
*
errStatus
,
char
*
errString
,
uint8_t
*
encrypted_dkg_secret
,
uint
8_t
*
decrypted_dkg_secret
,
uint
32_t
enc_len
,
uint
32_t
*
dec_len
)
{
uint
8_t
*
decrypted_dkg_secret
)
{
*
errString
=
0
;
*
errString
=
0
;
*
errStatus
=
UNKNOWN_ERROR
;
*
errStatus
=
UNKNOWN_ERROR
;
...
@@ -1573,7 +1573,7 @@ trustedDecryptDkgSecretAES(int *errStatus, char *errString, uint8_t *encrypted_d
...
@@ -1573,7 +1573,7 @@ trustedDecryptDkgSecretAES(int *errStatus, char *errString, uint8_t *encrypted_d
CHECK_STATE
(
encrypted_dkg_secret
);
CHECK_STATE
(
encrypted_dkg_secret
);
CHECK_STATE
(
decrypted_dkg_secret
);
CHECK_STATE
(
decrypted_dkg_secret
);
int
status
=
AES_decrypt
(
encrypted_dkg_secret
,
*
de
c_len
,
(
char
*
)
decrypted_dkg_secret
,
int
status
=
AES_decrypt
(
encrypted_dkg_secret
,
en
c_len
,
(
char
*
)
decrypted_dkg_secret
,
3072
);
3072
);
if
(
status
!=
SGX_SUCCESS
)
{
if
(
status
!=
SGX_SUCCESS
)
{
...
@@ -1587,7 +1587,7 @@ trustedDecryptDkgSecretAES(int *errStatus, char *errString, uint8_t *encrypted_d
...
@@ -1587,7 +1587,7 @@ trustedDecryptDkgSecretAES(int *errStatus, char *errString, uint8_t *encrypted_d
}
}
void
trustedSetEncryptedDkgPolyAES
(
int
*
errStatus
,
char
*
errString
,
uint8_t
*
encrypted_poly
,
uint
64_t
*
enc_len
)
{
void
trustedSetEncryptedDkgPolyAES
(
int
*
errStatus
,
char
*
errString
,
uint8_t
*
encrypted_poly
,
uint
32_t
enc_len
)
{
LOG_DEBUG
(
__FUNCTION__
);
LOG_DEBUG
(
__FUNCTION__
);
*
errString
=
0
;
*
errString
=
0
;
...
@@ -1596,7 +1596,7 @@ void trustedSetEncryptedDkgPolyAES(int *errStatus, char *errString, uint8_t *enc
...
@@ -1596,7 +1596,7 @@ void trustedSetEncryptedDkgPolyAES(int *errStatus, char *errString, uint8_t *enc
CHECK_STATE
(
encrypted_poly
);
CHECK_STATE
(
encrypted_poly
);
memset
(
getThreadLocalDecryptedDkgPoly
(),
0
,
DKG_BUFER_LENGTH
);
memset
(
getThreadLocalDecryptedDkgPoly
(),
0
,
DKG_BUFER_LENGTH
);
int
status
=
AES_decrypt
(
encrypted_poly
,
*
enc_len
,
(
char
*
)
getThreadLocalDecryptedDkgPoly
(),
int
status
=
AES_decrypt
(
encrypted_poly
,
enc_len
,
(
char
*
)
getThreadLocalDecryptedDkgPoly
(),
DKG_BUFER_LENGTH
);
DKG_BUFER_LENGTH
);
if
(
status
!=
SGX_SUCCESS
)
{
if
(
status
!=
SGX_SUCCESS
)
{
...
...
secure_enclave/secure_enclave.edl
View file @
e0ddaf50
...
@@ -217,14 +217,15 @@ enclave {
...
@@ -217,14 +217,15 @@ enclave {
[out] int *errStatus,
[out] int *errStatus,
[out, count = SMALL_BUF_SIZE] char* err_string,
[out, count = SMALL_BUF_SIZE] char* err_string,
[in, count = 3050] uint8_t* encrypted_dkg_secret,
[in, count = 3050] uint8_t* encrypted_dkg_secret,
[out, count = 3072] uint8_t* decrypted_dkg_secret,
uint32_t enc_len,
[user_check] uint32_t* dec_len);
[out, count = 3072] uint8_t* decrypted_dkg_secret
);
public void trustedSetEncryptedDkgPolyAES(
public void trustedSetEncryptedDkgPolyAES(
[out] int *errStatus,
[out] int *errStatus,
[out, count = SMALL_BUF_SIZE] char* err_string,
[out, count = SMALL_BUF_SIZE] char* err_string,
[in, count = 3050] uint8_t* encrypted_poly,
[in, count = 3050] uint8_t* encrypted_poly,
[user_check] uint64_t*
enc_len);
uint32_t
enc_len);
public void trustedGetEncryptedSecretShareAES(
public void trustedGetEncryptedSecretShareAES(
[out]int *errStatus,
[out]int *errStatus,
...
...
testw.cpp
View file @
e0ddaf50
...
@@ -432,8 +432,8 @@ TEST_CASE_METHOD(TestFixture, "DKG AES public shares test", "[dkg-aes-pub-shares
...
@@ -432,8 +432,8 @@ TEST_CASE_METHOD(TestFixture, "DKG AES public shares test", "[dkg-aes-pub-shares
vector
<
char
>
secret
(
BUF_LEN
,
0
);
vector
<
char
>
secret
(
BUF_LEN
,
0
);
status
=
trustedDecryptDkgSecretAES
(
eid
,
&
errStatus
,
errMsg1
.
data
(),
encryptedDKGSecret
.
data
(),
status
=
trustedDecryptDkgSecretAES
(
eid
,
&
errStatus
,
errMsg1
.
data
(),
encryptedDKGSecret
.
data
(),
encLen
,
(
uint8_t
*
)
secret
.
data
()
,
&
encLen
);
(
uint8_t
*
)
secret
.
data
());
REQUIRE
(
status
==
SGX_SUCCESS
);
REQUIRE
(
status
==
SGX_SUCCESS
);
REQUIRE
(
errStatus
==
SGX_SUCCESS
);
REQUIRE
(
errStatus
==
SGX_SUCCESS
);
...
@@ -491,7 +491,7 @@ TEST_CASE_METHOD(TestFixture, "DKG AES encrypted secret shares test", "[dkg-aes-
...
@@ -491,7 +491,7 @@ TEST_CASE_METHOD(TestFixture, "DKG AES encrypted secret shares test", "[dkg-aes-
uint64_t
enc_len
=
encLen
;
uint64_t
enc_len
=
encLen
;
status
=
trustedSetEncryptedDkgPolyAES
(
eid
,
&
errStatus
,
errMsg
.
data
(),
encryptedDKGSecret
.
data
(),
&
enc_len
);
status
=
trustedSetEncryptedDkgPolyAES
(
eid
,
&
errStatus
,
errMsg
.
data
(),
encryptedDKGSecret
.
data
(),
enc_len
);
REQUIRE
(
status
==
SGX_SUCCESS
);
REQUIRE
(
status
==
SGX_SUCCESS
);
REQUIRE
(
errStatus
==
SGX_SUCCESS
);
REQUIRE
(
errStatus
==
SGX_SUCCESS
);
...
...
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