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
d42dca7d
Unverified
Commit
d42dca7d
authored
Aug 27, 2019
by
a72d9e2bad9edfd58d6c0248c12c953b71d409d2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added gmp
parent
4b35d3f3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
9 deletions
+11
-9
secure_enclave.edl
secure_enclave/secure_enclave.edl
+2
-2
sgxd.c
sgxd.c
+9
-7
No files found.
secure_enclave/secure_enclave.edl
View file @
d42dca7d
...
...
@@ -22,9 +22,9 @@ enclave {
);
public void encrypt_key (
[user_check] mpf_t *pi,
[user_check] int *err_status,
[in, count = 100] char* key);
[in, count = 100] char* key,
[out, count = 100] char* encrypted_key);
};
...
...
sgxd.c
View file @
d42dca7d
...
...
@@ -45,7 +45,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
void
usage
();
void
usage
()
{
fprintf
(
stderr
,
"usage: sgx
gmppi digits
\n
"
);
fprintf
(
stderr
,
"usage: sgx
d
\n
"
);
exit
(
1
);
}
...
...
@@ -56,8 +56,6 @@ int main (int argc, char *argv[])
sgx_status_t
status
;
int
updated
=
0
;
unsigned
long
support
;
mpf_t
pi
;
uint64_t
digits
;
int
opt
;
while
(
(
opt
=
getopt
(
argc
,
argv
,
"h"
))
!=
-
1
)
{
...
...
@@ -71,14 +69,18 @@ int main (int argc, char *argv[])
argc
-=
optind
;
argv
+=
optind
;
if
(
argc
!=
1
)
usage
();
if
(
argc
!=
0
)
usage
();
/*
digits= strtoull(argv[0], NULL, 10);
if ( digits == 0 ) {
fprintf(stderr, "invalid digit count\n");
return 1;
}
*/
#ifndef SGX_HW_SIM
support
=
get_sgx_support
();
if
(
!
SGX_OK
(
support
)
)
{
...
...
@@ -112,18 +114,18 @@ int main (int argc, char *argv[])
fprintf
(
stderr
,
"libtgmp initialized
\n
"
);
mpf_init
(
pi
);
const
char
*
key
=
"4160780231445160889237664391382223604184857153814275770598791864649971919844"
;
char
keyArray
[
100
];
char
encryptedKey
[
100
];
strncpy
(
keyArray
,
key
,
100
);
int
err_status
=
-
2
;
status
=
encrypt_key
(
eid
,
&
pi
,
&
err_status
,
keyArra
y
);
status
=
encrypt_key
(
eid
,
&
err_status
,
keyArray
,
encryptedKe
y
);
if
(
status
!=
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