1 Star 0 Fork 81

guoge / secGear

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

Getting started with the codegen_x86_64/codegen_arm64

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

The codegen_x86_64/codegen_arm64

The codegen_x86_64/codegen_arm64 is based on the 'edger8r' tool in SGX SDK.

  • For example
$ codegen_arm64 --trustzone test.edl 

OR

$ codegen_x86_64 --sgx test.edl

Note: using the codegen_x86_64/codegen_arm64 --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/jdkboy/secGear.git
git@gitee.com:jdkboy/secGear.git
jdkboy
secGear
secGear
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891