Intel SGX开发环境配置 linux 16.04

以下是针对不支持sgx开发所需硬件的开发环境配置,楼主就是BIOS不支持,所以psw(平台环境)安装不了,只能在SDK模拟环境下开发,因为Windows下真机环境无法模拟运行,上一篇博文就是楼主走的坑,这次在linux 16.04 lts下开发sgx,但愿成功。

安装SDK之前配置命令:再次之前我希望你更换一下国内下载源,这样会快多了。具体更换请看我之前的博文。

 sudo apt-get install build-essential ocaml automake autoconf libtool wget python libssl-dev

下载sdk源码: https://github.com/01org/linux-sgx

解压后到文件里在终端打开,运行如下命令

 $ ./download_prebuilt.sh

安装两个工具:

sudo apt-get install git
sudo apt-get install curl

接着编译

 $ make

建SDK跳过psw

$ make USE_OPT_LIBS=0

安debug

$ make DEBUG=1

清除make编译文件

$ make clean

构建SGX SDK安装器

$ make sdk_install_pkg

之后在linux/installer/bin/下会找到安装的bin文件

使用$ make sdk_install_pkg DEBUG=1可以显示构建信息

Install the Intel(R) SGX SDK

$ cd linux/installer/bin
$ ./sgx_linux_x64_sdk_${version}.bin 

$ source ${sgx-sdk-install-path}/environment

上面的version号可以通过ls命令查看

执行样例

 $ cd SampleCode/LocalAttestation
  $ make SGX_MODE=SIM
  $ ./app

运行结果成功如下: 

Available Enclaves
Enclave1 - EnclaveID 10b1300000002
Enclave2 - EnclaveID 10b1300000003
Enclave3 - EnclaveID 10b1300000004

Secure Channel Establishment between Source (E1) and Destination (E2) Enclaves successful !!!

Enclave to Enclave Call between Source (E1) and Destination (E2) Enclaves successful !!!

Message Exchange between Source (E1) and Destination (E2) Enclaves successful !!!

Secure Channel Establishment between Source (E1) and Destination (E3) Enclaves successful !!!

Enclave to Enclave Call between Source (E1) and Destination (E3) Enclaves successful !!!

Message Exchange between Source (E1) and Destination (E3) Enclaves successful !!!

Secure Channel Establishment between Source (E2) and Destination (E3) Enclaves successful !!!

Enclave to Enclave Call between Source (E2) and Destination (E3) Enclaves successful !!!

Message Exchange between Source (E2) and Destination (E3) Enclaves successful !!!

Secure Channel Establishment between Source (E3) and Destination (E1) Enclaves successful !!!

Enclave to Enclave Call between Source (E3) and Destination (E1) Enclaves successful !!!

Message Exchange between Source (E3) and Destination (E1) Enclaves successful !!!

Close Session between Source (E1) and Destination (E2) Enclaves successful !!!

Close Session between Source (E1) and Destination (E3) Enclaves successful !!!

Close Session between Source (E2) and Destination (E3) Enclaves successful !!!

Close Session between Source (E3) and Destination (E1) Enclaves successful !!!

Hit a key....
 

好开心好开心。。。。。。。。。。。。。。。。 

你可能感兴趣的:(SGX开发)