Fixes

parent b090bd54
...@@ -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 encrypt_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;
......
...@@ -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 encrypt_key ([user_check] mpf_t *pi, uint64_t digits);
}; };
......
...@@ -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= encrypt_key(eid, &pi, digits);
if ( status != SGX_SUCCESS ) { if ( status != SGX_SUCCESS ) {
fprintf(stderr, "ECALL e_pi: 0x%04x\n", status); fprintf(stderr, "ECALL encrypt_key: 0x%04x\n", status);
return 1; return 1;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment