当前位置: 首页 > news >正文

湘潭网站建设 找磐石网络一流怎么在网络上推广

湘潭网站建设 找磐石网络一流,怎么在网络上推广,做网站编辑器,新疆建设兵团第一师网站文章目录参考文献系统要求一、安装Open Enclave SDK 环境(一)什么是Open Enclave SDK(二)启动SGX功能方法一: BIOS启动方法二:软件方式启动(三)安装必要环境(1&#xff0…

文章目录

  • 参考文献
  • 系统要求
  • 一、安装Open Enclave SDK 环境
    • (一)什么是Open Enclave SDK
    • (二)启动SGX功能
      • 方法一: BIOS启动
      • 方法二:软件方式启动
    • (三)安装必要环境
      • (1)安装编译工具:Visual Studio Build 2019(x64)
      • (2)安装Git环境
      • (3)安装Clang环境
      • (4)安装OpenSSL
      • (5)安装ME
      • (6.1)自动安装Guard Extension SDK for windows(PSW)
      • (6.2)手动安装PSW(Intel Platform Software for Windows)
      • (7)安装openenclave SDK
      • (8)安装Intel SGX DCAP for Windows
  • 二、使用Open Enclave SDK
    • (一)Open Enclave SDK目录文件说明
    • (二)配置 Open Enclave SDK
    • (三)运行测试例子(helloworld)

参考文献

  • 哪些平台支持英特尔® Software Guard Extensions (英特尔® SGX) 数据中心标记基元 (DCAP
  • 官方文档一:Install the Open Enclave SDK NuGet Package
  • 官方文档二:Using the Open Enclave SDK on Windows
  • 官方文档三: Building and Running the Samples on Windows
  • Win10安装Intel SGX环境并执行一个基础demo
  • windows10下使用Intel SGX编程初体验

系统要求

  • x86-64。
  • Windows Server 2019 or Windows 10 (1709 or newer)。
  • 支持SGX1(+FLC),如果不支持FLC,则只能使用simulation mode。

一、安装Open Enclave SDK 环境

(一)什么是Open Enclave SDK

Open Enclave SDK提供了对Open Portable TEE OS(OP-TEE OS)的预览支持。OP-TEE是一个用于实现传统内核模式和用户模式执行环境的TEE的操作系统。它在支持ARM TrustZone的A-profile ARM系统上运行。因此,Open Enclave SDK 也可以被用来针对这些系统。

原文链接请参考Open Enclave SDK for OP-TEE OS。

(二)启动SGX功能

启动SGX功能的前提条件时:Windows® 10 is booted in Legacy or UEFI Mode。如果是Legacy mode,则需要修改为UEFI mode,并重装windows 10。

方法一: BIOS启动

  1. 查看是否支持SGX,可参考官方文档:在电脑设置中找到CPU类型,在Intel官网查询该型号是否支持SGX。
  1. 如果电脑支持SGX,则重启电脑进入【BIOS->Security】下启动SGX。如果BIOS无法设置,则不支持使用Intel SGX功能。

方法二:软件方式启动

在 Microsoft Store 中下载安装Intel(R) Software Guard Extensions Activation APP。并以 Admin 方式打开 Intel(R) Software Guard Extensions Activation APP,单击 【Activate】启动SGX。

(三)安装必要环境

安装Open Enclave SDK的环境要求如下:

  • Git v2.31.1
  • OpenSSL 1.1.1
  • Visual Studio Build Tools
  • Clang 10.0.0
  • ShellCheck v0.7.0
  • Nuget 3.4.3
  • Python 3
  • Python pip
  • Intel SGX PSW v2.13.100.2

下面根据自己电脑上缺失工具进行安装。

(1)安装编译工具:Visual Studio Build 2019(x64)

  1. Visual Studio Build 2019下载地址在这儿。
  2. 安装时选择【C++ build tools】,中文是【使用C++的桌面开发】进行安装;
  3. Visual Studio Build Tools 2019支持CMake 3.15版(构建Open Enclave SDK需要CMake 3.12版或以上)。

(2)安装Git环境

  1. 如果有git、git bash等环境,则跳过。
  2. 下载地址在这儿,按步骤安装即可。
  3. C:\Program Files\Git\binC:\Program Files\Git\mingw64\bin添加到 PATH

(3)安装Clang环境

  1. 下载地址在这儿
  2. 安装Clang 8.0.1并将LLVM文件夹添加到路径中.

(4)安装OpenSSL

  1. 安装Git之后,在Git Bash中可以使用openssl了。
  2. 记住,电脑中一定只能有一个openssl。不然ninja 编译的时候会出错,参考这儿

(5)安装ME

windows10的ME下载地址在这儿。下载后直接安装,安装文件为\ME_SW_2216.16.0.2805\ME_SW_DCH\SetupME.exe

(6.1)自动安装Guard Extension SDK for windows(PSW)

实验中这种方式总是提示版本不对,即使在 SGX 已经激活的状态下。

下载地址在这儿。下载后直接安装。

(6.2)手动安装PSW(Intel Platform Software for Windows)

官方文档说SGX1+FLC才安装PSW,但是所有支持SGX的都需要安装PSW。

  1. 查看windows版本。在cmdpowershell中输入:winver,查看版本。1709是指2017年9月第一版windows10。所以一般都是使用above版本安装。

  2. 解压Intel SGX PSW v2.13.100.2,下载地址在这儿。下载之后,解压。

  3. 进入\Intel SGX PSW for Windows v2.13.100.2\PSW_INF_RS3_and_above目录,command(Admin)下执行:

pnputil /add-driver sgx_psw.inf /install

注:官方文档使用devcon.exe update安装总是出错,使用pnputil没有问题。

  1. 检查PSW是否安装成功:检查C:\Windows\System32下是否有sgx_urts.dll,【右键->属性->详细信息】查看版本。

  2. 查看PSW是否启动。command(Admin)下执行sc query aesmservice,输出如下信息表示已经启动。启动命令Start-Service "AESMService",重启命令Restart-Service "AESMService"

SERVICE_NAME: aesmserviceTYPE               : 10  WIN32_OWN_PROCESSSTATE              : 4  RUNNING(STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN)WIN32_EXIT_CODE    : 0  (0x0)SERVICE_EXIT_CODE  : 0  (0x0)CHECKPOINT         : 0x0WAIT_HINT          : 0x0

(7)安装openenclave SDK

  1. 下载 openenclave nupkg
    代码在这儿,下载最新版本。我下载的是v0.18.5。
  2. 安装nuget工具。
    1. 下载nuget工具,无需安装。下载地址在这儿。
    2. 下载之后将nuget存放地址加入到PATH
    3. 在Powershell(Admin)中测试nuget是否可用。

3.安装openenclave nupkg。打开Powershell(Admin),执行以下命令:

nuget.exe install open-enclave -Source D:\software\windows\SGX  -OutputDirectory C:\oe -ExcludeVersion -pre
  1. 安装完成后,Open Enclave SDK将被放置在C:\oe路径下。使用下面的命令来复制SDK到C:\openenclave
xcopy /E  C:\oe C:\openenclave\
  1. 查看当前SGX
// Powershell或者cmd下输入:
> oesgx.exe
CPU supports Software Guard Extensions:SGX1
MaxEnclaveSize_64: 2^(36)
CPU supports Key Sharing & Separation (KSS): false
EPC size on the platform: 98041856
oesgx outputSGX support level
CPU supports SGX_FLC:Flexible Launch Control CPU supports Software Guard Extensions:SGX1SGX1+FLC
CPU supports Software Guard Extensions:SGX1SGX1
CPU does not support SGXNone

所以本系统支持SGX1

(8)安装Intel SGX DCAP for Windows

  1. 安装WDK(Windows Driver Kit),获取devcon.exe等工具。

    1. 关闭visual studio。
    2. 安装Windows SDK,下载地址在这儿。下载之后安装,安装目录默认是C:\Program Files (x86)\Windows Kits\10\WindowsSDK,其他选项根据需要进行修改。(Windows SDK 貌似不支持家庭版,因为在安装WDK的时候总是提示Windows SDK未安装。
    3. Windows SDK安装完成之后,将C:\Program Files (x86)\Windows Kits\10添加到PATH
    4. 安装WDK,下载地址在这儿。默认安装路径,安装之后将C:\Program Files (x86)\Windows Kits\10\Tools\x64添加到PATH
  2. 安装Intel SGX DCAP for Windows。

    1. DCAP的下载地址在这儿。下载DCAP到存放路径。
    2. 运行Intel SGX DCAP for Windows v1.11.100.2.exe,解压到C:
    3. 允许SGX启动配置驱动程序运行: command(Admin)下执行:
    reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\sgx_lc_msr\Parameters /v "SGX_Launch_Config_Optin" /t REG_DWORD /d 1
    reg query HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\sgx_lc_msr\Parameters /v "SGX_Launch_Config_Optin"
    
    1. 安装和升级驱动。进入C:\Intel SGX DCAP for Windows v1.11.100.2目录,在command(Admin)下执行如下安装命令:
    devcon.exe update dcap\WindowsServer2016\sgx_dcap_dev.inf "SWC\VEN_INT&DEV_0E0C_DCAP"
    devcon.exe update base\WindowsServer2019_Windows10\sgx_base.inf *INT0E0C// 或
    pnputil /add-driver base\WindowsServer2019_Windows10\sgx_base.inf /install
    pnputil /add-driver dcap\WindowsServer2016\sgx_dcap_dev.inf /install
    
    1. 安装DCAP_Components。command(Amind)执行如下命令。
    // 安装 DCAP_Components
    nuget.exe install DCAP_Components -Source "C:\Intel SGX DCAP for Windows v1.11.100.2\nuget\DCAP_Components" -OutputDirectory C:\oe_prereqs -ExcludeVersion// 安装 EnclaveCommonAPI
    > nuget.exe install EnclaveCommonAPI -Source "C:\Intel SGX DCAP for Windows v1.11.100.2\nuget\EnclaveCommonAPI" -OutputDirectory C:\oe_prereqs -ExcludeVersion
    

    如果安装EnclaveCommonAPI提示错误Unable to resolve dependency 'SgxHeaders'. Source(s) used: 'nuget.org'.或错误Unable to find package 'DCAP_Components'. Existing packages must be restored before performing an install or update.。则不指定源,使用所有源安装EnclaveCommonAPI

    nuget.exe install EnclaveCommonAPI -OutputDirectory C:\oe_prereqs -ExcludeVersion
    

二、使用Open Enclave SDK

注意:目前该SDK仅支持64bit的程序。

(一)Open Enclave SDK目录文件说明

Path说明
binDeveloper tools such as oedebugrt.dll for debugging and oesign for signing your enclaves.
include\openenclaveOpen Enclave runtime headers for use in your enclave (enclave.h) and its host (host.h).
include\openenclave\3rdpartyHeaders for libc, libcxx and mbedlts libraries for use inside the enclave. See the API Reference section for supported functions.
lib\openenclave\cmakeOpen Enclave SDK CMake Package for integration with your CMake projects. See README.md for more details.
lib\openenclave\enclaveLibraries for linking into the enclave, including the libc, libcxx and mbedtls libraries for Open Enclave.
lib\openenclave\hostLibrary for linking into the host process of the enclave.
lib\openenclave\debuggerLibraries used by the gdb plug-in for debugging enclaves.
share\openenclave\samplesSample code showing how to use the Open Enclave SDK.

(二)配置 Open Enclave SDK

在环境变量中增加CMAKE_PREFIX_PATH,值为C:\openenclave\lib\openenclave\cmake。或者:

set CMAKE_PREFIX_PATH=%CMAKE_PREFIX_PATH%;C:\openenclave\lib\openenclave\cmake

(三)运行测试例子(helloworld)

Open Enclave SDK的测试例相关文档:

  • Open Enclave SDK Samples
  • Build and Sign an Enclave
  • Open Enclave Debugging
  1. 拷贝所有测试示例到本地地址
// 示例
xcopy /E C:\openenclave\share\openenclave\samples E:\codes\MPC\oe-tee
  1. 在菜单栏展开Visual Studio 2019,以 Admin 的方式打开x64 Native Tools Command Prompt for VS 2019编译(如果选择其他,则会提示find_package The following configuration files were considered but not accepted的错误)。进入到程序目录。

注:visual studio的各个shell工具说明在这儿。

  1. 编译helloworld测试代码
mkdir build
cd build
> cmake .. -G Ninja -DNUGET_PACKAGE_PATH=C:\oe_prereqs
// 等待无错误输出> ninja
[1/1] Generating enclave/enclave.signed
Created E:/codes/MPC/oe-samples/helloworld/build/enclave/enclave.signed> ninja run
[1/1] cmd.exe /C "cd /D E:\codes\MPC\oe-samples\helloworld...es/MPC/oe-samples/helloworld/build/enclave/enclave.signed"
Hello world from the enclave
Enclave called into host to print: Hello World!
http://www.ds6.com.cn/news/45312.html

相关文章:

  • 蔡甸做网站seo外链发布平台有哪些
  • proxy网站网站死链检测工具
  • 做网站开发的薪酬怎么样最大的中文搜索引擎
  • 深圳微信网站开发百度知道灰色词代发收录
  • wordpress自定义登录框插件seo优化的搜索排名影响因素主要有
  • 建设网站的整个费用预算怎样搭建一个网站
  • 阿里云服务器怎么用重庆做网络优化公司电话
  • 买网站服务器要多少钱一年百度怎么发自己的小广告
  • 如何建设赌博网站查排名的网站
  • 苏州网站建设学费沧州网站建设公司
  • 门户网站整改情况报告搜索引擎成功案例分析
  • 去哪个网站做农产品推广广州网络推广培训
  • 如何免费弄一个网站网站推广的途径有哪些
  • 潍坊网站托管小红书推广费用一般多少
  • 百度移动网站生成搜索引擎优化好做吗
  • 一个网站怎么优化超级外链工具源码
  • 腾讯企点下载官网搜索引擎排名优化方案
  • 自己搭建公司网站怎么制作一个网站5个网页
  • 自己的网站怎么赚钱百度网盘下载官网
  • 门户网站建设工作流程手机网站建设平台
  • 网站瀑布流怎么做如何做网站建设
  • 手机端网页开发工具seo网站推广是什么
  • 音频网站建设淘宝关键词排名查询
  • 如何做能放照片的网站百度网址大全电脑版
  • 深圳做棋牌网站建设西藏自治区seo 标题 关键词优化
  • 利用网上菜谱做网站百度搜索网址大全
  • 如何做百万格子网站做搜索引擎推广多少钱
  • 黑龙江省建设教育信息网站阿里云com域名注册
  • 北京建设规划许可证网站长沙网站搭建优化
  • 网站建设登录注册怎么做站长号