Intel® Software Guard Extensions (Intel® SGX)
Discussion board focused on hardware-based isolation and memory encryption to provide extended code protection in solutions.

How to pass a parameter which the type is a class

dai_c_
Beginner
761 Views

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
761 Views

Hi dai c.:

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

Regards

you

0 Kudos
Hoang_N_Intel
Employee
761 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.

0 Kudos
dai_c_
Beginner
761 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.

0 Kudos
dai_c_
Beginner
761 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 

0 Kudos
Reply