server_side_sgx/enclave/enc.c
// This is the function that the host calls. It prints
// a message in the enclave before calling back out to
// the host to print a message from there too.
This is the function that the host calls. It prints
a message in the enclave before calling back out to
the host to print a message from there too.
This is the function that the host calls . It prints a message in the enclave before calling back out to the host to print a message from there too .
void enclave_initialize(
    float* input_buf,
    size_t buf_size)
{
      Call back into the host
     oe_result_t result = host_secure_aggregation();
     if (result != OE_OK)
     {
         fprintf(
             stderr,
             "Call to host_secure_aggregation failed: result=%u (%s)\n",
             result,
             oe_result_str(result));
     }
     malloc memory for aggregate_buf
    aes_cbc_TA("decrypt", input_buf, (int)buf_size);
    if (debug==1){
        printf("\ntee--- net 0: ");
        for(size_t z=0; z<5; z++)
        {
            printf("%f, ", input_buf[z]);
        }
    }
    aggregate_buf = malloc(sizeof(float) * buf_size);
    countp = 1;
    for(size_t i=0; i<buf_size; i++)
    {
        aggregate_buf[i] = input_buf[i];
    }
}
void enclave_initialize ( float * input_buf , size_t buf_size ) { aes_cbc_TA ( " " , input_buf , ( int ) buf_size ) ; if ( debug == 1 ) { printf ( " \n " ) ; for ( size_t z = 0 ; z < 5 ; z ++ ) { printf ( " " , input_buf [ z ] ) ; } } aggregate_buf = malloc ( sizeof ( float ) * buf_size ) ; countp = 1 ; for ( size_t i = 0 ; i < buf_size ; i ++ ) { aggregate_buf [ i ] = input_buf [ i ] ; } }
This is the function that the host calls.
This is the function that the host calls .
// fprintf(stdout, "Secure aggregation from the enclave\n"); // // // Call back into the host // oe_result_t result = host_secure_aggregation(); // if (result != OE_OK) // { //     fprintf( //         stderr, //         "Call to host_secure_aggregation failed: result=%u (%s)\n", //         result, //         oe_result_str(result)); // } // malloc memory for aggregate_buf