Community
cancel
Showing results for 
Search instead for 
Did you mean: 
dai_c_
Beginner
60 Views

How to pass a parameter which the type is a class

Hello guys:

     I am a freshman of SGX, I want protect a function which its parameter is a class,and how can I pass it to enclave?

 for example:

pass.png

and edl file not support "class"

0 Kudos
4 Replies
you_w_
New Contributor III
60 Views

Hi dai c.:

Actually the interface for sgx can only be write with C programming language. You can use struct instead.

Regards

you

Hoang_N_Intel
Employee
60 Views

I assume that if you really want to use C++, you can use C++ object serialization technique to get in and out the Enclave instead of using struct. But it does add some overhead.

dai_c_
Beginner
60 Views

Hoang Nguyen (Intel) wrote:

I assume that if you really want to use C++, you can use C++ object serialization technique to get in and out the Enclave instead of using struct. But it does add some overhead.

Yes,It's a good idea! I have a try in C++ object serialization technique,but many header files used by serialization is  unsupported in SGX, SDK e.g./boost/archive/text_oarchive.hpp ,boost/archive/text_iarchive.hpp.  and also some frequently used header files in C++ is unsupported in SGX SDK,like iostream,sstream and so on.

dai_c_
Beginner
60 Views

you w. wrote:

Hi dai c.:

Actually the interface for sgx can only be write with C programming language. You can use struct instead.

Regards

you

Actually, I use SGX SDK to protect some modules of a massive C++ project, and it's hard to change class into struct. and the mainly problem is I can't  pass C++ object by edl file