- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Lets say I have following functions belonging to the same enclave:
int foo(){}
int display() {}
I want to make ecall to display() from my application and from display(), call the foo() function(Note that foo() is an enclave function).How can that be done?
Please explain the following things:
1. What should be the interface of foo() in EDL file?
2. What should be the definition of foo() in enclave.cpp file?
3. How to call the foo() from display() ? Expecting the exact format.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello.
For your example:
1. In EDL, you simply need the following in the "trusted" section to allow your app to call into the enclave:
public int display();
2. and 3. The definitions of display() and foo() in the enclave.cpp file are just like normal c/c++ function definitions. The below code shows display() calling foo():
int foo() { return 1; } int display() { return foo(); }
Regards.
Scott
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello.
For your example:
1. In EDL, you simply need the following in the "trusted" section to allow your app to call into the enclave:
public int display();
2. and 3. The definitions of display() and foo() in the enclave.cpp file are just like normal c/c++ function definitions. The below code shows display() calling foo():
int foo() { return 1; } int display() { return foo(); }
Regards.
Scott
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Answers:
(1) Only ecalls and ocalls (calls that cross the enclave boundary) need to be in the edl file. If function foo() is only used inside the enclave, it does not need to be in the edl
(2+3) Define foo() however you like. You'll call invoke it exactly as you would invoke any function in a program not using the Intel SGX SDK. Since invocation is not crossing the enclave boundary, it's signature will not be modified. No eid needs to be added to the invocation and no sgx_status_t value will be returned by default.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to call an encalve from another enclave in same application?

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page