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
10d98361
Unverified
Commit
10d98361
authored
Jul 16, 2020
by
kladko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SKALE-2871-reduce-sgx-logs
parent
6236c670
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
12 deletions
+12
-12
docker-compose.yml
run_sgx_sim/docker-compose.yml
+1
-1
secure_enclave.c
secure_enclave/secure_enclave.c
+11
-11
No files found.
run_sgx_sim/docker-compose.yml
View file @
10d98361
...
...
@@ -16,5 +16,5 @@ services:
max-size
:
"
10m"
max-file
:
"
4"
restart
:
unless-stopped
command
:
-s -y
-d
command
:
-s -y
secure_enclave/secure_enclave.c
View file @
10d98361
...
...
@@ -90,7 +90,7 @@ void trustedEnclaveInit(uint32_t _logLevel) {
enclave_init
();
LOG_
DEBUG
(
"SUCCESS
"
);
LOG_
INFO
(
"Successfully inited enclave
"
);
}
void
free_function
(
void
*
ptr
,
size_t
sz
)
{
...
...
@@ -1034,8 +1034,8 @@ void trustedGetPublicEcdsaKeyAES(int *errStatus, char *errString,
int
status
=
AES_decrypt
(
encryptedPrivateKey
,
enc_len
,
skey
);
skey
[
enc_len
-
SGX_AESGCM_MAC_SIZE
-
SGX_AESGCM_IV_SIZE
]
=
'\0'
;
LOG_
INFO
(
"ENCRYPTED SKEY"
);
LOG_
INFO
(
skey
);
LOG_
TRACE
(
"ENCRYPTED SKEY"
);
LOG_
TRACE
(
skey
);
if
(
status
!=
0
)
{
snprintf
(
errString
,
BUF_LEN
,
"AES_decrypt failed with status %d"
,
status
);
...
...
@@ -1059,17 +1059,17 @@ void trustedGetPublicEcdsaKeyAES(int *errStatus, char *errString,
return
;
}
LOG_
INFO
(
"SET STR SUCCESS"
);
LOG_
TRACE
(
"SET STR SUCCESS"
);
//Public key
point
Pkey
=
point_init
();
signature_extract_public_key
(
Pkey
,
privateKeyMpz
,
curve
);
LOG_
INFO
(
"SIGNATURE EXTRACT PK SUCCESS"
);
LOG_
TRACE
(
"SIGNATURE EXTRACT PK SUCCESS"
);
point
Pkey_test
=
point_init
();
point_multiplication
(
Pkey_test
,
privateKeyMpz
,
curve
->
G
,
curve
);
LOG_
INFO
(
"POINT MULTIPLICATION SUCCESS"
);
LOG_
TRACE
(
"POINT MULTIPLICATION SUCCESS"
);
if
(
!
point_cmp
(
Pkey
,
Pkey_test
))
{
snprintf
(
errString
,
BUF_LEN
,
"Points are not equal"
);
...
...
@@ -1082,14 +1082,14 @@ void trustedGetPublicEcdsaKeyAES(int *errStatus, char *errString,
return
;
}
LOG_
INFO
(
"POINTS CMP SUCCESS"
);
LOG_
TRACE
(
"POINTS CMP SUCCESS"
);
int
len
=
mpz_sizeinbase
(
Pkey
->
x
,
ECDSA_SKEY_BASE
)
+
2
;
char
arr_x
[
len
];
mpz_get_str
(
arr_x
,
ECDSA_SKEY_BASE
,
Pkey
->
x
);
LOG_
INFO
(
"GET STR X SUCCESS"
);
LOG_
INFO
(
arr_x
);
LOG_
TRACE
(
"GET STR X SUCCESS"
);
LOG_
TRACE
(
arr_x
);
int
n_zeroes
=
64
-
strlen
(
arr_x
);
for
(
int
i
=
0
;
i
<
n_zeroes
;
i
++
)
{
...
...
@@ -1100,8 +1100,8 @@ void trustedGetPublicEcdsaKeyAES(int *errStatus, char *errString,
char
arr_y
[
mpz_sizeinbase
(
Pkey
->
y
,
ECDSA_SKEY_BASE
)
+
2
];
mpz_get_str
(
arr_y
,
ECDSA_SKEY_BASE
,
Pkey
->
y
);
LOG_
INFO
(
"GET STR Y SUCCESS"
);
LOG_
INFO
(
arr_y
);
LOG_
TRACE
(
"GET STR Y SUCCESS"
);
LOG_
TRACE
(
arr_y
);
n_zeroes
=
64
-
strlen
(
arr_y
);
for
(
int
i
=
0
;
i
<
n_zeroes
;
i
++
)
{
pub_key_y
[
i
]
=
'0'
;
...
...
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