<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to call an encalve from in Intel® Software Guard Extensions (Intel® SGX)</title>
    <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/How-to-call-other-enclave-function-from-an-enclave-function/m-p/1174151#M3308</link>
    <description>&lt;P&gt;How to call an encalve from another enclave in same application?&lt;/P&gt;</description>
    <pubDate>Wed, 03 Apr 2019 23:28:23 GMT</pubDate>
    <dc:creator>bashar__golam</dc:creator>
    <dc:date>2019-04-03T23:28:23Z</dc:date>
    <item>
      <title>How to call other enclave function from an enclave function?</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/How-to-call-other-enclave-function-from-an-enclave-function/m-p/1174148#M3305</link>
      <description>&lt;P&gt;Lets say I have following&amp;nbsp; functions belonging &lt;STRONG&gt;to the same enclave&lt;/STRONG&gt;:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;int foo(){}&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;int display() {}&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;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?&lt;/P&gt;

&lt;P&gt;Please explain the following things:&lt;/P&gt;

&lt;P&gt;1. What should be the interface of foo() in EDL file?&lt;/P&gt;

&lt;P&gt;2. What should be the definition of foo() in enclave.cpp file?&lt;/P&gt;

&lt;P&gt;3. How to call the foo() from display() ? Expecting the exact format.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Aug 2018 14:06:22 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/How-to-call-other-enclave-function-from-an-enclave-function/m-p/1174148#M3305</guid>
      <dc:creator>Gokhale__Sushant</dc:creator>
      <dc:date>2018-08-23T14:06:22Z</dc:date>
    </item>
    <item>
      <title>Hello.</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/How-to-call-other-enclave-function-from-an-enclave-function/m-p/1174149#M3306</link>
      <description>&lt;P&gt;Hello.&lt;/P&gt;

&lt;P&gt;For your example:&lt;/P&gt;

&lt;P&gt;1. In EDL, you simply need the following in the "trusted" section to allow your app to call into the enclave:&lt;/P&gt;

&lt;PRE class="brush:cpp; class-name:dark;"&gt;     public int display();&lt;/PRE&gt;

&lt;P&gt;2. and 3. The definitions of display() and foo() in the enclave.cpp file are just like normal c/c++ function definitions.&amp;nbsp; The below code shows display() calling foo():&lt;/P&gt;

&lt;PRE class="brush:cpp; class-name:dark;"&gt;    int foo()
    {
        return 1;
    }

    int display()
    {
        return foo();
    }&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;
	&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Scott&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Aug 2018 16:04:42 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/How-to-call-other-enclave-function-from-an-enclave-function/m-p/1174149#M3306</guid>
      <dc:creator>Scott_R_Intel</dc:creator>
      <dc:date>2018-08-23T16:04:42Z</dc:date>
    </item>
    <item>
      <title>(1) Only ecalls and ocalls</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/How-to-call-other-enclave-function-from-an-enclave-function/m-p/1174150#M3307</link>
      <description>&lt;P&gt;Answers:&lt;/P&gt;

&lt;P&gt;(1) Only ecalls and ocalls (calls that cross the enclave boundary) need to be in the edl file.&amp;nbsp; If function foo() is only used inside the enclave, it does not need to be in the edl&lt;/P&gt;

&lt;P&gt;(2+3) Define foo() however you like.&amp;nbsp; You'll call invoke it exactly as you would invoke any function in a program not using the Intel SGX SDK.&amp;nbsp; Since invocation is not crossing the enclave boundary, it's signature will not be modified.&amp;nbsp; No eid needs to be added to the invocation and no&amp;nbsp;&lt;SPAN style="font-size: 13.008px;"&gt;sgx_status_t&amp;nbsp;&lt;/SPAN&gt;value will be returned by default.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Aug 2018 16:14:29 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/How-to-call-other-enclave-function-from-an-enclave-function/m-p/1174150#M3307</guid>
      <dc:creator>Holodov__Dmitry</dc:creator>
      <dc:date>2018-08-23T16:14:29Z</dc:date>
    </item>
    <item>
      <title>How to call an encalve from</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/How-to-call-other-enclave-function-from-an-enclave-function/m-p/1174151#M3308</link>
      <description>&lt;P&gt;How to call an encalve from another enclave in same application?&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2019 23:28:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/How-to-call-other-enclave-function-from-an-enclave-function/m-p/1174151#M3308</guid>
      <dc:creator>bashar__golam</dc:creator>
      <dc:date>2019-04-03T23:28:23Z</dc:date>
    </item>
  </channel>
</rss>

