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
69188512
Unverified
Commit
69188512
authored
Aug 16, 2019
by
a72d9e2bad9edfd58d6c0248c12c953b71d409d2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes
parent
b090bd54
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
5 deletions
+8
-5
EnclaveGmpTest.c
EnclaveGmpTest/EnclaveGmpTest.c
+5
-2
EnclaveGmpTest.edl
EnclaveGmpTest/EnclaveGmpTest.edl
+1
-1
sgxgmppi.c
sgxgmppi.c
+2
-2
No files found.
EnclaveGmpTest/EnclaveGmpTest.c
View file @
69188512
...
@@ -177,8 +177,11 @@ void e_mpf_div(mpf_t *c_un, mpf_t *a_un, mpf_t *b_un)
...
@@ -177,8 +177,11 @@ void e_mpf_div(mpf_t *c_un, mpf_t *a_un, mpf_t *b_un)
mpz_t
c3
,
c4
,
c5
;
mpz_t
c3
,
c4
,
c5
;
int
pi_init
=
0
;
int
pi_init
=
0
;
void
e
_pi
(
mpf_t
*
pi_un
,
uint64_t
digits
)
void
e
ncrypt_key
(
mpf_t
*
pi_un
,
uint64_t
digits
)
{
{
import_key
();
mpf_t
pi
;
mpf_t
pi
;
/*
/*
...
@@ -204,7 +207,7 @@ void e_calc_pi (mpf_t *pi, uint64_t digits)
...
@@ -204,7 +207,7 @@ void e_calc_pi (mpf_t *pi, uint64_t digits)
mpz_t
kf
,
kf3
,
threekf
,
sixkf
,
z1
,
z2
,
c4k
,
c5_3k
;
mpz_t
kf
,
kf3
,
threekf
,
sixkf
,
z1
,
z2
,
c4k
,
c5_3k
;
mpf_t
C
,
sum
,
div
,
f2
;
mpf_t
C
,
sum
,
div
,
f2
;
import_key
();
n
=
(
digits
/
DIGITS_PER_ITERATION
)
+
1
;
n
=
(
digits
/
DIGITS_PER_ITERATION
)
+
1
;
precision
=
(
digits
*
bits
)
+
1
;
precision
=
(
digits
*
bits
)
+
1
;
...
...
EnclaveGmpTest/EnclaveGmpTest.edl
View file @
69188512
...
@@ -21,7 +21,7 @@ enclave {
...
@@ -21,7 +21,7 @@ enclave {
[user_check] mpf_t *c, [user_check] mpf_t *a, [user_check] mpf_t *b
[user_check] mpf_t *c, [user_check] mpf_t *a, [user_check] mpf_t *b
);
);
public void e
_pi
([user_check] mpf_t *pi, uint64_t digits);
public void e
ncrypt_key
([user_check] mpf_t *pi, uint64_t digits);
};
};
...
...
sgxgmppi.c
View file @
69188512
...
@@ -112,9 +112,9 @@ int main (int argc, char *argv[])
...
@@ -112,9 +112,9 @@ int main (int argc, char *argv[])
mpf_init
(
pi
);
mpf_init
(
pi
);
status
=
e
_pi
(
eid
,
&
pi
,
digits
);
status
=
e
ncrypt_key
(
eid
,
&
pi
,
digits
);
if
(
status
!=
SGX_SUCCESS
)
{
if
(
status
!=
SGX_SUCCESS
)
{
fprintf
(
stderr
,
"ECALL e
_pi
: 0x%04x
\n
"
,
status
);
fprintf
(
stderr
,
"ECALL e
ncrypt_key
: 0x%04x
\n
"
,
status
);
return
1
;
return
1
;
}
}
...
...
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