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
6b7165fb
Unverified
Commit
6b7165fb
authored
Apr 17, 2020
by
kladko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SKALE-2454-add-logs-to-enclave
parent
4a103ecf
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
13 deletions
+13
-13
BLSCrypto.cpp
BLSCrypto.cpp
+1
-1
DKGCrypto.cpp
DKGCrypto.cpp
+1
-1
ECDSACrypto.cpp
ECDSACrypto.cpp
+2
-2
secure_enclave.c
secure_enclave/secure_enclave.c
+5
-5
secure_enclave.edl
secure_enclave/secure_enclave.edl
+4
-4
No files found.
BLSCrypto.cpp
View file @
6b7165fb
...
@@ -266,7 +266,7 @@ bool sign_aes(const char *_encryptedKeyHex, const char *_hashHex, size_t _t, siz
...
@@ -266,7 +266,7 @@ bool sign_aes(const char *_encryptedKeyHex, const char *_hashHex, size_t _t, siz
}
}
sgx_status_t
status
=
sgx_status_t
status
=
trustedBlsSignMessage
_aes
(
eid
,
&
errStatus
,
errMsg
,
encryptedKey
,
trustedBlsSignMessage
AES
(
eid
,
&
errStatus
,
errMsg
,
encryptedKey
,
sz
,
xStrArg
,
yStrArg
,
signature
);
sz
,
xStrArg
,
yStrArg
,
signature
);
...
...
DKGCrypto.cpp
View file @
6b7165fb
...
@@ -300,7 +300,7 @@ bool CreateBLSShare(const string &blsKeyName, const char *s_shares, const char *
...
@@ -300,7 +300,7 @@ bool CreateBLSShare(const string &blsKeyName, const char *s_shares, const char *
if
(
!
encryptKeys
)
if
(
!
encryptKeys
)
trustedCreateBlsKey
(
eid
,
&
errStatus
,
errMsg
,
s_shares
,
encr_key
,
decKeyLen
,
encr_bls_key
,
&
enc_bls_len
);
trustedCreateBlsKey
(
eid
,
&
errStatus
,
errMsg
,
s_shares
,
encr_key
,
decKeyLen
,
encr_bls_key
,
&
enc_bls_len
);
else
else
trustedCreateBlsKey
_aes
(
eid
,
&
errStatus
,
errMsg
,
s_shares
,
encr_key
,
decKeyLen
,
encr_bls_key
,
&
enc_bls_len
);
trustedCreateBlsKey
AES
(
eid
,
&
errStatus
,
errMsg
,
s_shares
,
encr_key
,
decKeyLen
,
encr_bls_key
,
&
enc_bls_len
);
if
(
errStatus
!=
0
)
{
if
(
errStatus
!=
0
)
{
...
...
ECDSACrypto.cpp
View file @
6b7165fb
...
@@ -54,7 +54,7 @@ std::vector<std::string> genECDSAKey() {
...
@@ -54,7 +54,7 @@ std::vector<std::string> genECDSAKey() {
if
(
!
encryptKeys
)
if
(
!
encryptKeys
)
status
=
trustedGenerateEcdsaKey
(
eid
,
&
errStatus
,
errMsg
,
encr_pr_key
,
&
enc_len
,
pub_key_x
,
pub_key_y
);
status
=
trustedGenerateEcdsaKey
(
eid
,
&
errStatus
,
errMsg
,
encr_pr_key
,
&
enc_len
,
pub_key_x
,
pub_key_y
);
else
else
status
=
trustedGenerateEcdsaKey
_aes
(
eid
,
&
errStatus
,
errMsg
,
encr_pr_key
,
&
enc_len
,
pub_key_x
,
pub_key_y
);
status
=
trustedGenerateEcdsaKey
AES
(
eid
,
&
errStatus
,
errMsg
,
encr_pr_key
,
&
enc_len
,
pub_key_x
,
pub_key_y
);
if
(
status
!=
SGX_SUCCESS
||
errStatus
!=
0
)
{
if
(
status
!=
SGX_SUCCESS
||
errStatus
!=
0
)
{
spdlog
::
error
(
"RPCException thrown with status {}"
,
status
);
spdlog
::
error
(
"RPCException thrown with status {}"
,
status
);
...
@@ -116,7 +116,7 @@ std::string getECDSAPubKey(const char *_encryptedKeyHex) {
...
@@ -116,7 +116,7 @@ std::string getECDSAPubKey(const char *_encryptedKeyHex) {
if
(
!
encryptKeys
)
if
(
!
encryptKeys
)
status
=
trustedGetPublicEcdsaKey
(
eid
,
&
errStatus
,
errMsg
.
data
(),
encrPrKey
.
data
(),
enc_len
,
pubKeyX
.
data
(),
status
=
trustedGetPublicEcdsaKey
(
eid
,
&
errStatus
,
errMsg
.
data
(),
encrPrKey
.
data
(),
enc_len
,
pubKeyX
.
data
(),
pubKeyY
.
data
());
pubKeyY
.
data
());
else
status
=
trustedGetPublicEcdsaKey
_aes
(
eid
,
&
errStatus
,
else
status
=
trustedGetPublicEcdsaKey
AES
(
eid
,
&
errStatus
,
errMsg
.
data
(),
encrPrKey
.
data
(),
enc_len
,
pubKeyX
.
data
(),
pubKeyY
.
data
());
errMsg
.
data
(),
encrPrKey
.
data
(),
enc_len
,
pubKeyX
.
data
(),
pubKeyY
.
data
());
if
(
errStatus
!=
0
)
{
if
(
errStatus
!=
0
)
{
throw
SGXException
(
-
666
,
errMsg
.
data
());
throw
SGXException
(
-
666
,
errMsg
.
data
());
...
...
secure_enclave/secure_enclave.c
View file @
6b7165fb
...
@@ -997,7 +997,7 @@ void trustedSetSEK_backup(int *errStatus, char *err_string,
...
@@ -997,7 +997,7 @@ void trustedSetSEK_backup(int *errStatus, char *err_string,
*
enc_len
=
sealedLen
;
*
enc_len
=
sealedLen
;
}
}
void
trustedGenerateEcdsaKey
_aes
(
int
*
errStatus
,
char
*
err_string
,
void
trustedGenerateEcdsaKey
AES
(
int
*
errStatus
,
char
*
err_string
,
uint8_t
*
encrypted_key
,
uint32_t
*
enc_len
,
char
*
pub_key_x
,
char
*
pub_key_y
)
{
uint8_t
*
encrypted_key
,
uint32_t
*
enc_len
,
char
*
pub_key_x
,
char
*
pub_key_y
)
{
domain_parameters
curve
=
domain_parameters_init
();
domain_parameters
curve
=
domain_parameters_init
();
...
@@ -1069,7 +1069,7 @@ void trustedGenerateEcdsaKey_aes(int *errStatus, char *err_string,
...
@@ -1069,7 +1069,7 @@ void trustedGenerateEcdsaKey_aes(int *errStatus, char *err_string,
point_clear
(
Pkey
);
point_clear
(
Pkey
);
}
}
void
trustedGetPublicEcdsaKey
_aes
(
int
*
errStatus
,
char
*
err_string
,
void
trustedGetPublicEcdsaKey
AES
(
int
*
errStatus
,
char
*
err_string
,
uint8_t
*
encrypted_key
,
uint32_t
enc_len
,
char
*
pub_key_x
,
char
*
pub_key_y
)
{
uint8_t
*
encrypted_key
,
uint32_t
enc_len
,
char
*
pub_key_x
,
char
*
pub_key_y
)
{
domain_parameters
curve
=
domain_parameters_init
();
domain_parameters
curve
=
domain_parameters_init
();
...
@@ -1315,7 +1315,7 @@ void decrypt_key_aes(int *errStatus, char *err_string, uint8_t *encrypted_key,
...
@@ -1315,7 +1315,7 @@ void decrypt_key_aes(int *errStatus, char *err_string, uint8_t *encrypted_key,
}
}
void
trustedBlsSignMessage
_aes
(
int
*
errStatus
,
char
*
err_string
,
uint8_t
*
encrypted_key
,
void
trustedBlsSignMessage
AES
(
int
*
errStatus
,
char
*
err_string
,
uint8_t
*
encrypted_key
,
uint32_t
enc_len
,
char
*
_hashX
,
uint32_t
enc_len
,
char
*
_hashX
,
char
*
_hashY
,
char
*
signature
)
{
char
*
_hashY
,
char
*
signature
)
{
...
@@ -1430,7 +1430,7 @@ void trustedGetEncryptedSecretShare_aes(int *errStatus, char *err_string, uint8_
...
@@ -1430,7 +1430,7 @@ void trustedGetEncryptedSecretShare_aes(int *errStatus, char *err_string, uint8_
uint32_t
enc_len
;
uint32_t
enc_len
;
trustedGenerateEcdsaKey
_aes
(
errStatus
,
err_string
,
encrypted_skey
,
&
enc_len
,
pub_key_x
,
pub_key_y
);
trustedGenerateEcdsaKey
AES
(
errStatus
,
err_string
,
encrypted_skey
,
&
enc_len
,
pub_key_x
,
pub_key_y
);
if
(
*
errStatus
!=
0
)
{
if
(
*
errStatus
!=
0
)
{
return
;
return
;
}
}
...
@@ -1587,7 +1587,7 @@ void trustedDkgVerify_aes(int *errStatus, char *err_string, const char *public_s
...
@@ -1587,7 +1587,7 @@ void trustedDkgVerify_aes(int *errStatus, char *err_string, const char *public_s
}
}
void
trustedCreateBlsKey
_aes
(
int
*
errStatus
,
char
*
err_string
,
const
char
*
s_shares
,
void
trustedCreateBlsKey
AES
(
int
*
errStatus
,
char
*
err_string
,
const
char
*
s_shares
,
uint8_t
*
encrypted_key
,
uint64_t
key_len
,
uint8_t
*
encr_bls_key
,
uint32_t
*
enc_bls_key_len
)
{
uint8_t
*
encrypted_key
,
uint64_t
key_len
,
uint8_t
*
encr_bls_key
,
uint32_t
*
enc_bls_key_len
)
{
char
skey
[
ECDSA_SKEY_LEN
];
char
skey
[
ECDSA_SKEY_LEN
];
...
...
secure_enclave/secure_enclave.edl
View file @
6b7165fb
...
@@ -185,7 +185,7 @@ enclave {
...
@@ -185,7 +185,7 @@ enclave {
[user_check] uint32_t *enc_len,
[user_check] uint32_t *enc_len,
[in, count = 65] const char* SEK_hex);
[in, count = 65] const char* SEK_hex);
public void trustedGenerateEcdsaKey
_aes
(
public void trustedGenerateEcdsaKey
AES
(
[user_check] int *errStatus,
[user_check] int *errStatus,
[out, count = SMALL_BUF_SIZE] char* err_string,
[out, count = SMALL_BUF_SIZE] char* err_string,
[out, count = ECDSA_ENCR_LEN] uint8_t* encrypted_key,
[out, count = ECDSA_ENCR_LEN] uint8_t* encrypted_key,
...
@@ -193,7 +193,7 @@ enclave {
...
@@ -193,7 +193,7 @@ enclave {
[out, count = SMALL_BUF_SIZE] char * pub_key_x,
[out, count = SMALL_BUF_SIZE] char * pub_key_x,
[out, count = SMALL_BUF_SIZE] char * pub_key_y);
[out, count = SMALL_BUF_SIZE] char * pub_key_y);
public void trustedGetPublicEcdsaKey
_aes
(
public void trustedGetPublicEcdsaKey
AES
(
[user_check] int *errStatus,
[user_check] int *errStatus,
[out, count = SMALL_BUF_SIZE] char* err_string,
[out, count = SMALL_BUF_SIZE] char* err_string,
[in, count = SMALL_BUF_SIZE] uint8_t* encrypted_key,
[in, count = SMALL_BUF_SIZE] uint8_t* encrypted_key,
...
@@ -280,7 +280,7 @@ enclave {
...
@@ -280,7 +280,7 @@ enclave {
[user_check] int* result);
[user_check] int* result);
public void trustedCreateBlsKey
_aes
(
public void trustedCreateBlsKey
AES
(
[user_check]int *errStatus,
[user_check]int *errStatus,
[out, count = SMALL_BUF_SIZE] char* err_string,
[out, count = SMALL_BUF_SIZE] char* err_string,
[in, count = 6145] const char* s_shares,
[in, count = 6145] const char* s_shares,
...
@@ -289,7 +289,7 @@ enclave {
...
@@ -289,7 +289,7 @@ enclave {
[out, count = SMALL_BUF_SIZE] uint8_t * encr_bls_key,
[out, count = SMALL_BUF_SIZE] uint8_t * encr_bls_key,
[user_check] uint32_t *enc_bls_key_len);
[user_check] uint32_t *enc_bls_key_len);
public void trustedBlsSignMessage
_aes
(
public void trustedBlsSignMessage
AES
(
[user_check] int *errStatus,
[user_check] int *errStatus,
[out, count = SMALL_BUF_SIZE] char* err_string,
[out, count = SMALL_BUF_SIZE] char* err_string,
[in, count = SMALL_BUF_SIZE] uint8_t* encrypted_key,
[in, count = SMALL_BUF_SIZE] uint8_t* encrypted_key,
...
...
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