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

前端 未结 1 1196
滥情空心
滥情空心 2021-02-14 04:32

I have a C++ struct like this:

struct node                                                 
{
    string splitOn;                                         
    st         


        
相关标签:
1条回答
  • 2021-02-14 05:11

    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.

    0 讨论(0)
提交回复
热议问题