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
792b3861
Unverified
Commit
792b3861
authored
Aug 28, 2019
by
a72d9e2bad9edfd58d6c0248c12c953b71d409d2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added gmp
parent
16123e54
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
+17
-0
secure_enclave.c
secure_enclave/secure_enclave.c
+10
-0
secure_enclave.edl
secure_enclave/secure_enclave.edl
+7
-0
No files found.
secure_enclave/secure_enclave.c
View file @
792b3861
...
...
@@ -132,6 +132,8 @@ void encrypt_key(int *err_status, unsigned char* key, unsigned char* encrypted_k
*
err_status
=
-
4
;
memset
(
encrypted_key
,
0
,
sealedLen
);
if
(
sgx_seal_data
(
0
,
NULL
,
strlen
(
key
)
+
1
,
key
,
sealedLen
,
encrypted_key
)
!=
SGX_SUCCESS
)
return
;
...
...
@@ -140,3 +142,11 @@ void encrypt_key(int *err_status, unsigned char* key, unsigned char* encrypted_k
*
err_status
=
0
;
}
void
decrypt_key
(
int
*
err_status
,
unsigned
char
*
encrypted_key
,
unsigned
char
*
key
,
uint32_t
*
dec_len
)
{
*
err_status
=
-
1
;
}
secure_enclave/secure_enclave.edl
View file @
792b3861
...
...
@@ -25,6 +25,13 @@ enclave {
[user_check] int *err_status,
[in, count = 128] unsigned char* key,
[out, count = 1024] unsigned char* encrypted_key, [user_check] uint32_t *enc_len);
public void decrypt_key (
[user_check] int *err_status,
[in, count = 1024] unsigned char* encrypted_key,
[out, count = 128] unsigned char* key, [user_check] uint32_t *dec_len);
};
...
...
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