1 Star 0 Fork 81

寒江舟 / secGear

forked from openEuler / secGear 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
codegener.md 1.36 KB
一键复制 编辑 原始数据 按行查看 历史
whzhe 提交于 2021-04-12 10:33 . normalized codegen from arm and x86

Getting started with the codegen

The codegen helps to define these special functions through the edl files and assist user to using enclave.

The codegen

The codegen is based on the 'edger8r' tool in SGX SDK.

  • For example
$ codegen_arm64 --trustzone test.edl 

Note: using the codegen --help to get more details.

EDL format

  • For SGX(x86)
    enclave {
        trusted {
            public void enclave_helloworld(
                    int idata,
                    [in, size=data_in_size]unsigned char* data_in,
                    size_t data_in_size,
                    [out, size=data_out_size]unsigned char** data_out,
                    size_t data_out_size,
                    [in, out]unsigned char** data_in_out);
        };

        untrusted {
            void host_helloworld();
        };
    };
  • For trustzone(arm)
    enclave {
        trusted {
            public void enclave_helloworld(
                    int idata,
                    [in, size=data_in_size]unsigned char* data_in,
                    size_t data_in_size,
                    [out, size=data_out_size]unsigned char** data_out,
                    size_t data_out_size,
                    [in, out]unsigned char** data_in_out);
        };
    };

Note: so far, we dont support ocall for trustzone.And we also dont support usercheck for trustzone.

1
https://gitee.com/huangzq6/secGear.git
git@gitee.com:huangzq6/secGear.git
huangzq6
secGear
secGear
master

搜索帮助