Nach der Lektüre viel Dokumentation zusammengestellt habe ich die ersten einfachen Enklave Funktion:SGX Enclave: Wo die eigentliche Funktion, die die Prozession tut geht und wie es wird
enclave {
//Include files
//Import other edl files
//Data structure declarations to be used as parameters of the
//function prototypes in edl
trusted {
public function myFirstMethod([in] int *a, [in] int *b,[out] int *sum);
};
untrusted {
};
};
Dann über bash betreibe ich die edger8r:
sgx_edger8r enclave.edl
Dann erzeugt es die folgenden Dateien, wie Sie über das Schema sehen können:
SoIch gehe davon aus irgendwo über die enclave_t.c
die einzige Referenz I ist in dieser Funktion gefunden:
static sgx_status_t SGX_CDECL sgx_myFirstMethod(void* pms)
{
CHECK_REF_POINTER(pms, sizeof(ms_myFirstMethod_t));
ms_myFirstMethod_t* ms = SGX_CAST(ms_myFirstMethod_t*, pms);
sgx_status_t status = SGX_SUCCESS;
int* _tmp_a = ms->ms_a;
size_t _len_a = sizeof(*_tmp_a);
int* _in_a = NULL;
int* _tmp_b = ms->ms_b;
size_t _len_b = sizeof(*_tmp_b);
int* _in_b = NULL;
CHECK_UNIQUE_POINTER(_tmp_a, _len_a);
CHECK_UNIQUE_POINTER(_tmp_b, _len_b);
if (_tmp_a != NULL) {
_in_a = (int*)malloc(_len_a);
if (_in_a == NULL) {
status = SGX_ERROR_OUT_OF_MEMORY;
goto err;
}
memcpy(_in_a, _tmp_a, _len_a);
}
if (_tmp_b != NULL) {
_in_b = (int*)malloc(_len_b);
if (_in_b == NULL) {
status = SGX_ERROR_OUT_OF_MEMORY;
goto err;
}
memcpy(_in_b, _tmp_b, _len_b);
}
ms->ms_retval = myFirstMethod(_in_a, _in_b);
err:
if (_in_a) free(_in_a);
if (_in_b) free(_in_b);
return status;
}
Gerade in
ms->ms_retval = myFirstMethod(_in_a, _in_b);
Aber wo die myFirstMethod
setzen? Außerdem werde ich meine Enklave als Teil einer Anwendung als statische Bibliothek kompilieren.
Als fas wie ich das Tutorial in diesem Fall entweder Links gesucht:
Alle Visual Studio erwähnen, die nicht nativ GNU/Linux läuft über Es fällt mir schwer zu folgen.
Edit 1:
Weitere Suche Ich habe auf https://github.com/01org/linux-sgx gesehen, dass ich Simulationsmodus kompilieren über als der Link erwähnt:
make SGX_MODE=SIM
Und ich erfolgreich habe ich die driver installiert und die sdk. Ich möchte über SIMULATION-Modus kompilieren und nicht real.
Soweit ich weiß, dass ich kompilieren & runover Simulationsmodus –