Passing C++ struct to enclave from app in Intel SGX

孤街浪徒 提交于 2019-12-03 12:12:47

You shouldn't do this:

struct node                                                 
{
    string splitOn;                                         
    string label;                                           
    bool isLeaf;                                            
    vector<string> childrenValues;                          
    vector<node*> children;                                 
};

Possible problems:

  • The STL does not guarantee binary compatibility on most of its types: i.e. std::string or std::vector.

  • SGX's implementation of the STL is just a modified/reduced subset of it.

  • You may face problems related to memory alignment.

You should implement custom serialization for this instead.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!