Browse Source

Linux 1.9 Open Source Gold release

Signed-off-by: Li, Xun <xun.li@intel.com>
Li, Xun 6 years ago
parent
commit
0fb9f47e78
100 changed files with 3809 additions and 3470 deletions
  1. 68 63
      License.txt
  2. 2 2
      Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXEnclave/makefiles/c++/sgx_t.mk
  3. 2 2
      Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXEnclave/makefiles/c/sgx_t.mk
  4. 2 2
      Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXTrustedStaticLibrary/makefiles/c++/sgx_t_static.mk
  5. 2 2
      Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXTrustedStaticLibrary/makefiles/c/sgx_t_static.mk
  6. 6 0
      Makefile
  7. 57 66
      README.md
  8. 216 0
      SampleCode/Cxx11SGXDemo/.cproject
  9. 28 0
      SampleCode/Cxx11SGXDemo/.project
  10. 73 0
      SampleCode/Cxx11SGXDemo/.settings/language.settings.xml
  11. 263 0
      SampleCode/Cxx11SGXDemo/App/App.cpp
  12. 69 0
      SampleCode/Cxx11SGXDemo/App/App.h
  13. 212 0
      SampleCode/Cxx11SGXDemo/App/TrustedLibrary/Libcxx.cpp
  14. 12 0
      SampleCode/Cxx11SGXDemo/Enclave/Enclave.config.xml
  15. 50 0
      SampleCode/Cxx11SGXDemo/Enclave/Enclave.cpp
  16. 55 0
      SampleCode/Cxx11SGXDemo/Enclave/Enclave.edl
  17. 48 0
      SampleCode/Cxx11SGXDemo/Enclave/Enclave.h
  18. 9 0
      SampleCode/Cxx11SGXDemo/Enclave/Enclave.lds
  19. 10 0
      SampleCode/Cxx11SGXDemo/Enclave/Enclave_debug.lds
  20. 39 0
      SampleCode/Cxx11SGXDemo/Enclave/Enclave_private.pem
  21. 917 0
      SampleCode/Cxx11SGXDemo/Enclave/TrustedLibrary/Libcxx.cpp
  22. 70 0
      SampleCode/Cxx11SGXDemo/Enclave/TrustedLibrary/Libcxx.edl
  23. 252 0
      SampleCode/Cxx11SGXDemo/Makefile
  24. 44 0
      SampleCode/Cxx11SGXDemo/README.txt
  25. 67 70
      SampleCode/LocalAttestation/.cproject
  26. 73 0
      SampleCode/LocalAttestation/.settings/language.settings.xml
  27. 16 9
      SampleCode/LocalAttestation/Makefile
  28. 1 1
      SampleCode/LocalAttestation/README.txt
  29. 67 70
      SampleCode/PowerTransition/.cproject
  30. 73 0
      SampleCode/PowerTransition/.settings/language.settings.xml
  31. 11 6
      SampleCode/PowerTransition/Makefile
  32. 1 1
      SampleCode/PowerTransition/README.txt
  33. 67 70
      SampleCode/RemoteAttestation/.cproject
  34. 73 0
      SampleCode/RemoteAttestation/.settings/language.settings.xml
  35. 12 6
      SampleCode/RemoteAttestation/Makefile
  36. 1 1
      SampleCode/RemoteAttestation/README.txt
  37. 8 5
      SampleCode/RemoteAttestation/isv_app/isv_app.cpp
  38. 12 6
      SampleCode/RemoteAttestation/isv_app/sample_messages.h
  39. 4 4
      SampleCode/RemoteAttestation/service_provider/ecp.cpp
  40. 67 70
      SampleCode/SampleEnclave/.cproject
  41. 73 0
      SampleCode/SampleEnclave/.settings/language.settings.xml
  42. 4 4
      SampleCode/SampleEnclave/App/Edger8rSyntax/Pointers.cpp
  43. 1 1
      SampleCode/SampleEnclave/Enclave/TrustedLibrary/Libc.cpp
  44. 1 1
      SampleCode/SampleEnclave/Enclave/TrustedLibrary/Thread.cpp
  45. 12 5
      SampleCode/SampleEnclave/Makefile
  46. 1 1
      SampleCode/SampleEnclave/README.txt
  47. 67 70
      SampleCode/SealedData/.cproject
  48. 73 0
      SampleCode/SealedData/.settings/language.settings.xml
  49. 11 5
      SampleCode/SealedData/Makefile
  50. 1 1
      SampleCode/SealedData/README.txt
  51. 8 1
      buildenv.mk
  52. 4 1
      common/inc/internal/metadata.h
  53. 1 1
      common/inc/internal/routine.h
  54. 5 4
      common/inc/internal/se_cdefs.h
  55. 1 1
      common/inc/internal/se_macro.h
  56. 1 1
      common/inc/internal/se_version.h
  57. 5 5
      common/inc/sgx_attributes.h
  58. 2 0
      common/inc/sgx_defs.h
  59. 2 2
      common/inc/sgx_error.h
  60. 1 1
      common/inc/sgx_report.h
  61. 73 6
      common/inc/sgx_tcrypto.h
  62. 5 5
      common/inc/sgx_thread.h
  63. 1 1
      common/inc/sgx_tkey_exchange.h
  64. 49 0
      common/inc/sgx_tprotected_fs.edl
  65. 276 0
      common/inc/sgx_tprotected_fs.h
  66. 1 1
      common/inc/sgx_trts_exception.h
  67. 2 0
      common/inc/sgx_tseal.h
  68. 16 0
      common/inc/sgx_uae_service.h
  69. 2 2
      common/inc/sgx_ukey_exchange.h
  70. 10 0
      common/inc/stdc++/linux/typeinfo
  71. 5 4
      common/inc/tlibc/setjmp.h
  72. 6 1
      common/inc/tlibc/sys/_types.h
  73. 12 0
      common/inc/tlibc/sys/stdint.h
  74. 9 9
      download_prebuilt.sh
  75. 1 1
      external/crypto_px/Makefile
  76. 3 3
      external/epid-sdk-3.0.0/LICENSE.txt
  77. 5 4
      external/epid-sdk-3.0.0/NOTICE.txt
  78. 0 104
      external/epid-sdk-3.0.0/doc/html/1_81_2file__parser_8h.html
  79. 0 151
      external/epid-sdk-3.0.0/doc/html/1_81_2types_8h.html
  80. 0 93
      external/epid-sdk-3.0.0/doc/html/Basenames.html
  81. 0 128
      external/epid-sdk-3.0.0/doc/html/BuildToolsInstallation.html
  82. 0 179
      external/epid-sdk-3.0.0/doc/html/BuildingSdk.html
  83. 0 134
      external/epid-sdk-3.0.0/doc/html/ChangeLog.html
  84. 0 231
      external/epid-sdk-3.0.0/doc/html/ChoosingiKGF.html
  85. 0 173
      external/epid-sdk-3.0.0/doc/html/EpidOverview.html
  86. 0 85
      external/epid-sdk-3.0.0/doc/html/Examples.html
  87. 0 5
      external/epid-sdk-3.0.0/doc/html/Examples.js
  88. 0 174
      external/epid-sdk-3.0.0/doc/html/Glossary.html
  89. 0 91
      external/epid-sdk-3.0.0/doc/html/ImplementationNotes.html
  90. 0 293
      external/epid-sdk-3.0.0/doc/html/IssuerMaterial.html
  91. 0 84
      external/epid-sdk-3.0.0/doc/html/LegalInformation.html
  92. 0 142
      external/epid-sdk-3.0.0/doc/html/Revocation.html
  93. 0 203
      external/epid-sdk-3.0.0/doc/html/SdkOverview.html
  94. 0 239
      external/epid-sdk-3.0.0/doc/html/SignVerifyTutorial.html
  95. 0 67
      external/epid-sdk-3.0.0/doc/html/SignmsgWalkthru.html
  96. 0 78
      external/epid-sdk-3.0.0/doc/html/VerifysigWalkthru.html
  97. 0 136
      external/epid-sdk-3.0.0/doc/html/annotated.html
  98. BIN
      external/epid-sdk-3.0.0/doc/html/arrowdown.png
  99. BIN
      external/epid-sdk-3.0.0/doc/html/arrowright.png
  100. 0 82
      external/epid-sdk-3.0.0/doc/html/basenames_8dox.html

+ 68 - 63
License.txt

@@ -98,21 +98,26 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS" AND A
 
 
 
-2. compiler_rt
+2. compiler_rt and libc++
 
 The compiler_rt library is dual licensed under both the University of Illinois 
 "BSD-Like" license and the MIT license.  As a user of this code you may choose 
 to use it under either license.  As a contributor, you agree to allow your code 
 to be used under both.
 
+The libc++ library is dual licensed under both the University of Illinois
+"BSD-Like" license and the MIT license.  As a user of this code you may choose
+to use it under either license.  As a contributor, you agree to allow your code
+to be used under both.
+
 Full text of the relevant licenses is included below.
 
-=============================================================================
+==============================================================================
 
 University of Illinois/NCSA
 Open Source License
 
-Copyright (c) 2009-2013 by the contributors listed in CREDITS.TXT
+Copyright (c) 2009-2016 by the contributors listed in CREDITS.TXT
 
 All rights reserved.
 
@@ -124,72 +129,72 @@ Developed by:
 
     http://llvm.org
 
-Permission is hereby granted, free of charge, to any person obtaining a copy of this 
-software and associated documentation files (the "Software"), to deal with the 
-Software without restriction, including without limitation the rights to use, 
-copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the 
-Software, and to permit persons to whom the Software is furnished to do so, subject 
-to the following conditions:
-
--	Redistributions of source code must retain the above copyright notice, 
-this list of conditions and the following disclaimers.
-
--	Redistributions in binary form must reproduce the above copyright notice, 
-this list of conditions and the following disclaimers in the documentation and/or 
-other materials provided with the distribution.
-
--	Neither the names of the LLVM Team, University of Illinois at Urbana-Champaign, 
-nor the names of its contributors may be used to endorse or romote products derived 
-from this Software without specific prior written permission.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
-INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 
-PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE 
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 
-OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
-DEALINGS WITH THE SOFTWARE.
-
-=============================================================================
-
-Copyright (c) 2009-2013 by the contributors listed in CREDITS.TXT
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this 
-software and associated documentation files (the "Software"), to deal in the Software 
-without restriction, including without limitation the rights to use, copy, modify, merge, 
-publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons 
-to whom the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or 
-substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
-INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 
-PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE 
-FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 
-OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
-DEALINGS IN THE SOFTWARE.
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal with
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+    * Redistributions of source code must retain the above copyright notice,
+      this list of conditions and the following disclaimers.
+
+    * Redistributions in binary form must reproduce the above copyright notice,
+      this list of conditions and the following disclaimers in the
+      documentation and/or other materials provided with the distribution.
+
+    * Neither the names of the LLVM Team, University of Illinois at
+      Urbana-Champaign, nor the names of its contributors may be used to
+      endorse or promote products derived from this Software without specific
+      prior written permission.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE
+SOFTWARE.
+
+==============================================================================
+
+Copyright (c) 2009-2015 by the contributors listed in CREDITS.TXT
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
 
 =============================================================================
 Copyrights and Licenses for Third Party Software Distributed with LLVM:
 =============================================================================
-The LLVM software contains code written by third parties.  Such software will have its 
-own individual LICENSE.TXT file in the directory in which it appears.
-This file will describe the copyrights, license, and restrictions which apply to that code.
-
-The disclaimer of warranty in the University of Illinois Open Source License applies to all 
-code in the LLVM Distribution, and nothing in any of the other licenses gives permission to 
-use the names of the LLVM Team or the University of Illinois to endorse or promote products 
-derived from this Software.
-
-The following pieces of software have additional or alternate copyrights, licenses, and/or 
-restrictions:
-
-Program             Directory
--------             ---------
-mach_override       lib/interception/mach_override
+The LLVM software contains code written by third parties.  Such software will
+have its own individual LICENSE.TXT file in the directory in which it appears.
+This file will describe the copyrights, license, and restrictions which apply
+to that code.
+
+The disclaimer of warranty in the University of Illinois Open Source License
+applies to all code in the LLVM Distribution, and nothing in any of the
+other licenses gives permission to use the names of the LLVM Team or the
+University of Illinois to endorse or promote products derived from this
+Software.
  
 
 
+
 3. DLmalloc
 
 
@@ -1115,7 +1120,7 @@ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
 
 
 
-16. EPID SDK
+16. Intel(R) Enhanced Privacy ID (Intel(R) EPID) SDK
 
                                  Apache License
                            Version 2.0, January 2004

+ 2 - 2
Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXEnclave/makefiles/c++/sgx_t.mk

@@ -45,7 +45,7 @@ Crypto_Library_Name := sgx_tcrypto
 
 $(EnclaveName)_Cpp_Files := trusted/$(enclaveName).cpp 
 $(EnclaveName)_C_Files := 
-$(EnclaveName)_Include_Paths := -IInclude -Itrusted -I$(SGX_SDK)/include -I$(SGX_SDK)/include/tlibc -I$(SGX_SDK)/include/stlport
+$(EnclaveName)_Include_Paths := -IInclude -Itrusted -I$(SGX_SDK)/include -I$(SGX_SDK)/include/tlibc -I$(SGX_SDK)/include/libcxx
 
 
 Flags_Just_For_C := -Wno-implicit-function-declaration -std=c11
@@ -57,7 +57,7 @@ $(EnclaveName)_Cpp_Flags := $($(EnclaveName)_Cpp_Flags)  -fno-builtin-printf
 
 $(EnclaveName)_Link_Flags := $(SGX_COMMON_CFLAGS) -Wl,--no-undefined -nostdlib -nodefaultlibs -nostartfiles -L$(SGX_LIBRARY_PATH) \
 	-Wl,--whole-archive -l$(Trts_Library_Name) -Wl,--no-whole-archive \
-	-Wl,--start-group -lsgx_tstdc -lsgx_tstdcxx -l$(Crypto_Library_Name) -l$(Service_Library_Name) -Wl,--end-group \
+	-Wl,--start-group -lsgx_tstdc -lsgx_tcxx -l$(Crypto_Library_Name) -l$(Service_Library_Name) -Wl,--end-group \
 	-Wl,-Bstatic -Wl,-Bsymbolic -Wl,--no-undefined \
 	-Wl,-pie,-eenclave_entry -Wl,--export-dynamic  \
 	-Wl,--defsym,__ImageBase=0 \

+ 2 - 2
Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXEnclave/makefiles/c/sgx_t.mk

@@ -44,7 +44,7 @@ endif
 Crypto_Library_Name := sgx_tcrypto
 
 $(EnclaveName)_C_Files := trusted/$(enclaveName).c 
-$(EnclaveName)_Include_Paths := -IInclude -Itrusted -I$(SGX_SDK)/include -I$(SGX_SDK)/include/tlibc -I$(SGX_SDK)/include/stlport
+$(EnclaveName)_Include_Paths := -IInclude -Itrusted -I$(SGX_SDK)/include -I$(SGX_SDK)/include/tlibc -I$(SGX_SDK)/include/libcxx
 
 Flags_Just_For_C := -Wno-implicit-function-declaration -std=c11
 Common_C_Cpp_Flags := $(SGX_COMMON_CFLAGS) -nostdinc -fvisibility=hidden -fpie -fstack-protector $($(EnclaveName)_Include_Paths) -fno-builtin-printf -I.
@@ -52,7 +52,7 @@ $(EnclaveName)_C_Flags := $(Flags_Just_For_C) $(Common_C_Cpp_Flags)
 
 $(EnclaveName)_Link_Flags := $(SGX_COMMON_CFLAGS) -Wl,--no-undefined -nostdlib -nodefaultlibs -nostartfiles -L$(SGX_LIBRARY_PATH) \
 	-Wl,--whole-archive -l$(Trts_Library_Name) -Wl,--no-whole-archive \
-	-Wl,--start-group -lsgx_tstdc -lsgx_tstdcxx -l$(Crypto_Library_Name) -l$(Service_Library_Name) -Wl,--end-group \
+	-Wl,--start-group -lsgx_tstdc -lsgx_tcxx -l$(Crypto_Library_Name) -l$(Service_Library_Name) -Wl,--end-group \
 	-Wl,-Bstatic -Wl,-Bsymbolic -Wl,--no-undefined \
 	-Wl,-pie,-eenclave_entry -Wl,--export-dynamic  \
 	-Wl,--defsym,__ImageBase=0 \

+ 2 - 2
Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXTrustedStaticLibrary/makefiles/c++/sgx_t_static.mk

@@ -45,7 +45,7 @@ Crypto_Library_Name := sgx_tcrypto
 
 $(EnclaveName)_Cpp_Files := static_trusted/$(enclaveName).cpp 
 $(EnclaveName)_C_Files := 
-$(EnclaveName)_Include_Paths := -IInclude -I$(EnclaveName) -I$(SGX_SDK)/include -I$(SGX_SDK)/include/tlibc -I$(SGX_SDK)/include/stlport
+$(EnclaveName)_Include_Paths := -IInclude -I$(EnclaveName) -I$(SGX_SDK)/include -I$(SGX_SDK)/include/tlibc -I$(SGX_SDK)/include/libcxx
 
 Flags_Just_For_C := -Wno-implicit-function-declaration -std=c11
 Common_C_Cpp_Flags := $(SGX_COMMON_CFLAGS) -nostdinc -fvisibility=hidden -fpie -fstack-protector $($(EnclaveName)_Include_Paths) -fno-builtin-printf -I.
@@ -56,7 +56,7 @@ $(EnclaveName)_Cpp_Flags := $($(EnclaveName)_Cpp_Flags)  -fno-builtin-printf
 
 $(EnclaveName)_Link_Flags := $(SGX_COMMON_CFLAGS) -Wl,--no-undefined -nostdlib -nodefaultlibs -nostartfiles -L$(SGX_LIBRARY_PATH) \
 	-Wl,--whole-archive -l$(Trts_Library_Name) -Wl,--no-whole-archive \
-	-Wl,--start-group -lsgx_tstdc -lsgx_tstdcxx -l$(Crypto_Library_Name) -l$(Service_Library_Name) -Wl,--end-group \
+	-Wl,--start-group -lsgx_tstdc -lsgx_tcxx -l$(Crypto_Library_Name) -l$(Service_Library_Name) -Wl,--end-group \
 	-Wl,-Bstatic -Wl,-Bsymbolic -Wl,--no-undefined \
 	-Wl,-pie,-eenclave_entry -Wl,--export-dynamic  \
 	-Wl,--defsym,__ImageBase=0 \

+ 2 - 2
Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXTrustedStaticLibrary/makefiles/c/sgx_t_static.mk

@@ -44,7 +44,7 @@ endif
 Crypto_Library_Name := sgx_tcrypto
 
 $(EnclaveName)_C_Files := static_trusted/$(enclaveName).c 
-$(EnclaveName)_Include_Paths := -IInclude -I$(EnclaveName) -I$(SGX_SDK)/include -I$(SGX_SDK)/include/tlibc -I$(SGX_SDK)/include/stlport
+$(EnclaveName)_Include_Paths := -IInclude -I$(EnclaveName) -I$(SGX_SDK)/include -I$(SGX_SDK)/include/tlibc -I$(SGX_SDK)/include/libcxx
 
 Flags_Just_For_C := -Wno-implicit-function-declaration -std=c11
 Common_C_Cpp_Flags := $(SGX_COMMON_CFLAGS) -nostdinc -fvisibility=hidden -fpie -fstack-protector $($(EnclaveName)_Include_Paths) -fno-builtin-printf -I.
@@ -52,7 +52,7 @@ $(EnclaveName)_C_Flags := $(Flags_Just_For_C) $(Common_C_Cpp_Flags)
 
 $(EnclaveName)_Link_Flags := $(SGX_COMMON_CFLAGS) -Wl,--no-undefined -nostdlib -nodefaultlibs -nostartfiles -L$(SGX_LIBRARY_PATH) \
 	-Wl,--whole-archive -l$(Trts_Library_Name) -Wl,--no-whole-archive \
-	-Wl,--start-group -lsgx_tstdc -lsgx_tstdcxx -l$(Crypto_Library_Name) -l$(Service_Library_Name) -Wl,--end-group \
+	-Wl,--start-group -lsgx_tstdc -lsgx_tcxx -l$(Crypto_Library_Name) -l$(Service_Library_Name) -Wl,--end-group \
 	-Wl,-Bstatic -Wl,-Bsymbolic -Wl,--no-undefined \
 	-Wl,-pie,-eenclave_entry -Wl,--export-dynamic  \
 	-Wl,--defsym,__ImageBase=0 \

+ 6 - 0
Makefile

@@ -52,6 +52,12 @@ clean:
 	@$(MAKE) -C psw/                                clean
 	@$(RM)   -r $(ROOT_DIR)/build
 	@$(RM)   -r linux/installer/bin/sgx_linux*.bin
+	@$(RM)   -rf linux/installer/common/psw/output
+	@$(RM)   -rf linux/installer/common/psw/gen_source.py
+	@$(RM)   -rf linux/installer/common/sdk/output
+	@$(RM)   -rf linux/installer/common/sdk/pkgconfig/x64
+	@$(RM)   -rf linux/installer/common/sdk/pkgconfig/x86
+	@$(RM)   -rf linux/installer/common/sdk/gen_source.py
 
 rebuild:
 	$(MAKE) clean

+ 57 - 66
README.md

@@ -7,19 +7,19 @@ Introduction
 ------------
 Intel(R) Software Guard Extensions (Intel(R) SGX) is an Intel technology for application developers seeking to protect select code and data from disclosure or modification.
 
-The Linux&ast; Intel SGX software stack is comprised of the Intel SGX driver, the Intel SGX SDK, and the Intel SGX Platform Software (PSW). The Intel SGX SDK and Intel SGX PSW are hosted in the [linux-sgx](https://github.com/01org/linux-sgx) project.
+The Linux\* Intel(R) SGX software stack is comprised of the Intel(R) SGX driver, the Intel(R) SGX SDK, and the Intel(R) SGX Platform Software (PSW). The Intel(R) SGX SDK and Intel(R) SGX PSW are hosted in the [linux-sgx](https://github.com/01org/linux-sgx) project.
 
-The [linux-sgx-driver](https://github.com/01org/linux-sgx-driver) project hosts the out-of-tree driver for the Linux Intel SGX software stack, which will be used until the driver upstreaming process is complete. 
+The [linux-sgx-driver](https://github.com/01org/linux-sgx-driver) project hosts the out-of-tree driver for the Linux\* Intel(R) SGX software stack, which will be used until the driver upstreaming process is complete. 
 
-**Note:**  This repository includes a subset of the Intel(R) Integrated Performance Primitives (IPP) Cryptography library under [external/crypto_px](https://github.com/01org/linux-sgx/external/crypto_px). It is provided as reference implementation for the cryptographic primitives used in SDK and PSW. The primitives are written in pure C and are not optimized for performance. Instructions are provided below for building the SDK and PSW with both precompiled, optimized IPP binaries and the non-optimized source code version. 
+**Note**  This repository includes a subset of the Intel(R) Integrated Performance Primitives (IPP) Cryptography library under [external/crypto_px](external/crypto_px). It is provided as reference implementation for the cryptographic primitives used in SDK and PSW. The primitives are written in pure C and are not optimized for performance. Instructions are provided below for building the SDK and PSW with both precompiled optimized IPP binaries and the non-optimized source code version. 
 
 License
 -------
-See `License.txt` for details.
+See [License.txt](License.txt) for details.
 
 Contributing
 -------
-See `CONTRIBUTING.md` for details.
+See [CONTRIBUTING.md](CONTRIBUTING.md) for details.
 
 Documentation
 -------------
@@ -28,14 +28,14 @@ Documentation
 
 Build and Install the Intel(R) SGX Driver
 -----------------------------------------
-Follow the instructions in the [linux-sgx-driver](https://github.com/01org/linux-sgx-driver) project to build and install the Intel SGX driver.
+Follow the instructions in the [linux-sgx-driver](https://github.com/01org/linux-sgx-driver) project to build and install the Intel(R) SGX driver.
 
 Build the Intel(R) SGX SDK and Intel(R) SGX PSW Package
 -------------------------------------------------------
 ### Prerequisites:
-- Ensure that you have the one of following operating systems:  
+- Ensure that you have one of the following required operating systems:  
   * Ubuntu\* Desktop-16.04-LTS 64bits
-  * Red Hat Enterprise Linux Server release 7.2 64bits
+  * Red Hat Enterprise Linux Server release 7.3 64bits
   * CentOS 7.3.1611 64bits
 
 - Use the following command(s) to install the required tools to build the Intel(R) SGX SDK:  
@@ -43,7 +43,7 @@ Build the Intel(R) SGX SDK and Intel(R) SGX PSW Package
   ```
     $ sudo apt-get install build-essential ocaml automake autoconf libtool wget python
   ```
-  * On Red Hat Enterprise Linux 7.2 and CentOS 7.3:
+  * On Red Hat Enterprise Linux 7.3 and CentOS 7.3:
   ```
     $ sudo yum groupinstall 'Development Tools'
     $ sudo yum install ocaml wget python
@@ -53,7 +53,7 @@ Build the Intel(R) SGX SDK and Intel(R) SGX PSW Package
   ```
     $ sudo apt-get install libssl-dev libcurl4-openssl-dev protobuf-compiler libprotobuf-dev
   ```
-  * On Red Hat Enterprise Linux 7.2 and CentOS 7.3:
+  * On Red Hat Enterprise Linux 7.3 and CentOS 7.3:
   ```
     $ sudo yum install openssl-devel libcurl-devel protobuf-compiler protobuf-devel
   ```
@@ -64,20 +64,20 @@ Build the Intel(R) SGX SDK and Intel(R) SGX PSW Package
 ```
 
 ### Build the Intel(R) SGX SDK and Intel(R) SGX PSW
-The following steps describe how to build the Intel SGX SDK and PSW. You can build the project according to your requirements.  
-- To build both Intel SGX SDK and PSW with the default configuration, enter the following command:  
+The following steps describe how to build the Intel(R) SGX SDK and PSW. You can build the project according to your requirements.  
+- To build both Intel(R) SGX SDK and PSW with default configuration, enter the following command:  
 ```
   $ make  
 ```  
   You can find the tools and libraries generated in the `build/linux` directory.  
-  **Note**: You can also go to the `sdk` folder and use the `make` command to build the Intel SGX SDK component only. However, building the PSW component is dependent on the result of building the Intel SGX SDK.  
+  **Note**: You can also go to the `sdk` folder and use the `make` command to build the Intel(R) SGX SDK component only. However, building the PSW component is dependent on the result of building the Intel(R) SGX SDK.  
 
 - The default build uses precompiled optimized libraries, which are downloaded by the script ``./download_prebuilt.sh``.
   You can also use the non-optimized source code version implementation instead by entering the following command:
 ```
   $ make USE_OPT_LIBS=0
 ```
-- To build Intel SGX SDK and PSW with debug information, enter the following command:  
+- To build Intel(R) SGX SDK and PSW with debug information, enter the following command:  
 ```
   $ make DEBUG=1
 ```
@@ -87,72 +87,75 @@ The following steps describe how to build the Intel SGX SDK and PSW. You can bui
 ```
 
 - The build above uses prebuilt Intel(R) Architecture Enclaves(LE/PvE/QE/PCE/PSE-OP/PSE-PR) and applet(PSDA) - the files ``psw/ae/data/prebuilt/libsgx_*.signed.so`` and ``psw/ae/data/prebuilt/PSDA.dalp``, which have been signed by Intel in advance.
-  To build those enclaves by yourself (without a signature), first you need to build both Intel SGX SDK and PSW with the default configuration. After that, you can build each Architecture Enclave by using the `make` command from the corresponding folder:
+  To build those enclaves by yourself (without a signature), first you need to build both Intel(R) SGX SDK and PSW with the default configuration. After that, you can build each Architecture Enclave by using the `make` command from the corresponding folder:
 ```
   $ cd psw/ae/le
   $ make
 ``` 
 
-### Build Intel(R) SGX SDK Installer
-To build Intel(R) SGX SDK installer, enter the following command:
+### Build the Intel(R) SGX SDK Installer
+To build the Intel(R) SGX SDK installer, enter the following command:
 ```
 $ make sdk_install_pkg
 ```
-You can find the generated Intel SGX SDK installer ``sgx_linux_x64_sdk_${version}.bin`` located under `linux/installer/bin/`, where `${version}` refers to the version number.
+You can find the generated Intel(R) SGX SDK installer ``sgx_linux_x64_sdk_${version}.bin`` located under `linux/installer/bin/`, where `${version}` refers to the version number.
 
-### Build Intel(R) SGX PSW Installer
-To build Intel(R) SGX PSW installer, enter the following command:
+**Note**: The above command builds the Intel(R) SGX SDK with default configuration firstly and then generates the target SDK Installer. To build the Intel(R) SGX SDK Installer with debug information kept in the tools and libraries, enter the following command:
+```
+$ make sdk_install_pkg DEBUG=1
+```
+
+### Build the Intel(R) SGX PSW Installer
+To build the Intel(R) SGX PSW installer, enter the following command:
 ```
 $ make psw_install_pkg
 ```
-You can find the generated Intel SGX PSW installer ``sgx_linux_x64_psw_${version}.bin`` located under `linux/installer/bin/`, where `${version}` refers to the version number.
+You can find the generated Intel(R) SGX PSW installer ``sgx_linux_x64_psw_${version}.bin`` located under `linux/installer/bin/`, where `${version}` refers to the version number.
 
-Install Intel(R) SGX SDK
+**Note**: The above command builds the Intel(R) SGX SDK and PSW with default configuration firstly and then generates the target PSW Installer. To build the Intel(R) SGX PSW Installer with debug information kept in the tools and libraries, enter the following command:
+```
+$ make psw_install_pkg DEBUG=1
+```
+
+
+Install the Intel(R) SGX SDK
 ------------------------
 ### Prerequisites
 - Ensure that you have one of the following operating systems:  
   * Ubuntu\* Desktop-16.04-LTS 64bits
-  * Red Hat Enterprise Linux Server release 7.2 64bits
+  * Red Hat Enterprise Linux Server release 7.3 64bits
   * CentOS 7.3.1611 64bits
 - Use the following command to install the required tool to use Intel(R) SGX SDK:
   * On Ubuntu 16.04:
   ```  
     $ sudo apt-get install build-essential python
   ```
-  * On Red Hat Enterprise Linux 7.2 and CentOS 7.3:
+  * On Red Hat Enterprise Linux 7.3 and CentOS 7.3:
   ```
      $ sudo yum groupinstall 'Development Tools'
      $ sudo yum install python 
   ```
 
-### Install Intel(R) SGX SDK
-To install Intel(R) SGX SDK, invoke the installer with root privilege, as follows:
+### Install the Intel(R) SGX SDK
+To install the Intel(R) SGX SDK, invoke the installer, as follows:
 ```
 $ cd linux/installer/bin
-$ sudo ./sgx_linux_x64_sdk_${version}.bin 
-```
-### Test Intel(R) SGX SDK Package with the Code Samples
-- Copy the code samples installed by Intel(R) SGX SDK package into your work folder, for example:  
-```
-  $ cp -r /opt/intel/sgxsdk/SampleCode ~
+$ ./sgx_linux_x64_sdk_${version}.bin 
 ```
+### Test the Intel(R) SGX SDK Package with the Code Samples
 - Compile and run each code sample in Simulation mode to make sure the package works well:    
 ```
   $ cd SampleCode/LocalAttestation
   $ make SGX_MODE=SIM
   $ ./app
 ```
-   Use similar commands for the other code samples.
-### Compile and Run the Code Samples in Hardware Mode
+   Use similar commands for other sample codes.
+### Compile and Run the Code Samples in the Hardware Mode
 If you use an Intel SGX hardware enabled machine, you can run the code samples in Hardware mode.
 Ensure that you install Intel(R) SGX driver and Intel(R) SGX PSW installer on the machine.  
-See the earlier topic, *Build and Install the Intel(R) SGX Driver*, for information on installing the Intel(R) SGX driver.  
-See the later topic, *Install Intel(R) SGX PSW*, for information on installing the PSW package.
-- Copy the code samples installed by the Intel(R) SGX SDK package into your work folder, for example:   
-```
-  $ cp -r /opt/intel/sgxsdk/SampleCode ~
-```
-- Compile and run each code sample in Hardware mode, Debug build, as follows:  
+See the earlier topic, *Build and Install the Intel(R) SGX Driver*, for information on how to install the Intel(R) SGX driver.  
+See the later topic, *Install Intel(R) SGX PSW*, for information on how to install the PSW package.
+- Compile and run each code sample in Hardware mode, debug build, as follows:  
 ```
   $ cd SampleCode/LocalAttestation
   $ make
@@ -161,34 +164,28 @@ See the later topic, *Install Intel(R) SGX PSW*, for information on installing t
    Use similar commands for other code samples.   
 
 
-Install Intel(R) SGX PSW
+Install the Intel(R) SGX PSW
 ------------------------
 ### Prerequisites
 - Ensure that you have one of the following operating systems:  
   * Ubuntu\* Desktop-16.04-LTS 64bits
-  * Red Hat Enterprise Linux Server release 7.2 64bits
+  * Red Hat Enterprise Linux Server release 7.3 64bits
   * CentOS 7.3.1611 64bits
-- Ensure that you have a system with one of the following processors:  
-  * 6th Generation Intel(R) Core(TM) Processor (code named Skylake)
-  * 7th Generation Intel(R) Core(TM) Processor (code named Kaby Lake)
-- Configure the system with the **Intel SGX hardware enabled** option and install Intel SGX driver in advance.  
-  See the earlier topic, *Build and Install the Intel(R) SGX Driver*, for information on installing the Intel SGX driver.
+- Ensure that you have a system with the following required hardware:  
+  * 6th Generation Intel(R) Core(TM) Processor or newer
+- Configure the system with the **Intel SGX hardware enabled** option and install Intel(R) SGX driver in advance.  
+  See the earlier topic, *Build and Install the Intel(R) SGX Driver*, for information on how to install the Intel(R) SGX driver.
 - Install the library using the following command:  
   * On Ubuntu 16.04:
   ```
     $ sudo apt-get install libssl-dev libcurl4-openssl-dev libprotobuf-dev
   ```
-  * On Red Hat Enterprise Linux 7.2 and CentOS 7.3:  
+  * On Red Hat Enterprise Linux 7.3 and CentOS 7.3:  
   ```
     $ sudo yum install openssl-devel libcurl-devel protobuf-devel
   ```
 - To use Trusted Platform Service functions:  
   Ensure `mei_me` driver is enabled and `/dev/mei0` exists.  
-  * On Red Hat Enterprise Linux 7.2:  
-  Update kernel version to kernel-3.10.0-514.el7 or newer on Red Hat Enterprise Linux 7.2.
-  ```
-    $ sudo yum update kernel
-  ```
   Download [iclsClient](https://software.intel.com/en-us/sgx-sdk/download) and install it using the following commands:  
   * On Ubuntu 16.04:
   ```
@@ -196,7 +193,7 @@ Install Intel(R) SGX PSW
     $ sudo alien --scripts iclsClient-1.45.449.12-1.x86_64.rpm
     $ sudo dpkg -i iclsclient_1.45.449.12-2_amd64.deb
   ```
-  * On Red Hat Enterprise Linux 7.2 and CentOS 7.3:  
+  * On Red Hat Enterprise Linux 7.3 and CentOS 7.3:  
   ```
     $ sudo yum install iclsClient-1.45.449.12-1.x86_64.rpm
   ```
@@ -206,23 +203,18 @@ Install Intel(R) SGX PSW
     $ sudo apt-get install uuid-dev libxml2-dev cmake pkg-config
     $ cmake .;make;sudo make install;sudo systemctl enable jhi
   ```
-  * On Red Hat Enterprise Linux 7.2 and CentOS 7.3:  
+  * On Red Hat Enterprise Linux 7.3 and CentOS 7.3:  
   ```
-    $ sudo yum install libuuid-devel libxml2-devel cmake
-    $ cmake .;make;sudo make install;sudo systemctl enable jhi
+    $ sudo yum install libuuid-devel libxml2-devel cmake pkgconfig
+    $ cmake .;make;sudo make install;sudo ldconfig;sudo systemctl enable jhi
   ```
 
-### Install Intel(R) SGX PSW
-To install Intel(R) SGX PSW, invoke the installer with root privilege:  
+### Install the Intel(R) SGX PSW
+To install the Intel(R) SGX PSW, invoke the installer with root privilege:  
 ```
 $ cd linux/installer/bin
 $ sudo ./sgx_linux_x64_psw_${version}.bin
 ```
-**Note**: On Red Hat Enterprise Linux 7.2 and CentOS 7.3, after Intel(R) SGX PSW installation, execute the following command to also update the shared library cache:  
-```
-$ sudo ldconfig
-```
- 
 
 ### Start or Stop aesmd Service
 The Intel(R) SGX PSW installer installs an aesmd service in your machine, which is running in a special linux account `aesmd`.  
@@ -235,4 +227,3 @@ The aesmd service uses the HTTP protocol to initialize some services.
 If a proxy is required for the HTTP protocol, you may need to manually set up the proxy for the aesmd service.  
 You should manually edit the file `/etc/aesmd.conf` (refer to the comments in the file) to set the proxy for the aesmd service.  
 After you configure the proxy, you need to restart the service to enable the proxy.
-

+ 216 - 0
SampleCode/Cxx11SGXDemo/.cproject

@@ -0,0 +1,216 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
+	<storageModule moduleId="org.eclipse.cdt.core.settings">
+		<cconfiguration id="com.intel.sgx.configuration.Sim.Debug">
+			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.Sim.Debug" moduleId="org.eclipse.cdt.core.settings" name="Intel(R) SGX Simulation Debug">
+				<externalSettings/>
+				<extensions>
+					<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+					<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.autotools.core.ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+				</extensions>
+			</storageModule>
+			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
+				<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.Sim.Debug" name="Intel(R) SGX Simulation Debug" parent="com.intel.sgx.configuration.Sim.Debug">
+					<folderInfo id="com.intel.sgx.configuration.Sim.Debug.935873960" name="/" resourcePath="">
+						<toolChain id="com.intel.sgx.toolChain.Sim.Debug.2132595457" name="Intel(R) SGX" superClass="com.intel.sgx.toolChain.Sim.Debug">
+							<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.1678491512" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
+							<builder arguments="SGX_DEBUG=1 SGX_MODE=SIM -f Makefile" command="make" id="com.intel.sgx.builder2.229166714" keepEnvironmentInBuildfile="false" name="Intel(R) Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder2"/>
+							<tool id="com.intel.sgx.compiler.81269967" name="Intel(R) SGX" superClass="com.intel.sgx.compiler">
+								<option id="com.intel.sgx.option.includePath.1694375039" superClass="com.intel.sgx.option.includePath" valueType="includePath">
+									<listOptionValue builtIn="false" value="&quot;${SGX_SDK}/include&quot;"/>
+								</option>
+								<inputType id="com.intel.sgx.inputType.742388855" superClass="com.intel.sgx.inputType"/>
+							</tool>
+						</toolChain>
+					</folderInfo>
+				</configuration>
+			</storageModule>
+			<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+		</cconfiguration>
+		<cconfiguration id="com.intel.sgx.configuration.Sim.Release">
+			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.Sim.Release" moduleId="org.eclipse.cdt.core.settings" name="Intel(R) SGX Simulation">
+				<externalSettings/>
+				<extensions>
+					<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+					<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.autotools.core.ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+				</extensions>
+			</storageModule>
+			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
+				<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.Sim.Release" name="Intel(R) SGX Simulation" parent="com.intel.sgx.configuration.Sim.Release">
+					<folderInfo id="com.intel.sgx.configuration.Sim.Release.428839196" name="/" resourcePath="">
+						<toolChain id="com.intel.sgx.toolChain.Sim.Release.709775329" name="Intel(R) SGX" superClass="com.intel.sgx.toolChain.Sim.Release">
+							<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.1866379479" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
+							<builder arguments="SGX_DEBUG=0 SGX_MODE=SIM -f Makefile" command="make" id="com.intel.sgx.builder3.1000705250" keepEnvironmentInBuildfile="false" name="Intel(R) Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder3"/>
+							<tool id="com.intel.sgx.compiler.301453474" name="Intel(R) SGX" superClass="com.intel.sgx.compiler">
+								<option id="com.intel.sgx.option.includePath.1312096753" superClass="com.intel.sgx.option.includePath" valueType="includePath">
+									<listOptionValue builtIn="false" value="&quot;${SGX_SDK}/include&quot;"/>
+								</option>
+								<inputType id="com.intel.sgx.inputType.596141238" superClass="com.intel.sgx.inputType"/>
+							</tool>
+						</toolChain>
+					</folderInfo>
+				</configuration>
+			</storageModule>
+			<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+		</cconfiguration>
+		<cconfiguration id="com.intel.sgx.configuration.HW.Debug">
+			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.HW.Debug" moduleId="org.eclipse.cdt.core.settings" name="Intel(R) SGX Hardware Debug">
+				<externalSettings/>
+				<extensions>
+					<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+					<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.autotools.core.ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+				</extensions>
+			</storageModule>
+			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
+				<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.HW.Debug" name="Intel(R) SGX Hardware Debug" parent="com.intel.sgx.configuration.HW.Debug">
+					<folderInfo id="com.intel.sgx.configuration.HW.Debug.562917509" name="/" resourcePath="">
+						<toolChain id="com.intel.sgx.toolChain.HW.Debug.2046051538" name="Intel(R) SGX" superClass="com.intel.sgx.toolChain.HW.Debug">
+							<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.999277922" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
+							<builder arguments="SGX_DEBUG=1 SGX_MODE=HW -f Makefile" command="make" id="com.intel.sgx.builder1.577701014" keepEnvironmentInBuildfile="false" name="Intel(R) Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder1"/>
+							<tool id="com.intel.sgx.compiler.1898704176" name="Intel(R) SGX" superClass="com.intel.sgx.compiler">
+								<option id="com.intel.sgx.option.includePath.1026657138" superClass="com.intel.sgx.option.includePath" valueType="includePath">
+									<listOptionValue builtIn="false" value="&quot;${SGX_SDK}/include&quot;"/>
+								</option>
+								<inputType id="com.intel.sgx.inputType.393162412" superClass="com.intel.sgx.inputType"/>
+							</tool>
+						</toolChain>
+					</folderInfo>
+				</configuration>
+			</storageModule>
+			<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+		</cconfiguration>
+		<cconfiguration id="com.intel.sgx.configuration.HW.Prerelease">
+			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.HW.Prerelease" moduleId="org.eclipse.cdt.core.settings" name="Intel(R) SGX Hardware Prerelease">
+				<externalSettings/>
+				<extensions>
+					<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+					<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.autotools.core.ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+				</extensions>
+			</storageModule>
+			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
+				<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.HW.Prerelease" name="Intel(R) SGX Hardware Prerelease" parent="com.intel.sgx.configuration.HW.Prerelease">
+					<folderInfo id="com.intel.sgx.configuration.HW.Prerelease.2074448686" name="/" resourcePath="">
+						<toolChain id="com.intel.sgx.toolChain.HW.Prerelease.2016152654" name="Intel(R) SGX" superClass="com.intel.sgx.toolChain.HW.Prerelease">
+							<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.1520324017" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
+							<builder arguments="SGX_PRERELEASE=1 SGX_MODE=HW -f Makefile" command="make" id="com.intel.sgx.builder5.293910513" keepEnvironmentInBuildfile="false" name="Intel(R) Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder5"/>
+							<tool id="com.intel.sgx.compiler.845441552" name="Intel(R) SGX" superClass="com.intel.sgx.compiler">
+								<option id="com.intel.sgx.option.includePath.199398937" superClass="com.intel.sgx.option.includePath" valueType="includePath">
+									<listOptionValue builtIn="false" value="&quot;${SGX_SDK}/include&quot;"/>
+								</option>
+								<inputType id="com.intel.sgx.inputType.1555926498" superClass="com.intel.sgx.inputType"/>
+							</tool>
+						</toolChain>
+					</folderInfo>
+				</configuration>
+			</storageModule>
+			<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+		</cconfiguration>
+		<cconfiguration id="com.intel.sgx.configuration.HW.Release">
+			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.HW.Release" moduleId="org.eclipse.cdt.core.settings" name="Intel(R) SGX Hardware Release">
+				<externalSettings/>
+				<extensions>
+					<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+					<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.autotools.core.ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+				</extensions>
+			</storageModule>
+			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
+				<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.HW.Release" name="Intel(R) SGX Hardware Release" parent="com.intel.sgx.configuration.HW.Release">
+					<folderInfo id="com.intel.sgx.configuration.HW.Release.1347223665" name="/" resourcePath="">
+						<toolChain id="com.intel.sgx.toolChain.HW.Release.1050674831" name="Intel(R) SGX" superClass="com.intel.sgx.toolChain.HW.Release">
+							<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.987781695" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
+							<builder arguments="SGX_DEBUG=0 SGX_MODE=HW -f Makefile" command="make" id="com.intel.sgx.builder6.484951388" keepEnvironmentInBuildfile="false" name="Intel(R) Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder6"/>
+							<tool id="com.intel.sgx.compiler.945246695" name="Intel(R) SGX" superClass="com.intel.sgx.compiler">
+								<option id="com.intel.sgx.option.includePath.119487102" superClass="com.intel.sgx.option.includePath" valueType="includePath">
+									<listOptionValue builtIn="false" value="&quot;${SGX_SDK}/include&quot;"/>
+								</option>
+								<inputType id="com.intel.sgx.inputType.593431891" superClass="com.intel.sgx.inputType"/>
+							</tool>
+						</toolChain>
+					</folderInfo>
+				</configuration>
+			</storageModule>
+			<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+		</cconfiguration>
+	</storageModule>
+	<storageModule moduleId="cdtBuildSystem" version="4.0.0">
+		<project id="Cxx11SGXDemo.cdt.managedbuild.target.gnu.exe.872917958" name="Executable" projectType="cdt.managedbuild.target.gnu.exe"/>
+	</storageModule>
+	<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
+	<storageModule moduleId="refreshScope" versionNumber="2">
+		<configuration configurationName="Intel(R) SGX Hardware Debug">
+			<resource resourceType="PROJECT" workspacePath="/Cxx11SGXDemo"/>
+		</configuration>
+		<configuration configurationName="Intel(R) SGX Simulation Debug">
+			<resource resourceType="PROJECT" workspacePath="/Cxx11SGXDemo"/>
+		</configuration>
+		<configuration configurationName="Intel(R) SGX Hardware Prerelease">
+			<resource resourceType="PROJECT" workspacePath="/Cxx11SGXDemo"/>
+		</configuration>
+		<configuration configurationName="Intel(R) SGX Simulation">
+			<resource resourceType="PROJECT" workspacePath="/Cxx11SGXDemo"/>
+		</configuration>
+		<configuration configurationName="Intel(R) SGX Hardware Release">
+			<resource resourceType="PROJECT" workspacePath="/Cxx11SGXDemo"/>
+		</configuration>
+	</storageModule>
+	<storageModule moduleId="scannerConfiguration">
+		<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+		<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.HW.Release;com.intel.sgx.configuration.HW.Release.1347223665;com.intel.sgx.compiler.945246695;com.intel.sgx.inputType.593431891">
+			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.intel.sgx.SGXPerProjectProfile"/>
+		</scannerConfigBuildInfo>
+		<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.Sim.Debug;com.intel.sgx.configuration.Sim.Debug.935873960;com.intel.sgx.compiler.81269967;com.intel.sgx.inputType.742388855">
+			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.intel.sgx.SGXPerProjectProfile"/>
+		</scannerConfigBuildInfo>
+		<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.Sim.Release;com.intel.sgx.configuration.Sim.Release.428839196;com.intel.sgx.compiler.301453474;com.intel.sgx.inputType.596141238">
+			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.intel.sgx.SGXPerProjectProfile"/>
+		</scannerConfigBuildInfo>
+		<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.debug.1609650460;cdt.managedbuild.config.gnu.exe.debug.1609650460.;cdt.managedbuild.tool.gnu.c.compiler.exe.debug.1644119147;cdt.managedbuild.tool.gnu.c.compiler.input.938348551">
+			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+		</scannerConfigBuildInfo>
+		<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.release.1394873887;cdt.managedbuild.config.gnu.exe.release.1394873887.;cdt.managedbuild.tool.gnu.c.compiler.exe.release.2035356548;cdt.managedbuild.tool.gnu.c.compiler.input.793813290">
+			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+		</scannerConfigBuildInfo>
+		<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.HW.Debug;com.intel.sgx.configuration.HW.Debug.562917509;com.intel.sgx.compiler.1898704176;com.intel.sgx.inputType.393162412">
+			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.intel.sgx.SGXPerProjectProfile"/>
+		</scannerConfigBuildInfo>
+		<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.HW.Prerelease;com.intel.sgx.configuration.HW.Prerelease.2074448686;com.intel.sgx.compiler.845441552;com.intel.sgx.inputType.1555926498">
+			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.intel.sgx.SGXPerProjectProfile"/>
+		</scannerConfigBuildInfo>
+	</storageModule>
+	<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+</cproject>

+ 28 - 0
SampleCode/Cxx11SGXDemo/.project

@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>Cxx11SGXDemo</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
+			<triggers>clean,full,incremental,</triggers>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
+			<triggers>full,incremental,</triggers>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.cdt.core.cnature</nature>
+		<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
+		<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
+		<nature>org.eclipse.cdt.core.ccnature</nature>
+		<nature>com.intel.sgx.sgxnature</nature>
+	</natures>
+</projectDescription>

+ 73 - 0
SampleCode/Cxx11SGXDemo/.settings/language.settings.xml

@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<project>
+	<configuration id="com.intel.sgx.configuration.Sim.Debug" name="Intel(R) SGX Simulation Debug">
+		<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
+			<provider class="org.eclipse.cdt.core.language.settings.providers.LanguageSettingsGenericProvider" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider" name="CDT User Setting Entries" prefer-non-shared="true" store-entries-with-project="true">
+				<resource project-relative-path="">
+					<entry kind="includePath" name="${SGX_SDK}/include">
+						<flag value="LOCAL"/>
+					</entry>
+				</resource>
+			</provider>
+			<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" ref="shared-provider"/>
+		</extension>
+	</configuration>
+	<configuration id="com.intel.sgx.configuration.Sim.Release" name="Intel(R) SGX Simulation">
+		<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
+			<provider class="org.eclipse.cdt.core.language.settings.providers.LanguageSettingsGenericProvider" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider" name="CDT User Setting Entries" prefer-non-shared="true" store-entries-with-project="true">
+				<resource project-relative-path="">
+					<entry kind="includePath" name="${SGX_SDK}/include">
+						<flag value="LOCAL"/>
+					</entry>
+				</resource>
+			</provider>
+			<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" ref="shared-provider"/>
+		</extension>
+	</configuration>
+	<configuration id="com.intel.sgx.configuration.HW.Debug" name="Intel(R) SGX Hardware Debug">
+		<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
+			<provider class="org.eclipse.cdt.core.language.settings.providers.LanguageSettingsGenericProvider" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider" name="CDT User Setting Entries" prefer-non-shared="true" store-entries-with-project="true">
+				<resource project-relative-path="">
+					<entry kind="includePath" name="${SGX_SDK}/include">
+						<flag value="LOCAL"/>
+					</entry>
+				</resource>
+			</provider>
+			<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" ref="shared-provider"/>
+		</extension>
+	</configuration>
+	<configuration id="com.intel.sgx.configuration.HW.Prerelease" name="Intel(R) SGX Hardware Prerelease">
+		<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
+			<provider class="org.eclipse.cdt.core.language.settings.providers.LanguageSettingsGenericProvider" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider" name="CDT User Setting Entries" prefer-non-shared="true" store-entries-with-project="true">
+				<resource project-relative-path="">
+					<entry kind="includePath" name="${SGX_SDK}/include">
+						<flag value="LOCAL"/>
+					</entry>
+				</resource>
+			</provider>
+			<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" ref="shared-provider"/>
+		</extension>
+	</configuration>
+	<configuration id="com.intel.sgx.configuration.HW.Release" name="Intel(R) SGX Hardware Release">
+		<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
+			<provider class="org.eclipse.cdt.core.language.settings.providers.LanguageSettingsGenericProvider" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider" name="CDT User Setting Entries" prefer-non-shared="true" store-entries-with-project="true">
+				<resource project-relative-path="">
+					<entry kind="includePath" name="${SGX_SDK}/include">
+						<flag value="LOCAL"/>
+					</entry>
+				</resource>
+			</provider>
+			<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" ref="shared-provider"/>
+		</extension>
+	</configuration>
+</project>

+ 263 - 0
SampleCode/Cxx11SGXDemo/App/App.cpp

@@ -0,0 +1,263 @@
+/*
+ * Copyright (C) 2011-2017 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in
+ *     the documentation and/or other materials provided with the
+ *     distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+
+# include <unistd.h>
+# include <pwd.h>
+# define MAX_PATH FILENAME_MAX
+
+#include "sgx_urts.h"
+#include "sgx_uae_service.h"
+#include "App.h"
+#include "Enclave_u.h"
+
+/* Global EID shared by multiple threads */
+sgx_enclave_id_t global_eid = 0;
+
+typedef struct _sgx_errlist_t {
+    sgx_status_t err;
+    const char *msg;
+    const char *sug; /* Suggestion */
+} sgx_errlist_t;
+
+/* Error code returned by sgx_create_enclave */
+static sgx_errlist_t sgx_errlist[] = {
+    {
+        SGX_ERROR_UNEXPECTED,
+        "Unexpected error occurred.",
+        NULL
+    },
+    {
+        SGX_ERROR_INVALID_PARAMETER,
+        "Invalid parameter.",
+        NULL
+    },
+    {
+        SGX_ERROR_OUT_OF_MEMORY,
+        "Out of memory.",
+        NULL
+    },
+    {
+        SGX_ERROR_ENCLAVE_LOST,
+        "Power transition occurred.",
+        "Please refer to the sample \"PowerTransition\" for details."
+    },
+    {
+        SGX_ERROR_INVALID_ENCLAVE,
+        "Invalid enclave image.",
+        NULL
+    },
+    {
+        SGX_ERROR_INVALID_ENCLAVE_ID,
+        "Invalid enclave identification.",
+        NULL
+    },
+    {
+        SGX_ERROR_INVALID_SIGNATURE,
+        "Invalid enclave signature.",
+        NULL
+    },
+    {
+        SGX_ERROR_OUT_OF_EPC,
+        "Out of EPC memory.",
+        NULL
+    },
+    {
+        SGX_ERROR_NO_DEVICE,
+        "Invalid SGX device.",
+        "Please make sure SGX module is enabled in the BIOS, and install SGX driver afterwards."
+    },
+    {
+        SGX_ERROR_MEMORY_MAP_CONFLICT,
+        "Memory map conflicted.",
+        NULL
+    },
+    {
+        SGX_ERROR_INVALID_METADATA,
+        "Invalid enclave metadata.",
+        NULL
+    },
+    {
+        SGX_ERROR_DEVICE_BUSY,
+        "SGX device was busy.",
+        NULL
+    },
+    {
+        SGX_ERROR_INVALID_VERSION,
+        "Enclave version was invalid.",
+        NULL
+    },
+    {
+        SGX_ERROR_INVALID_ATTRIBUTE,
+        "Enclave was not authorized.",
+        NULL
+    },
+    {
+        SGX_ERROR_ENCLAVE_FILE_ACCESS,
+        "Can't open enclave file.",
+        NULL
+    },
+    {
+        SGX_ERROR_NDEBUG_ENCLAVE,
+        "The enclave is signed as product enclave, and can not be created as debuggable enclave.",
+        NULL
+    },
+};
+
+/* Check error conditions for loading enclave */
+void print_error_message(sgx_status_t ret)
+{
+    size_t idx = 0;
+    size_t ttl = sizeof sgx_errlist/sizeof sgx_errlist[0];
+
+    for (idx = 0; idx < ttl; idx++) {
+        if(ret == sgx_errlist[idx].err) {
+            if(NULL != sgx_errlist[idx].sug)
+                printf("Info: %s\n", sgx_errlist[idx].sug);
+            printf("Error: %s\n", sgx_errlist[idx].msg);
+            break;
+        }
+    }
+    
+    if (idx == ttl)
+        printf("Error: Unexpected error occurred.\n");
+}
+
+/* Initialize the enclave:
+ *   Step 1: try to retrieve the launch token saved by last transaction
+ *   Step 2: call sgx_create_enclave to initialize an enclave instance
+ *   Step 3: save the launch token if it is updated
+ */
+int initialize_enclave(void)
+{
+    char token_path[MAX_PATH] = {'\0'};
+    sgx_launch_token_t token = {0};
+    sgx_status_t ret = SGX_ERROR_UNEXPECTED;
+    int updated = 0;
+    
+    /* Step 1: try to retrieve the launch token saved by last transaction 
+     *         if there is no token, then create a new one.
+     */
+    /* try to get the token saved in $HOME */
+    const char *home_dir = getpwuid(getuid())->pw_dir;
+    
+    if (home_dir != NULL && 
+        (strlen(home_dir)+strlen("/")+sizeof(TOKEN_FILENAME)+1) <= MAX_PATH) {
+        /* compose the token path */
+        strncpy(token_path, home_dir, strlen(home_dir));
+        strncat(token_path, "/", strlen("/"));
+        strncat(token_path, TOKEN_FILENAME, sizeof(TOKEN_FILENAME)+1);
+    } else {
+        /* if token path is too long or $HOME is NULL */
+        strncpy(token_path, TOKEN_FILENAME, sizeof(TOKEN_FILENAME));
+    }
+
+    FILE *fp = fopen(token_path, "rb");
+    if (fp == NULL && (fp = fopen(token_path, "wb")) == NULL) {
+        printf("Warning: Failed to create/open the launch token file \"%s\".\n", token_path);
+    }
+
+    if (fp != NULL) {
+        /* read the token from saved file */
+        size_t read_num = fread(token, 1, sizeof(sgx_launch_token_t), fp);
+        if (read_num != 0 && read_num != sizeof(sgx_launch_token_t)) {
+            /* if token is invalid, clear the buffer */
+            memset(&token, 0x0, sizeof(sgx_launch_token_t));
+            printf("Warning: Invalid launch token read from \"%s\".\n", token_path);
+        }
+    }
+    /* Step 2: call sgx_create_enclave to initialize an enclave instance */
+    /* Debug Support: set 2nd parameter to 1 */
+    ret = sgx_create_enclave(ENCLAVE_FILENAME, SGX_DEBUG_FLAG, &token, &updated, &global_eid, NULL);
+    if (ret != SGX_SUCCESS) {
+        print_error_message(ret);
+        if (fp != NULL) fclose(fp);
+        return -1;
+    }
+
+    /* Step 3: save the launch token if it is updated */
+    if (updated == FALSE || fp == NULL) {
+        /* if the token is not updated, or file handler is invalid, do not perform saving */
+        if (fp != NULL) fclose(fp);
+        return 0;
+    }
+
+    /* reopen the file with write capablity */
+    fp = freopen(token_path, "wb", fp);
+    if (fp == NULL) return 0;
+    size_t write_num = fwrite(token, 1, sizeof(sgx_launch_token_t), fp);
+    if (write_num != sizeof(sgx_launch_token_t))
+        printf("Warning: Failed to save launch token to \"%s\".\n", token_path);
+    fclose(fp);
+    return 0;
+}
+
+/* OCall functions */
+void ocall_print_string(const char *str)
+{
+    /* Proxy/Bridge will check the length and null-terminate 
+     * the input string to prevent buffer overflow. 
+     */
+    printf("%s", str);
+}
+
+
+/* Application entry */
+int SGX_CDECL main(int argc, char *argv[])
+{
+    (void)(argc);
+    (void)(argv);
+
+
+    /* Initialize the enclave */
+    if(initialize_enclave() < 0){
+        printf("Enter a character before exit ...\n");
+        getchar();
+        return -1; 
+    }
+ 
+    
+    /* Utilize trusted libraries */ 
+    ecall_libcxx_functions();
+    
+    /* Destroy the enclave */
+    sgx_destroy_enclave(global_eid);
+    
+    printf("Info: Cxx11DemoEnclave successfully returned.\n");
+
+    //printf("Enter a character before exit ...\n");
+    //getchar();
+    return 0;
+}
+

+ 69 - 0
SampleCode/Cxx11SGXDemo/App/App.h

@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2011-2017 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in
+ *     the documentation and/or other materials provided with the
+ *     distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#ifndef _APP_H_
+#define _APP_H_
+
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+
+#include "sgx_error.h"       /* sgx_status_t */
+#include "sgx_eid.h"     /* sgx_enclave_id_t */
+
+#ifndef TRUE
+# define TRUE 1
+#endif
+
+#ifndef FALSE
+# define FALSE 0
+#endif
+
+#if   defined(__GNUC__)
+# define TOKEN_FILENAME   "enclave.token"
+# define ENCLAVE_FILENAME "enclave.signed.so"
+#endif
+
+extern sgx_enclave_id_t global_eid;    /* global enclave id */
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+void ecall_libcxx_functions(void);
+
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif /* !_APP_H_ */

+ 212 - 0
SampleCode/Cxx11SGXDemo/App/TrustedLibrary/Libcxx.cpp

@@ -0,0 +1,212 @@
+/*
+ * Copyright (C) 2011-2017 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in
+ *     the documentation and/or other materials provided with the
+ *     distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+#include <stdio.h>
+
+#include "../App.h"
+#include "Enclave_u.h"
+#include <thread>
+
+/* ecall_libcxx_functions:
+ *   Invokes standard C++11 functions.
+ */
+
+ //This function is part of mutex demo
+void demo_counter_without_mutex()
+{
+	sgx_status_t ret = SGX_ERROR_UNEXPECTED;
+	ret = ecall_mutex_demo_no_protection(global_eid);
+	if (ret != SGX_SUCCESS)
+		abort();
+}
+
+//This function is part of mutex demo
+void demo_counter_mutex()
+{
+    sgx_status_t ret = SGX_ERROR_UNEXPECTED;
+    ret = ecall_mutex_demo(global_eid);
+    if (ret != SGX_SUCCESS)
+        abort();
+}
+
+//This function is used by processing thread of condition variable demo
+void demo_cond_var_run()
+{
+    sgx_status_t ret = SGX_ERROR_UNEXPECTED;
+    ret = ecall_condition_variable_run(global_eid);
+    if (ret != SGX_SUCCESS)
+        abort();
+}
+
+//This function is used by the loader thread of condition variable demo
+void demo_cond_var_load()
+{
+    sgx_status_t ret = SGX_ERROR_UNEXPECTED;
+    ret = ecall_condition_variable_load(global_eid);
+    if (ret != SGX_SUCCESS)
+        abort();
+}
+
+// Examples for C++11 library and compiler features
+void ecall_libcxx_functions(void)
+{
+    sgx_status_t ret = SGX_ERROR_UNEXPECTED;
+    
+    // Example for lambda function feature:
+    ret = ecall_lambdas_demo(global_eid);
+    if (ret != SGX_SUCCESS)
+        abort();
+
+    // Example for auto feature:
+    ret = ecall_auto_demo(global_eid);
+    if (ret != SGX_SUCCESS)
+        abort();
+
+    // Example for decltype:
+    ret = ecall_decltype_demo(global_eid);
+    if (ret != SGX_SUCCESS)
+        abort();
+
+    // Example for strongly_typed_enum:
+    ret = ecall_strongly_typed_enum_demo(global_eid);
+    if (ret != SGX_SUCCESS)
+        abort();
+    
+    // Example for range based for loops:
+    ret = ecall_range_based_for_loops_demo(global_eid);
+    if (ret != SGX_SUCCESS)
+        abort();
+
+    // Example for static_assert:
+    ret = ecall_static_assert_demo(global_eid);
+    if (ret != SGX_SUCCESS)
+        abort();
+    
+    // Example for virtual function controls : override, final, default, and delete
+    ret = ecall_virtual_function_control_demo(global_eid);
+    if (ret != SGX_SUCCESS)
+        abort();
+
+    // Example for delegating_constructors:
+    ret = ecall_delegating_constructors_demo(global_eid);
+    if (ret != SGX_SUCCESS)
+        abort();
+
+    // Example for std::function:
+    ret = ecall_std_function_demo(global_eid);
+    if (ret != SGX_SUCCESS)
+        abort();
+    
+    // Example for algorithms (std::all_of, std::any_of, std::none_of):
+    ret = ecall_cxx11_algorithms_demo(global_eid);
+    if (ret != SGX_SUCCESS)
+        abort();
+
+    // Example for variadic_templates feature:
+    ret = ecall_variadic_templates_demo(global_eid);
+    if (ret != SGX_SUCCESS)
+        abort();
+
+    // Example for SFINAE:
+    ret = ecall_SFINAE_demo(global_eid);
+    if (ret != SGX_SUCCESS)
+        abort();
+
+    // Example for initializer_list:
+    ret = ecall_initializer_list_demo(global_eid);
+    if (ret != SGX_SUCCESS)
+        abort();
+
+    // Example for rvalue:
+    ret = ecall_rvalue_demo(global_eid);
+    if (ret != SGX_SUCCESS)
+        abort();
+
+    // Example for nullptr:
+    ret = ecall_nullptr_demo(global_eid);
+    if (ret != SGX_SUCCESS)
+        abort();
+
+    // Example for enum class:
+    ret = ecall_enum_class_demo(global_eid);
+    if (ret != SGX_SUCCESS)
+        abort();
+
+    // Example for new container classes (unordered_set, unordered_map, unordered_multiset, and unordered_multimap):
+    ret = ecall_new_container_classes_demo(global_eid);
+    if (ret != SGX_SUCCESS)
+        abort();
+
+    // Example for tuple:
+    ret = ecall_tuple_demo(global_eid);
+    if (ret != SGX_SUCCESS)
+        abort();
+
+    // Example for shared_ptr:
+    ret = ecall_shared_ptr_demo(global_eid);
+    if (ret != SGX_SUCCESS)
+        abort();
+    // Example for atomic:
+    ret = ecall_atomic_demo(global_eid);
+    if (ret != SGX_SUCCESS)
+        abort();
+
+//The following threads are part of mutex demo
+	std::thread t1(demo_counter_without_mutex);
+	std::thread t2(demo_counter_without_mutex);
+	std::thread t3(demo_counter_without_mutex);
+	t1.join();
+	t2.join();
+	t3.join();
+	ret = ecall_print_final_value_no_protection(global_eid);
+	if (ret != SGX_SUCCESS)
+		abort();
+	
+	
+	
+//The following threads are part of mutex demo
+    std::thread tm1(demo_counter_mutex);
+    std::thread tm2(demo_counter_mutex);
+    std::thread tm3(demo_counter_mutex);
+    tm1.join();
+    tm2.join();
+    tm3.join();
+    ret = ecall_print_final_value_mutex_demo(global_eid);
+    if (ret != SGX_SUCCESS)
+        abort();
+
+//The following threads are part of condition variable demo
+    std::thread th1(demo_cond_var_run);
+    std::thread th2(demo_cond_var_load);
+    th2.join();
+    th1.join();
+
+}
+

+ 12 - 0
SampleCode/Cxx11SGXDemo/Enclave/Enclave.config.xml

@@ -0,0 +1,12 @@
+<!-- Please refer to User's Guide for the explanation of each field -->
+<EnclaveConfiguration>
+  <ProdID>0</ProdID>
+  <ISVSVN>0</ISVSVN>
+  <StackMaxSize>0x40000</StackMaxSize>
+  <HeapMaxSize>0x100000</HeapMaxSize>
+  <TCSNum>10</TCSNum>
+  <TCSPolicy>1</TCSPolicy>
+  <DisableDebug>0</DisableDebug>
+  <MiscSelect>0</MiscSelect>
+  <MiscMask>0xFFFFFFFF</MiscMask>
+</EnclaveConfiguration>

+ 50 - 0
SampleCode/Cxx11SGXDemo/Enclave/Enclave.cpp

@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2011-2017 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in
+ *     the documentation and/or other materials provided with the
+ *     distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include <stdarg.h>
+#include <stdio.h>      /* vsnprintf */
+
+#include "Enclave.h"
+#include "Enclave_t.h"  /* print_string */
+
+/* 
+ * printf: 
+ *   Invokes OCALL to display the enclave buffer to the terminal.
+ */
+void printf(const char *fmt, ...)
+{
+    char buf[BUFSIZ] = {'\0'};
+    va_list ap;
+    va_start(ap, fmt);
+    vsnprintf(buf, BUFSIZ, fmt, ap);
+    va_end(ap);
+    ocall_print_string(buf);
+}

+ 55 - 0
SampleCode/Cxx11SGXDemo/Enclave/Enclave.edl

@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2011-2017 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in
+ *     the documentation and/or other materials provided with the
+ *     distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+/* Enclave.edl - Top EDL file. */
+
+enclave {
+    
+
+    /* Import ECALL/OCALL from sub-directory EDLs.
+     *  [from]: specifies the location of EDL file. 
+     *  [import]: specifies the functions to import, 
+     *  [*]: implies to import all functions.
+     */
+      
+    from "TrustedLibrary/Libcxx.edl" import *;
+    from "sgx_tstdc.edl" import sgx_thread_wait_untrusted_event_ocall, sgx_thread_set_untrusted_event_ocall, sgx_thread_setwait_untrusted_events_ocall, sgx_thread_set_multiple_untrusted_events_ocall;
+
+    /* 
+     * ocall_print_string - invokes OCALL to display string buffer inside the enclave.
+     *  [in]: copy the string buffer to App outside.
+     *  [string]: specifies 'str' is a NULL terminated buffer.
+     */
+    untrusted {
+        void ocall_print_string([in, string] const char *str);
+    };
+
+};

+ 48 - 0
SampleCode/Cxx11SGXDemo/Enclave/Enclave.h

@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2011-2017 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in
+ *     the documentation and/or other materials provided with the
+ *     distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#ifndef _ENCLAVE_H_
+#define _ENCLAVE_H_
+
+#include <stdlib.h>
+#include <assert.h>
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+void printf(const char *fmt, ...);
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif /* !_ENCLAVE_H_ */

+ 9 - 0
SampleCode/Cxx11SGXDemo/Enclave/Enclave.lds

@@ -0,0 +1,9 @@
+enclave.so
+{
+    global:
+        g_global_data_sim;
+        g_global_data;
+        enclave_entry;
+    local:
+        *;
+};

+ 10 - 0
SampleCode/Cxx11SGXDemo/Enclave/Enclave_debug.lds

@@ -0,0 +1,10 @@
+enclave.so
+{
+    global:
+        g_global_data_sim;
+        g_global_data;
+        enclave_entry;
+        g_peak_heap_used;
+    local:
+        *;
+};

+ 39 - 0
SampleCode/Cxx11SGXDemo/Enclave/Enclave_private.pem

@@ -0,0 +1,39 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIG4gIBAAKCAYEAroOogvsj/fZDZY8XFdkl6dJmky0lRvnWMmpeH41Bla6U1qLZ
+AmZuyIF+mQC/cgojIsrBMzBxb1kKqzATF4+XwPwgKz7fmiddmHyYz2WDJfAjIveJ
+ZjdMjM4+EytGlkkJ52T8V8ds0/L2qKexJ+NBLxkeQLfV8n1mIk7zX7jguwbCG1Pr
+nEMdJ3Sew20vnje+RsngAzdPChoJpVsWi/K7cettX/tbnre1DL02GXc5qJoQYk7b
+3zkmhz31TgFrd9VVtmUGyFXAysuSAb3EN+5VnHGr0xKkeg8utErea2FNtNIgua8H
+ONfm9Eiyaav1SVKzPHlyqLtcdxH3I8Wg7yqMsaprZ1n5A1v/levxnL8+It02KseD
+5HqV4rf/cImSlCt3lpRg8U5E1pyFQ2IVEC/XTDMiI3c+AR+w2jSRB3Bwn9zJtFlW
+KHG3m1xGI4ck+Lci1JvWWLXQagQSPtZTsubxTQNx1gsgZhgv1JHVZMdbVlAbbRMC
+1nSuJNl7KPAS/VfzAgEDAoIBgHRXxaynbVP5gkO0ug6Qw/E27wzIw4SmjsxG6Wpe
+K7kfDeRskKxESdsA/xCrKkwGwhcx1iIgS5+Qscd1Yg+1D9X9asd/P7waPmWoZd+Z
+AhlKwhdPsO7PiF3e1AzHhGQwsUTt/Y/aSI1MpHBvy2/s1h9mFCslOUxTmWw0oj/Q
+ldIEgWeNR72CE2+jFIJIyml6ftnb6qzPiga8Bm48ubKh0kvySOqnkmnPzgh+JBD6
+JnBmtZbfPT97bwTT+N6rnPqOOApvfHPf15kWI8yDbprG1l4OCUaIUH1AszxLd826
+5IPM+8gINLRDP1MA6azECPjTyHXhtnSIBZCyWSVkc05vYmNXYUNiXWMajcxW9M02
+wKzFELO8NCEAkaTPxwo4SCyIjUxiK1LbQ9h8PSy4c1+gGP4LAMR8xqP4QKg6zdu9
+osUGG/xRe/uufgTBFkcjqBHtK5L5VI0jeNIUAgW/6iNbYXjBMJ0GfauLs+g1VsOm
+WfdgXzsb9DYdMa0OXXHypmV4GwKBwQDUwQj8RKJ6c8cT4vcWCoJvJF00+RFL+P3i
+Gx2DLERxRrDa8AVGfqaCjsR+3vLgG8V/py+z+dxZYSqeB80Qeo6PDITcRKoeAYh9
+xlT3LJOS+k1cJcEmlbbO2IjLkTmzSwa80fWexKu8/Xv6vv15gpqYl1ngYoqJM3pd
+vzmTIOi7MKSZ0WmEQavrZj8zK4endE3v0eAEeQ55j1GImbypSf7Idh7wOXtjZ7WD
+Dg6yWDrri+AP/L3gClMj8wsAxMV4ZR8CgcEA0fzDHkFa6raVOxWnObmRoDhAtE0a
+cjUj976NM5yyfdf2MrKy4/RhdTiPZ6b08/lBC/+xRfV3xKVGzacm6QjqjZrUpgHC
+0LKiZaMtccCJjLtPwQd0jGQEnKfMFaPsnhOc5y8qVkCzVOSthY5qhz0XNotHHFmJ
+gffVgB0iqrMTvSL7IA2yqqpOqNRlhaYhNl8TiFP3gIeMtVa9rZy31JPgT2uJ+kfo
+gV7sdTPEjPWZd7OshGxWpT6QfVDj/T9T7L6tAoHBAI3WBf2DFvxNL2KXT2QHAZ9t
+k3imC4f7U+wSE6zILaDZyzygA4RUbwG0gv8/TJVn2P/Eynf76DuWHGlaiLWnCbSz
+Az2DHBQBBaku409zDQym3j1ugMRjzzSQWzJg0SIyBH3hTmnYcn3+Uqcp/lEBvGW6
+O+rsXFt3pukqJmIV8HzLGGaLm62BHUeZf3dyWm+i3p/hQAL7Xvu04QW70xuGqdr5
+afV7p5eaeQIJXyGQJ0eylV/90+qxjMKiB1XYg6WYvwKBwQCL/ddpgOdHJGN8uRom
+e7Zq0Csi3hGheMKlKbN3vcxT5U7MdyHtTZZOJbTvxKNNUNYH/8uD+PqDGNneb29G
+BfGzvI3EASyLIcGZF3OhKwZd0jUrWk2y7Vhob91jwp2+t73vdMbkKyI4mHOuXvGv
+fg95si9oO7EBT+Oqvhccd2J+F1IVXncccYnF4u5ZGWt5lLewN/pVr7MjjykeaHqN
+t+rfnQam2psA6fL4zS2zTmZPzR2tnY8Y1GBTi0Ko1OKd1HMCgcAb5cB/7/AQlhP9
+yQa04PLH9ygQkKKptZp7dy5WcWRx0K/hAHRoi2aw1wZqfm7VBNu2SLcs90kCCCxp
+6C5sfJi6b8NpNbIPC+sc9wsFr7pGo9SFzQ78UlcWYK2Gu2FxlMjonhka5hvo4zvg
+WxlpXKEkaFt3gLd92m/dMqBrHfafH7VwOJY2zT3WIpjwuk0ZzmRg5p0pG/svVQEH
+NZmwRwlopysbR69B/n1nefJ84UO50fLh5s5Zr3gBRwbWNZyzhXk=
+-----END RSA PRIVATE KEY-----

+ 917 - 0
SampleCode/Cxx11SGXDemo/Enclave/TrustedLibrary/Libcxx.cpp

@@ -0,0 +1,917 @@
+/*
+ * Copyright (C) 2011-2017 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in
+ *     the documentation and/or other materials provided with the
+ *     distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include <string>
+#include <vector>
+#include <iterator>
+#include <typeinfo>
+#include <functional>
+#include <algorithm>
+#include <unordered_set>
+#include <unordered_map>
+#include <initializer_list>
+#include <tuple>
+#include <memory>
+#include <atomic>
+#include <mutex>
+#include <condition_variable>
+#include <map>
+
+#include "../Enclave.h"
+#include "Enclave_t.h"
+
+
+// Feature name        : Lambda functions
+// Feature description : It is used to create a function object that can capture variables in scope.
+// Demo description    : Shows lambda capture options and a some basic usages.
+void ecall_lambdas_demo()
+{
+    // Lambdas capture options:
+    int local_var = 0;
+
+    [] { return true; };                     // captures nothing
+
+    [&] { return ++local_var; };             // captures all variable by reference
+    [&local_var] { return ++local_var; };    // captures local_var by reference
+    [&, local_var] { return local_var; };    // captures all by reference except local_var
+
+    [=] { return local_var; };               // captures all variable by value
+    [local_var] { return local_var; };       // captures local_var by value
+    [=, &local_var] { return ++local_var; }; // captures all variable by value except local_var
+
+    // Sample usages for lamdbas:
+    std::vector< int> v { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
+    printf("[Lambdas] Initial array using lambdas: { ");
+
+    // Print the elements in an array using lambdas
+    std::for_each(std::begin(v), std::end(v), [](int elem) { printf("%d ", elem); }); //capture specification
+    printf("}.\n");
+
+    // Find the first odd number using lambda as an unary predicate when calling find_if.
+    auto first_odd_element = std::find_if(std::begin(v), std::end(v), [=](int elem) { return elem % 2 == 1; });
+
+    if (first_odd_element != std::end(v))
+        printf("[Lambdas] First odd element in the array is %d. \n", *first_odd_element);
+    else
+        printf("[Lambdas] No odd element found in the array.\n");
+
+    // Count the even numbers using a lambda function as an unary predicate when calling count_if.
+    long long  number_of_even_elements = std::count_if(std::begin(v), std::end(v), [=](int  val) { return val % 2 == 0; });
+    printf("[Lambdas] Number of even elements in the array is %lld.\n", number_of_even_elements);
+
+    // Sort the elements of an array using lambdas
+    std::sort(std::begin(v), std::end(v), [](int e1, int e2) {return e2 < e1; });
+
+    // Print the elements in an array using lambdas
+    printf("[Lambdas] Array after sort: { ");
+    std::for_each(std::begin(v), std::end(v), [](int elem) { printf("%d ", elem); });
+    printf("}. \n");
+    printf("\n"); // end of demo
+}
+
+
+// Feature name        : auto 
+// Feature description : It is used for type deduction
+// Demo description    : Shows basic usages of auto specifier with different types.
+
+// Helper function for ecall_auto_demo:
+void sample_func_auto_demo()
+{
+    printf("[auto] Function sample_func_auto_demo is called. \n");
+}
+
+void ecall_auto_demo()
+{
+    double local_var = 0.0;
+
+    auto a = 7; // Type of variable a is deduced to be int
+    printf("[auto] Type of a is int. typeid = %s.\n", typeid(a).name());
+
+    const auto b1 = local_var, *b2 = &local_var; // auto can be used with modifiers like const or &. 
+    printf("[auto] Type of b1 is const double. typeid = %s.\n", typeid(b1).name());
+    printf("[auto] Type of b2 is const double*. typeid = %s.\n", typeid(b2).name());
+    (void)b1;
+    (void)b2;
+
+    auto c = 0, *d = &a; // multiple variable initialization if the deduced type does match 
+    printf("[auto] Type of c is int. typeid = %s.\n", typeid(c).name());
+    printf("[auto] Type of d is int*. typeid = %s.\n", typeid(d).name());
+    (void)c;
+    (void)d;
+
+    auto lambda = [] {}; // can be used to define lambdas
+    printf("[auto] Type of lambda is [] {}. typeid = %s.\n", typeid(lambda).name());
+    (void)lambda;
+                        
+    auto func = sample_func_auto_demo; // can be used to deduce type of function    
+    printf("[auto] Type of func is void(__cdecl*)(void). typeid = %s.\n", typeid(func).name());
+    func();
+
+    printf("\n"); // end of demo
+}
+
+// Feature name        : decltype
+// Feature description : It is used for type deduction
+// Demo description    : Shows basic usages of decltype specifier with different types. 
+void ecall_decltype_demo()
+{
+    int a = 0 ;
+    decltype(a) b = 0; // create an element of the same type as another element 
+    printf("[decltype] Type of b is int. typeid = %s.\n", typeid(b).name());
+
+    double c = 0;
+    decltype(a + c) sum = a + c; // deduce type of a sum of elements of different types and create an element of that type.
+                                 // most usefull in templates.
+    printf("[decltype] Type of sum is double. typeid = %s.\n", typeid(sum).name());
+    (void)sum;
+    (void)b;
+    printf("\n"); // end of demo
+}
+
+// Feature name         : enum classes
+// Feature description  : A new type of enum that solves problems found in old enum like :
+//                        unscoping of enum values and the possibility to compare them with int
+// Demo description     : Shows basic usages of enum classes.
+void ecall_strongly_typed_enum_demo()
+{
+    // In enum class the underlying type can be set.  In the case bellow it is char.
+    enum class DaysOfWeek : char { MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY };
+
+    // initialization of variable of type DaysOfWeek
+    DaysOfWeek random_day = DaysOfWeek::MONDAY;
+    (void)random_day;
+
+    // In is not mandatory to specify the underlying type.
+    enum class Weekend { SATURDAY, SUNDAY };
+
+    // The two enum classes above: days_of_week and weekend ilustrate that it is now possible to have two enum classes with the same values in them.
+
+    // end of demo
+}
+
+// Feature name        : Range based for loops
+// Feature description : Easy to read way of accessing elements in an container.
+// Demo description    : Shows basic usage of range based for loop with c array and vector.
+void ecall_range_based_for_loops_demo()
+{
+    char array_of_letters[] = { 'a','b','c','d' };
+    std::vector<char> vector_of_letters = { 'a','b','c','d' };
+
+    printf("[range_based_for_loops] Using range based for loops to print the content of an array: { ");
+    for (auto elem : array_of_letters)
+        printf("%c ", elem);
+    printf("}. \n");
+
+    printf("[range_based_for_loops] Using range based for loops to print the content of an vector: { ");
+    for (auto elem : vector_of_letters)
+        printf("%c ", elem);
+    printf("}.\n");
+    
+    printf("\n"); // end of demo
+}
+
+
+// Feature name        : static_assert
+// Feature description : It is used to make assertions at compile time.
+// Demo description    : Shows basic usage of static_assert with compile time operation.
+void ecall_static_assert_demo()
+{
+    static_assert(sizeof(int) < sizeof(double), "Error : sizeof(int) < sizeof(double) ");
+    const int a = 0;
+    static_assert(a == 0, "Error: value of a is not 0");
+
+    // end of demo
+}
+
+
+// Feature name        : New virtual function controls : override, final, default, and delete
+// Feature description : - delete   : a deleted function cannot be inherited
+//				         - final    : a final function cannot be overrided in the derived class
+//                       - default  : intruction to the compiler to generate a default function
+//                       - override : ensures that a virtual function from derived class overrides a function from base
+// Demo description : Shows basic usage of new virtual function control.
+
+/* Helper class for ecall_virtual_function_control_demo.*/
+class Base
+{
+public:
+
+    virtual void f_cannot_be_inherited() final {};
+    Base(const Base &) = delete;
+    Base() = default;
+    virtual void f_must_be_overrided() {};
+};
+
+/* Helper class for ecall_virtual_function_control_demo.*/
+class Derived : Base
+{
+public:
+    /* The code bellow in this comment does not compile.
+    The function cannot be override because it is declared with keyword final in base
+    virtual double f_cannot_be_inherited() {};
+    */
+
+    /*The keyword override assures that the function overrides a base class member*/
+    virtual void f_must_be_overrided() override {};
+};
+
+void ecall_virtual_function_control_demo()
+{
+    // The default constructor will be called generated by the compiler with explicit keyword default
+    Base a;
+    // Trying to use the copy contructor will generate code that does not compile because it is deleted
+    // Base b = a;
+
+    // end of demo
+}
+
+// Feature name        : Delegating constructors
+// Feature description : A class constructors may have common code which can be delegated to a constructor to avoid code repetion
+// Demo description    : Shows basic usage of delegating constructors
+
+// Helper class for ecall_delegating_constructors
+class DemoDelegatingConstructors
+{
+    int a, b, c;
+public:
+    DemoDelegatingConstructors(int param_a, int param_b, int param_c)
+    {
+        this->a = param_a;
+        this->b = param_b;
+        this->c = param_c;
+        /*common initialization*/
+        switch (c)
+        {
+        case 1:
+            printf("[delegating constructors] Called from DemoDelegatingConstructors(int a, int b). \n");
+            break;
+        case 2:
+            printf("[delegating constructors] Called from DemoDelegatingConstructors(int a). \n");
+            break;
+        default:
+            printf("[delegating constructors] Called from DemoDelegatingConstructors(int a, int b, int c).\n");
+            break;
+        }
+    }
+    DemoDelegatingConstructors(int param_a, int param_b) : DemoDelegatingConstructors(param_a, param_b, 1) {}
+    DemoDelegatingConstructors(int param_a) : DemoDelegatingConstructors(param_a, 0, 2) {}
+};
+
+void ecall_delegating_constructors_demo()
+{
+    DemoDelegatingConstructors a(1, 2, 3);
+    DemoDelegatingConstructors b(1, 2);
+    DemoDelegatingConstructors c(1);
+    
+    printf("\n"); // end of demo
+}
+
+// Feature name        : std::function
+// Feature description : It is used to store and invoke a callable
+// Demo description    : Shows basic usage of std::function
+
+// Helper class for ecall_std_function_demo:
+void sample_std_function1()
+{
+    printf("[std_function] calling sample_std_function1\n");
+}
+
+void ecall_std_function_demo()
+{
+    // Example with functions
+    std::function<void()> funct = sample_std_function1;
+    funct();
+
+    //Example with lambda
+    std::function<void()> funct_lambda = [] { printf("[std_function] calling a lambda function\n");  };
+    funct_lambda();
+
+    printf("\n"); // end of demo
+}
+
+// Feature name        : std::all_of, std::any_of, std::none_of
+// Feature description : New C++11 algorithms 
+// Demo description    : Shows basic usage of the std::all_of, std::any_of, std::none_of.
+void ecall_cxx11_algorithms_demo()
+{
+    std::vector<int> v = { 0, 1, 2, 3, 4, 5 };
+    bool are_all_of = all_of(begin(v), end(v), [](int e) { return e % 2 == 0; });
+    printf("[cxx11_algorithms] All elements in  { 0 1 2  3 4 5 } are even is  %s. \n", are_all_of ? "true" : "false");
+
+    bool are_any_of = any_of(begin(v), end(v), [](int e) { return e % 2 == 0; });
+    printf("[cxx11_algorithms] Some elements in  { 0 1 2 3 4 5 } are even is  %s. \n", are_any_of ? "true" : "false");
+
+    bool are_none_of = none_of(begin(v), end(v), [](int e) { return e % 2 == 0; });
+    printf("[cxx11_algorithms] Some elements in  { 0 1 2 3 4 5 } are even is  %s. \n", are_none_of ? "true" : "false");
+
+    printf("\n"); // end of demo
+}
+
+
+// Feature name        : variadic templates
+// Feature description : Templates that can have multiple arguments
+// Demo description    : Shows basic usage of variadic templates
+
+// Helper template for ecall_variadic_templates_demo:
+template<typename T>
+T sum(T elem)
+{
+    return elem;
+}
+
+template<typename T, typename... Args>
+T sum(T elem1, T elem2, Args... args)
+{
+    return elem1 + elem2 + sum(args...);
+}
+
+void ecall_variadic_templates_demo()
+{
+    int computed_sum = sum(1, 2, 3, 4, 5);
+    printf("[variadic_templates] The sum  of paramters (1, 2, 3, 4, 5) is %d. \n", computed_sum);
+    printf("\n"); // end of demo
+}
+
+// Feature name        : Substitution failure is not an error (SFINAE)
+// Feature description : Describes the case where a substitution error in templates does not cause errors
+// Demo description    : Shows basic usage of SFINAE
+
+/*first candidate for substitution*/
+template <typename T> void f(typename T::A*) { printf("[sfinae] First candidate for substitution is matched.\n"); }; 
+
+/*second candidate for substitution*/
+template <typename T> void f(T) { printf("[sfinae] Second candidate for substitution is matched.\n"); }
+
+void ecall_SFINAE_demo()
+{
+    f<int>(0x0);   // even if the first canditate substition will fail, the second one will pass
+    printf("\n");  // end of demo
+}
+
+//Feature name        : Initializer lists
+//Feature description : An object of type std::initializer_list<T> is a lightweight proxy object that provides access to an array of objects of type const T.
+//Demo description    : Demonstrates the usage of initializer list in the constructor of an object in enclave.
+class Number
+{
+public:
+    Number(const std::initializer_list<int> &v) {
+        for (auto i : v) {
+            elements.push_back(i);
+        }
+    }
+
+    void print_elements() {
+        printf("[initializer_list] The elements of the vector are:");
+        for (auto item : elements) {
+            printf(" %d", item);
+        }
+        printf(".\n");
+    }
+private:
+    std::vector<int> elements;
+};
+
+void ecall_initializer_list_demo()
+{
+    printf("[initializer_list] Using initializer list in the constructor. \n");
+    Number m = {10, 9, 8, 7, 6, 5, 4, 3, 2, 1};
+    m.print_elements();
+
+    printf("\n"); //end of demo
+}
+
+
+// Feature name        : Rvalue references and move semantics;
+// Feature description : They are used for memory usage optimazation by eliminating copy operations
+// Demo description    : Shows basic usage of rvalue, move constructor, and move operator
+
+// Helper class for ecall_rvalue_demo
+class DemoBuffer
+{
+public:
+    unsigned int size = 100;
+    char *buffer;
+
+    DemoBuffer(int param_size)
+    {
+        this->size = param_size;
+        buffer = new char[size];
+        printf("[rvalue] Called constructor : DemoBuffer(int size).\n");
+    }
+
+    // A typical copy constructor  needs to alocate memory for a new copy 
+    // Copying an big array is an expensive operation
+    DemoBuffer(const DemoBuffer & rhs)
+    {
+        this->size = rhs.size;
+        buffer = new char[rhs.size];
+        memcpy(buffer, rhs.buffer, size);
+        printf("[rvalue] Called copy constructor : DemoBuffer(const DemoBuffer & rhs).\n");
+    }
+
+    // A typical move constructor can reuse the memory pointed by the buffer
+    DemoBuffer(DemoBuffer && rhs)
+    {
+        buffer = rhs.buffer;
+        size = rhs.size;
+        // reset state of rhs
+        rhs.buffer = NULL;
+        rhs.size = 0;
+        printf("[rvalue] Called move constructor : DemoBuffer(DemoBuffer && rhs).\n");
+    }
+    ~DemoBuffer()
+    {
+        delete buffer;
+    }
+
+};
+
+// Helper class for ecall_rvalue_demo
+DemoBuffer foobar(int a)
+{
+    DemoBuffer x(100);
+    DemoBuffer y(100);
+
+    if (a > 0)
+        return x;
+    else
+        return y;
+}
+void ecall_rvalue_demo()
+{
+    // This will call the constructor
+    printf("[rvalue] DemoBuffer a(100).\n");
+    DemoBuffer a(100);
+    
+    printf("[rvalue] DemoBuffer foobar(100). \n");
+    // Initializing variable d using a temporary object will result in a call to move constructor
+    // This is usefull because it reduces the memory cost of the operation.
+    DemoBuffer d(foobar(100));
+
+    // This will call the copy constructor. State of a will not change.
+    printf("[rvalue] DemoBuffer b(a).\n");
+    DemoBuffer b(a);
+
+    printf("[rvalue] DemoBuffer c(std::move(a)).\n");
+    // explicitly cast a to an rvalue so that c will be created using move constructor. 
+    // State of a is going to be reseted.
+    DemoBuffer c(std::move(a));
+
+    printf("\n"); // end of demo
+}
+
+// Feature name        : Nullptr
+// Feature description : Resolves the issues of converting NULL to integral types 
+// Demo description    : Shows basic usage of nullptr
+
+// overload candidate 1
+void nullptr_overload_candidate(int i) {
+    (void)i;
+    printf("[nullptr] called void nullptr_overload_candidate(int i).\n");
+}
+
+// overload candidate 2
+void nullptr_overload_candidate(int* ptr) {
+    (void)ptr;
+    printf("[nullptr] called void nullptr_overload_candidate(int* ptr).\n");
+}
+
+template<class F, class A>
+void Fwd(F f, A a)
+{
+    f(a);
+}
+
+void g(int* i)
+{
+    (void)i;
+    printf("[nullptr] Function %s called\n", __FUNCTION__);
+}
+
+// Feature name        :
+// Feature description :
+// Demo description    :
+void ecall_nullptr_demo()
+{
+    // NULL can be converted to integral types() like int and will call overload candidate 1
+    nullptr_overload_candidate(NULL);
+
+    // nullptr can't be converted to integral types() like int and will call overload candidate 2
+    nullptr_overload_candidate(nullptr);
+
+    g(NULL);           // Fine
+    g(0);              // Fine
+    Fwd(g, nullptr);   // Fine
+    //Fwd(g, NULL);  // ERROR: No function g(int)
+
+    printf("\n"); // end of demo
+}
+
+// Feature name        : Scoped enums
+// Feature description :
+// Demo description    :
+enum class Color { orange, brown, green = 30, blue, red };
+
+void ecall_enum_class_demo()
+{
+    int n = 0;
+    Color color1 = Color::brown;
+    switch (color1)
+    {
+        case Color::orange: printf("[enum class] orange"); break;
+        case Color::brown:  printf("[enum class] brown"); break;
+        case Color::green:  printf("[enum class] green"); break;
+        case Color::blue:   printf("[enum class] blue"); break;
+        case Color::red:    printf("[enum class] red"); break;
+    }
+    // n = color1; // Not allowed: no scoped enum to int conversion
+    n = static_cast<int>(color1); // OK, n = 1
+    printf(" - int = %d\n", n);
+
+    Color color2 = Color::red;
+    switch (color2)
+    {
+        case Color::orange: printf("[enum class] orange"); break;
+        case Color::brown:  printf("[enum class] brown"); break;
+        case Color::green:  printf("[enum class] green"); break;
+        case Color::blue:   printf("[enum class] blue"); break;
+        case Color::red:    printf("[enum class] red"); break;
+    }
+    n = static_cast<int>(color2); // OK, n = 32
+    printf(" - int = %d\n", n);
+
+    Color color3 = Color::green;
+    switch (color3)
+    {
+        case Color::orange: printf("[enum class] orange"); break;
+        case Color::brown:  printf("[enum class] brown"); break;
+        case Color::green:  printf("[enum class] green"); break;
+        case Color::blue:   printf("[enum class] blue"); break;
+        case Color::red:    printf("[enum class] red"); break;
+    }
+    n = static_cast<int>(color3); // OK, n = 30
+    printf(" - int = %d\n", n);
+    printf("\n");
+}
+
+// Feature name        : new container classes
+// Feature description : unordered_set, unordered_map, unordered_multiset, and unordered_multimap
+// Demo description    : Shows basic usage of new container classes
+void ecall_new_container_classes_demo()
+{
+    // unordered_set
+    // container used for fast acces that groups elements in buckets based on their hash
+
+    std::unordered_set<int> set_of_numbers = { 0, 1, 2, 3, 4, 5 };
+    const int searchVal = 3;
+    std::unordered_set<int>::const_iterator got = set_of_numbers.find(searchVal);
+
+    if (got == set_of_numbers.end())
+        printf("[new_container_classes] unordered_set { 0, 1, 2, 3, 4, 5} has value 3.\n");
+    else
+        printf("[new_container_classes] unordered_set { 0, 1, 2, 3, 4, 5} it does not have value 3.\n");
+
+    // unordered_multiset
+    // container used for fast acces that groups non unique elements in buckets based on their hash
+    std::unordered_multiset<int> multiset_of_numbers = { 0, 1, 2, 3, 3, 3 };
+    printf("[new_container_classes] multiset_set { 0, 1, 2, 3, 3, 3}  has %d elements with value %d.\n",
+        (int)multiset_of_numbers.count(searchVal), searchVal);
+
+    // unordered_map
+    std::unordered_map<std::string, int> grades{ { "A", 10 },{ "B", 8 },{ "C", 7 },{ "D", 5 },{ "E", 3 } };
+    printf("[new_container_classes] unordered_map elements: {");
+    for (auto pair : grades) {
+        printf("[%s %d] ", pair.first.c_str(), pair.second);
+    }
+
+    printf("}.\n");
+
+    // unordered_multimap
+    std::unordered_multimap<std::string, int> multimap_grades{ { "A", 10 },{ "B", 8 },{ "B", 7 },{ "E", 5 },{ "E", 3 },{ "E",1 } };
+
+    printf("[new_container_classes] unordered_multimap elements: {");
+    for (auto pair : multimap_grades) {
+        printf("[%s %d] ", pair.first.c_str(), pair.second);
+    }
+    printf("}.\n");
+
+    printf("\n"); // end of demo
+}
+
+// Feature name        : Tuple
+// Feature description : Objects that pack elements of multiple types which can be accessed by index
+// Demo description    : Shows basic usage of tuple: creation and access
+void ecall_tuple_demo()
+{
+    // Create tuple using std::make_tuple
+    char array_of_letters[4] = {'A','B','C','D'};
+    std::vector<char> vector_of_letters = { 'A','B','C','D' };
+    std::map<char, char> map_of_letters = { {'B','b' } };
+    
+    // Creating a tuple using a tuple constructor
+    std::tuple<int, std::string> tuple_sample_with_constructor(42, "Sample tuple");
+    (void)tuple_sample_with_constructor;
+
+    // Creating a tuple using std::make_tuple
+    auto tuple_sample = std::make_tuple("<First element of TupleSample>", 1, 7.9, vector_of_letters, array_of_letters, map_of_letters);
+
+    // Access the elements in tupleSample using std::get<index>
+    printf("[tuple] show first  element in TupleSample: %s. \n", std::get<0>(tuple_sample));
+    printf("[tuple] show second element in TupleSample: %d. \n", std::get<1>(tuple_sample));
+    printf("[tuple] show third  element in TupleSample: %f. \n", std::get<2>(tuple_sample));
+    
+    // Getting vector from a tuple
+    std::vector<char> temp_vector = std::get<3>(tuple_sample);
+    (void)temp_vector;
+
+    // Getting array from a tuple
+    int first_elem_of_array = std::get<4>(tuple_sample)[0];
+    (void)first_elem_of_array;
+
+    // Getting map from a tuple
+    std::map<char, char> temp_map = std::get<5>(tuple_sample);
+    (void)temp_map;
+    printf("\n"); // end of demo
+}
+
+// Feature name        : new smart pointer
+// Feature description : shared_ptr and unique_ptr
+// Demo decription     :  Shows basic usage of smart pointers
+// Helper class for ecall_shared_ptr_demo
+class DemoSmartPtr
+{
+    std::string smartPointerType;
+public:
+    DemoSmartPtr(std::string param_smartPointerType)
+    {
+        printf("[smart_ptr] In construct of object demo_smart_ptr  using %s. \n", param_smartPointerType.c_str());
+        this->smartPointerType = param_smartPointerType;
+    }
+    ~DemoSmartPtr()
+    {
+        printf("[smart_ptr] In deconstructor of object demo_smart_ptr using %s. \n", smartPointerType.c_str());
+    }
+};
+
+void ecall_shared_ptr_demo()
+{
+    // std::shared_ptr is smart pointer that takes ownership of an object using a pointer
+    // The object is freed when the last smart_pointer does not point to it.
+
+    // Creating a shared pointer using std::make_shared
+    auto shared_ptr = std::make_shared<DemoSmartPtr>("smart_ptr.");  // The constructor of DemoSmartPtr will be called here
+
+    printf("[smart_ptr] shared_ptr reference count = %ld.  \n", shared_ptr.use_count());
+    auto shared_ptr2 = shared_ptr;
+    printf("[smart_ptr] shared_ptr reference count = %ld incresead after creating another shared pointer.\n", shared_ptr.use_count());
+    shared_ptr2.reset();
+    printf("[smart_ptr] shared_ptr reference count = %ld decresead after calling releasing ownership. \n", shared_ptr.use_count());
+
+    // std::unique_ptr is smart pointer that takes ownership of an object using a pointer
+    // it is different from smart_ptr in the sense that only one unique_ptr can take ownership
+    
+    std::unique_ptr<DemoSmartPtr> unique_ptr(new DemoSmartPtr("unique_ptr"));
+    // When going out of scope both shared_ptr and unique_ptr release the objects they own
+    
+    // end of demo
+}
+
+//Feature name       : atomic
+//Feature description: The atomic library provides components for fine-grained atomic operations allowing for lockless concurrent programming.
+//                     Each atomic operation is indivisible with regards to any other atomic operation that involves the same object. 
+//                     Atomic objects are free of data races.
+//Demo description   : Demonstrates the usage of atomic types, objects and functions in enclave.
+void ecall_atomic_demo()
+{
+    printf("[atomic] Atomic types, objects and functions demo.\n");
+
+    printf("[atomic_store] Defining an atomic_char object with an initial value of 5.\n");
+    std::atomic_char atc(5);
+    printf("[atomic_store] The current value stored in the atomic object is: %d\n", atc.load());
+    printf("[atomic_store] Replacing the value of the atomic object with a non-atomic value of 3.\n");
+    std::atomic_store<char>(&atc, 3);
+    printf("[atomic_store] The new value of the atomic object is: %d.\n", atc.load());
+
+    printf("\n");
+
+    printf("[atomic_store_explicit] Defining an atomic_short object with an initial value of 5.\n");
+    std::atomic_short ats(5);
+    printf("[atomic_store_explicit] The current value stored in the atomic object is: %d.\n", ats.load());
+    printf("[atomic_store_explicit] Replacing the value of the atomic object with a non-atomic value of 3.\n");
+    std::atomic_store_explicit<short>(&ats, 3, std::memory_order_seq_cst);
+    printf("[atomic_store] The new value of the atomic object is: %d.\n", ats.load());
+
+    printf("\n");
+
+    printf("[atomic_load] Defining an atomic_int object with an initial value of 4.\n");
+    std::atomic_int ati1(4);
+    printf("[atomic_load] Obtaining the value of the atomic object and saving it in a int variable.\n");
+    int val = std::atomic_load(&ati1);
+    printf("[atomic_load] The obtained value is %d.\n", val);
+
+    printf("\n");
+
+    printf("[atomic_load_explicit] Defining an atomic_int object with an initial value of 2.\n");
+    std::atomic_int ati2(2);
+    printf("[atomic_load_explicit] Obtaining the value of the atomic object and saving it in a int variable.\n");
+    int val1 = std::atomic_load_explicit(&ati2, std::memory_order_seq_cst);
+    printf("[atomic_load_explicit] The obtained value is %d.\n", val1);
+
+    printf("\n");
+
+    printf("[atomic_fetch_add] Defining an atomic_int object with an initial value of 7.\n");
+    std::atomic_int ati(7);
+    printf("[atomic_fetch_add] The current value stored in the atomic object is: %d.\n", ati.load());
+    printf("[atomic_fetch_add] Adding a non-atomic value of 8 to the atomic object.\n");
+    std::atomic_fetch_add(&ati, 8);
+    printf("[atomic_fetch_add] The new value of the atomic object is: %d.\n", ati.load());
+
+    printf("\n");
+
+    printf("[atomic_fetch_add_explicit] Defining an atomic_uint object with an initial value of 7.\n");
+    std::atomic_uint atui(7);
+    printf("[atomic_fetch_add_explicit] The current value stored in the atomic object is: %u.\n", atui.load());
+    printf("[atomic_fetch_add_explicit] Adding a non-atomic value of 8 to the atomic object.\n");
+    std::atomic_fetch_add_explicit<unsigned int>(&atui, 8, std::memory_order_seq_cst);
+    printf("[atomic_fetch_add_explicit] The new value of the atomic object is: %u.\n", atui.load());
+
+    printf("\n");
+
+    printf("[atomic_fetch_sub] Defining an atomic_long object with an initial value of 20.\n");
+    std::atomic_long atl(20);
+    printf("[atomic_fetch_sub] The current value stored in the atomic object is: %ld.\n", atl.load());
+    printf("[atomic_fetch_sub] Substracting a non-atomic value of 8 from the value of the atomic object.\n");
+    std::atomic_fetch_sub<long>(&atl, 8);
+    printf("[atomic_fetch_sub] The new value of the atomic object is: %ld.\n", atl.load());
+
+    printf("\n");
+
+    printf("[atomic_fetch_sub_explicit] Defining an atomic_llong object with an initial value of 20.\n");
+    std::atomic_llong atll(20);
+    printf("[atomic_fetch_sub_explicit] The current value stored in the atomic object is: %lld.\n", atll.load());
+    printf("[atomic_fetch_sub_explicit] Substracting a non-atomic value of 8 from the value of the atomic object.\n");
+    std::atomic_fetch_sub_explicit<long long>(&atll, 8, std::memory_order_seq_cst);
+    printf("[atomic_fetch_sub_explicit] The new value of the atomic object is: %lld.\n", atll.load());
+
+    printf("\n"); // end of demo
+}
+
+//Feature name        : mutex
+//Feature description : The mutex class is a synchronization primitive that can be used to protect shared data
+//                     from being simultaneously accessed by multiple threads.
+//Demo description    : Demonstrates mutex protection when incrementing values in multiple threads.
+
+//Structure used in mutex demo to show the behavior without using a mutex
+struct CounterWithoutMutex {
+	int value;
+
+	CounterWithoutMutex() : value(0) {}
+
+	void increment() {
+		++value;
+	}
+};
+
+CounterWithoutMutex counter_without_protection;
+
+//E-call used by mutex demo to perform the incrementation using a counter without mutex protection
+void ecall_mutex_demo_no_protection()
+{
+	for (int i = 0; i < 100000; ++i) {
+		counter_without_protection.increment();
+	}
+}
+
+//E-call used by mutex demo to get the final value of the counter from enclave
+void ecall_print_final_value_no_protection()
+{
+	printf("[mutex] Incrementing values in three threads without mutex protection, using a 100000 times loop. \n[mutex]Expected value is 300000. The final value is %d.\n", counter_without_protection.value);
+}
+
+
+//Structure used in mutex demo
+struct CounterProtectedByMutex {
+    std::mutex mutex;
+    int value;
+
+    CounterProtectedByMutex() : value(0) {}
+
+    void increment() {
+        //locking the mutex to avoid simultaneous incrementation in different threads
+        mutex.lock();
+        ++value;
+        //unlocking the mutex
+        mutex.unlock();
+    }
+};
+
+CounterProtectedByMutex counter_with_protection;
+
+//E-call used by mutex demo to perform the actual incrementation
+void ecall_mutex_demo()
+{
+    for (int i = 0; i < 100000; ++i) {
+        counter_with_protection.increment();
+    }
+}
+
+//E-call used by mutex demo to get the final value of the counter from enclave
+void ecall_print_final_value_mutex_demo()
+{
+    printf("[mutex] Mutex protection when incrementing a value in 3 threads, using a 100000 times loop. \n[mutex]Expected value is 300000. The final value is %d.\n", counter_with_protection.value);
+}
+
+//Feature name       : condition_variable
+//Feature description: The condition_variable class is a synchronization primitive that can be used to block a thread, 
+//                     or multiple threads at the same time, until another thread both modifies a shared variable (the condition), 
+//                     and notifies the condition_variable.
+//Demo description   : Demonstrates condition_variable usage in a two threads environment. One thread is used for loading the data and 
+//                     the other processes the loaded data. The thread for processing the data waits untill the data is loaded in the 
+//                     other thread and gets notified when loading is completed.
+
+//This class is used by condition variable demo
+class DemoConditionVariable
+{
+    std::mutex mtx;
+    std::condition_variable cond_var;
+    bool data_loaded;
+public:
+    DemoConditionVariable()
+    {
+        data_loaded = false;
+    }
+    void load_data()
+    {
+        //Simulating loading of the data
+        printf("[condition_variable] Loading Data...\n");
+		{
+			// Locking the data structure
+			std::lock_guard<std::mutex> guard(mtx);
+			// Setting the flag to true to signal load data completion
+			data_loaded = true;
+		}
+        // Notify to unblock the waiting thread
+        cond_var.notify_one();
+    }
+    bool is_data_loaded()
+    {
+        return data_loaded;
+    }
+    void main_task()
+    {
+        printf("\n");
+        printf("[condition_variable] Running condition variable demo.\n");
+    
+        // Acquire the lock
+        std::unique_lock<std::mutex> lck(mtx);
+    
+        printf("[condition_variable] Waiting for the data to be loaded in the other thread.\n");
+        cond_var.wait(lck, std::bind(&DemoConditionVariable::is_data_loaded, this));
+        printf("[condition_variable] Processing the loaded data.\n");
+        printf("[condition_variable] Done.\n");
+    }
+};
+
+
+DemoConditionVariable app;
+
+//E-call used by condition_variable demo - processing thread
+
+void ecall_condition_variable_run()
+{
+    app.main_task();
+}
+
+//E-call used by condifion_variable demo - loader thread
+void ecall_condition_variable_load()
+{
+    app.load_data();
+}

+ 70 - 0
SampleCode/Cxx11SGXDemo/Enclave/TrustedLibrary/Libcxx.edl

@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2011-2017 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in
+ *     the documentation and/or other materials provided with the
+ *     distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+/* Libcxx.edl - EDL sample for trusted C++ library. */
+
+enclave {
+    
+    /* 
+     * A subset of the C++03 standard is supported.
+     */
+
+    trusted {
+       
+		public void ecall_lambdas_demo(void);
+		public void ecall_auto_demo(void);
+		public void ecall_decltype_demo(void);
+		public void ecall_strongly_typed_enum_demo(void);
+		public void ecall_range_based_for_loops_demo(void);
+		public void ecall_static_assert_demo(void);
+		public void ecall_virtual_function_control_demo(void);
+		public void ecall_delegating_constructors_demo(void);
+		public void ecall_std_function_demo(void);
+		public void ecall_cxx11_algorithms_demo(void);
+		public void ecall_variadic_templates_demo(void);
+		public void ecall_SFINAE_demo(void);
+		public void ecall_initializer_list_demo(void);
+		public void ecall_rvalue_demo(void);
+		public void ecall_nullptr_demo(void);
+                public void ecall_enum_class_demo(void);
+		public void ecall_new_container_classes_demo(void);
+		public void ecall_tuple_demo(void);
+		public void ecall_shared_ptr_demo(void);
+		public void ecall_atomic_demo(void);
+		public void ecall_mutex_demo(void);
+		public void ecall_print_final_value_mutex_demo(void);
+		public void ecall_mutex_demo_no_protection(void);
+		public void ecall_print_final_value_no_protection(void);
+		public void ecall_condition_variable_run(void);
+		public void ecall_condition_variable_load(void);
+		
+    };
+};

+ 252 - 0
SampleCode/Cxx11SGXDemo/Makefile

@@ -0,0 +1,252 @@
+#
+# Copyright (C) 2011-2017 Intel Corporation. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+#   * Redistributions of source code must retain the above copyright
+#     notice, this list of conditions and the following disclaimer.
+#   * Redistributions in binary form must reproduce the above copyright
+#     notice, this list of conditions and the following disclaimer in
+#     the documentation and/or other materials provided with the
+#     distribution.
+#   * Neither the name of Intel Corporation nor the names of its
+#     contributors may be used to endorse or promote products derived
+#     from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#
+
+######## SGX SDK Settings ########
+
+SGX_SDK ?= /opt/intel/sgxsdk
+SGX_MODE ?= HW
+SGX_ARCH ?= x64
+SGX_DEBUG ?= 1
+
+ifeq ($(shell getconf LONG_BIT), 32)
+	SGX_ARCH := x86
+else ifeq ($(findstring -m32, $(CXXFLAGS)), -m32)
+	SGX_ARCH := x86
+endif
+
+ifeq ($(SGX_ARCH), x86)
+	SGX_COMMON_CFLAGS := -m32
+	SGX_LIBRARY_PATH := $(SGX_SDK)/lib
+	SGX_ENCLAVE_SIGNER := $(SGX_SDK)/bin/x86/sgx_sign
+	SGX_EDGER8R := $(SGX_SDK)/bin/x86/sgx_edger8r
+else
+	SGX_COMMON_CFLAGS := -m64
+	SGX_LIBRARY_PATH := $(SGX_SDK)/lib64
+	SGX_ENCLAVE_SIGNER := $(SGX_SDK)/bin/x64/sgx_sign
+	SGX_EDGER8R := $(SGX_SDK)/bin/x64/sgx_edger8r
+endif
+
+ifeq ($(SGX_DEBUG), 1)
+ifeq ($(SGX_PRERELEASE), 1)
+$(error Cannot set SGX_DEBUG and SGX_PRERELEASE at the same time!!)
+endif
+endif
+
+ifeq ($(SGX_DEBUG), 1)
+        SGX_COMMON_CFLAGS += -O0 -g
+else
+        SGX_COMMON_CFLAGS += -O2
+endif
+
+######## App Settings ########
+
+ifneq ($(SGX_MODE), HW)
+	Urts_Library_Name := sgx_urts_sim
+else
+	Urts_Library_Name := sgx_urts
+endif
+
+App_Cpp_Files := App/App.cpp $(wildcard App/TrustedLibrary/*.cpp)
+App_Include_Paths := -IInclude -IApp -I$(SGX_SDK)/include
+
+App_C_Flags := $(SGX_COMMON_CFLAGS) -fPIC -Wno-attributes $(App_Include_Paths)
+
+# Three configuration modes - Debug, prerelease, release
+#   Debug - Macro DEBUG enabled.
+#   Prerelease - Macro NDEBUG and EDEBUG enabled.
+#   Release - Macro NDEBUG enabled.
+ifeq ($(SGX_DEBUG), 1)
+        App_C_Flags += -DDEBUG -UNDEBUG -UEDEBUG
+else ifeq ($(SGX_PRERELEASE), 1)
+        App_C_Flags += -DNDEBUG -DEDEBUG -UDEBUG
+else
+        App_C_Flags += -DNDEBUG -UEDEBUG -UDEBUG
+endif
+
+App_Cpp_Flags := $(App_C_Flags) -std=c++11
+App_Link_Flags := $(SGX_COMMON_CFLAGS) -L$(SGX_LIBRARY_PATH) -l$(Urts_Library_Name) -lpthread 
+
+ifneq ($(SGX_MODE), HW)
+	App_Link_Flags += -lsgx_uae_service_sim
+else
+	App_Link_Flags += -lsgx_uae_service
+endif
+
+App_Cpp_Objects := $(App_Cpp_Files:.cpp=.o)
+
+App_Name := app
+
+######## Enclave Settings ########
+
+Enclave_Version_Script := Enclave/Enclave_debug.lds
+ifeq ($(SGX_MODE), HW)
+ifneq ($(SGX_DEBUG), 1)
+ifneq ($(SGX_PRERELEASE), 1)
+	# Choose to use 'Enclave.lds' for HW release mode
+	Enclave_Version_Script = Enclave/Enclave.lds 
+endif
+endif
+endif
+
+ifneq ($(SGX_MODE), HW)
+	Trts_Library_Name := sgx_trts_sim
+	Service_Library_Name := sgx_tservice_sim
+else
+	Trts_Library_Name := sgx_trts
+	Service_Library_Name := sgx_tservice
+endif
+Crypto_Library_Name := sgx_tcrypto
+
+Enclave_Cpp_Files := Enclave/Enclave.cpp $(wildcard Enclave/TrustedLibrary/*.cpp)
+Enclave_Include_Paths := -IInclude -IEnclave -I$(SGX_SDK)/include -I$(SGX_SDK)/include/libcxx -I$(SGX_SDK)/include/tlibc 
+
+Enclave_C_Flags := $(SGX_COMMON_CFLAGS) -nostdinc -fvisibility=hidden -fpie -fstack-protector $(Enclave_Include_Paths)
+Enclave_Cpp_Flags := $(Enclave_C_Flags) -nostdinc++ -std=c++11
+
+# To generate a proper enclave, it is recommended to follow below guideline to link the trusted libraries:
+#    1. Link sgx_trts with the `--whole-archive' and `--no-whole-archive' options,
+#       so that the whole content of trts is included in the enclave.
+#    2. For other libraries, you just need to pull the required symbols.
+#       Use `--start-group' and `--end-group' to link these libraries.
+# Do NOT move the libraries linked with `--start-group' and `--end-group' within `--whole-archive' and `--no-whole-archive' options.
+# Otherwise, you may get some undesirable errors.
+Enclave_Link_Flags := $(SGX_COMMON_CFLAGS) -Wl,--no-undefined -nostdlib -nodefaultlibs -nostartfiles -L$(SGX_LIBRARY_PATH) \
+	-Wl,--whole-archive -l$(Trts_Library_Name) -Wl,--no-whole-archive \
+	-Wl,--start-group -lsgx_tstdc -lsgx_tcxx -l$(Crypto_Library_Name) -l$(Service_Library_Name) -Wl,--end-group \
+	-Wl,-Bstatic -Wl,-Bsymbolic -Wl,--no-undefined \
+	-Wl,-pie,-eenclave_entry -Wl,--export-dynamic  \
+	-Wl,--defsym,__ImageBase=0 \
+	-Wl,--version-script=$(Enclave_Version_Script)
+
+Enclave_Cpp_Objects := $(Enclave_Cpp_Files:.cpp=.o)
+
+Enclave_Name := enclave.so
+Signed_Enclave_Name := enclave.signed.so
+Enclave_Config_File := Enclave/Enclave.config.xml
+
+ifeq ($(SGX_MODE), HW)
+ifeq ($(SGX_DEBUG), 1)
+	Build_Mode = HW_DEBUG
+else ifeq ($(SGX_PRERELEASE), 1)
+	Build_Mode = HW_PRERELEASE
+else
+	Build_Mode = HW_RELEASE
+endif
+else
+ifeq ($(SGX_DEBUG), 1)
+	Build_Mode = SIM_DEBUG
+else ifeq ($(SGX_PRERELEASE), 1)
+	Build_Mode = SIM_PRERELEASE
+else
+	Build_Mode = SIM_RELEASE
+endif
+endif
+
+
+.PHONY: all run
+
+ifeq ($(Build_Mode), HW_RELEASE)
+all: .config_$(Build_Mode)_$(SGX_ARCH) $(App_Name) $(Enclave_Name)
+	@echo "The project has been built in release hardware mode."
+	@echo "Please sign the $(Enclave_Name) first with your signing key before you run the $(App_Name) to launch and access the enclave."
+	@echo "To sign the enclave use the command:"
+	@echo "   $(SGX_ENCLAVE_SIGNER) sign -key <your key> -enclave $(Enclave_Name) -out <$(Signed_Enclave_Name)> -config $(Enclave_Config_File)"
+	@echo "You can also sign the enclave using an external signing tool."
+	@echo "To build the project in simulation mode set SGX_MODE=SIM. To build the project in prerelease mode set SGX_PRERELEASE=1 and SGX_MODE=HW."
+else
+all: .config_$(Build_Mode)_$(SGX_ARCH) $(App_Name) $(Signed_Enclave_Name)
+ifeq ($(Build_Mode), HW_DEBUG)
+	@echo "The project has been built in debug hardware mode."
+else ifeq ($(Build_Mode), SIM_DEBUG)
+	@echo "The project has been built in debug simulation mode."
+else ifeq ($(Build_Mode), HW_PRERELEASE)
+	@echo "The project has been built in pre-release hardware mode."
+else ifeq ($(Build_Mode), SIM_PRERELEASE)
+	@echo "The project has been built in pre-release simulation mode."
+else
+	@echo "The project has been built in release simulation mode."
+endif
+endif
+
+run: all
+ifneq ($(Build_Mode), HW_RELEASE)
+	@$(CURDIR)/$(App_Name)
+	@echo "RUN  =>  $(App_Name) [$(SGX_MODE)|$(SGX_ARCH), OK]"
+endif
+
+######## App Objects ########
+
+App/Enclave_u.c: $(SGX_EDGER8R) Enclave/Enclave.edl
+	@cd App && $(SGX_EDGER8R) --untrusted ../Enclave/Enclave.edl --search-path ../Enclave --search-path $(SGX_SDK)/include
+	@echo "GEN  =>  $@"
+
+App/Enclave_u.o: App/Enclave_u.c
+	@$(CC) $(App_C_Flags) -c $< -o $@
+	@echo "CC   <=  $<"
+
+App/%.o: App/%.cpp
+	@$(CXX) $(App_Cpp_Flags) -c $< -o $@
+	@echo "CXX  <=  $<"
+
+$(App_Name): App/Enclave_u.o $(App_Cpp_Objects)
+	@$(CXX) $^ -o $@ $(App_Link_Flags)
+	@echo "LINK =>  $@"
+
+.config_$(Build_Mode)_$(SGX_ARCH):
+	@rm -f .config_* $(App_Name) $(Enclave_Name) $(Signed_Enclave_Name) $(App_Cpp_Objects) App/Enclave_u.* $(Enclave_Cpp_Objects) Enclave/Enclave_t.*
+	@touch .config_$(Build_Mode)_$(SGX_ARCH)
+
+######## Enclave Objects ########
+
+Enclave/Enclave_t.c: $(SGX_EDGER8R) Enclave/Enclave.edl
+	@cd Enclave && $(SGX_EDGER8R) --trusted ../Enclave/Enclave.edl --search-path ../Enclave --search-path $(SGX_SDK)/include
+	@echo "GEN  =>  $@"
+
+Enclave/Enclave_t.o: Enclave/Enclave_t.c
+	@$(CC) $(Enclave_C_Flags) -c $< -o $@
+	@echo "CC   <=  $<"
+
+Enclave/%.o: Enclave/%.cpp
+	@$(CXX) $(Enclave_Cpp_Flags) -c $< -o $@
+	@echo "CXX  <=  $<"
+
+$(Enclave_Name): Enclave/Enclave_t.o $(Enclave_Cpp_Objects)
+	@$(CXX) $^ -o $@ $(Enclave_Link_Flags)
+	@echo "LINK =>  $@"
+
+$(Signed_Enclave_Name): $(Enclave_Name)
+	@$(SGX_ENCLAVE_SIGNER) sign -key Enclave/Enclave_private.pem -enclave $(Enclave_Name) -out $@ -config $(Enclave_Config_File)
+	@echo "SIGN =>  $@"
+
+.PHONY: clean
+
+clean:
+	@rm -f .config_* $(App_Name) $(Enclave_Name) $(Signed_Enclave_Name) $(App_Cpp_Objects) App/Enclave_u.* $(Enclave_Cpp_Objects) Enclave/Enclave_t.*

+ 44 - 0
SampleCode/Cxx11SGXDemo/README.txt

@@ -0,0 +1,44 @@
+-----------------------
+Purpose of Cxx11SGXDemo
+-----------------------
+
+The project demonstrates serveral C++11 features inside the Enclave:
+- lambda expressions;
+- rvalue references and move semantics;
+- automatic type deduction with auto and decltype;
+- nullptr type;
+- strongly typed enum classes;
+- Range-based for statements;
+- static_assert keyword for compile-time assertion;
+- initializer lists and uniform initialization syntax;
+- New virtual function controls: override, final, default, and delete;
+- delegating constructors;
+- new container classes (unordered_set, unordered_map, unordered_multiset, and unordered_multimap);
+- tuple class;
+- function object wrapper;
+- atomic, mutexes, condition_variables;
+- new smart pointer classes: shared_ptr, unique_ptr;
+- new c++ algorithms: all_off, any_of, none_of;
+- variadic templates;
+- SFINAE;
+
+---------------------------------------------
+How to Build/Execute the C++11 sample program
+---------------------------------------------
+1. Install Intel(R) Software Guard Extensions (Intel(R) SGX) SDK for Linux* OS
+2. Build the project with the prepared Makefile:
+    a. Hardware Mode, Debug build:
+        $ make
+    b. Hardware Mode, Pre-release build:
+        $ make SGX_PRERELEASE=1 SGX_DEBUG=0
+    c. Hardware Mode, Release build:
+        $ make SGX_DEBUG=0
+    d. Simulation Mode, Debug build:
+        $ make SGX_MODE=SIM
+    e. Simulation Mode, Pre-release build:
+        $ make SGX_MODE=SIM SGX_PRERELEASE=1 SGX_DEBUG=0
+    f. Simulation Mode, Release build:
+        $ make SGX_MODE=SIM SGX_DEBUG=0
+3. Execute the binary directly:
+    $ ./app
+4. Remember to "make clean" before switching build mode

+ 67 - 70
SampleCode/LocalAttestation/.cproject

@@ -2,7 +2,7 @@
 <?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
 	<storageModule moduleId="org.eclipse.cdt.core.settings">
 		<cconfiguration id="com.intel.sgx.configuration.Sim.Debug">
-			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.Sim.Debug" moduleId="org.eclipse.cdt.core.settings" name="SGX Debug Sim Mode">
+			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.Sim.Debug" moduleId="org.eclipse.cdt.core.settings" name="Intel(R) SGX Simulation Debug">
 				<externalSettings/>
 				<extensions>
 					<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
@@ -17,16 +17,16 @@
 				</extensions>
 			</storageModule>
 			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
-				<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.Sim.Debug" name="SGX Debug Sim Mode" parent="com.intel.sgx.configuration.Sim.Debug">
-					<folderInfo id="com.intel.sgx.configuration.Sim.Debug.292452237" name="/" resourcePath="">
-						<toolChain id="com.intel.sgx.toolChain.Sim.Debug.1618485184" name="SGX GCC" superClass="com.intel.sgx.toolChain.Sim.Debug">
-							<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.1039454044" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
-							<builder arguments="SGX_DEBUG=1 SGX_MODE=SIM -f Makefile" command="make" id="com.intel.sgx.builder2.1591862020" keepEnvironmentInBuildfile="false" name="Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder2"/>
-							<tool id="com.intel.sgx.compiler.1853780321" name="SGX GCC Compiler" superClass="com.intel.sgx.compiler">
-								<option id="com.intel.sgx.option.includePath.1427419865" superClass="com.intel.sgx.option.includePath" valueType="includePath">
-									<listOptionValue builtIn="false" value="/opt/intel/sgxsdk/include"/>
+				<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.Sim.Debug" name="Intel(R) SGX Simulation Debug" parent="com.intel.sgx.configuration.Sim.Debug">
+					<folderInfo id="com.intel.sgx.configuration.Sim.Debug.935873960" name="/" resourcePath="">
+						<toolChain id="com.intel.sgx.toolChain.Sim.Debug.2132595457" name="Intel(R) SGX" superClass="com.intel.sgx.toolChain.Sim.Debug">
+							<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.1678491512" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
+							<builder arguments="SGX_DEBUG=1 SGX_MODE=SIM -f Makefile" command="make" id="com.intel.sgx.builder2.229166714" keepEnvironmentInBuildfile="false" name="Intel(R) Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder2"/>
+							<tool id="com.intel.sgx.compiler.81269967" name="Intel(R) SGX" superClass="com.intel.sgx.compiler">
+								<option id="com.intel.sgx.option.includePath.1694375039" superClass="com.intel.sgx.option.includePath" valueType="includePath">
+									<listOptionValue builtIn="false" value="&quot;${SGX_SDK}/include&quot;"/>
 								</option>
-								<inputType id="com.intel.sgx.inputType.1817588305" superClass="com.intel.sgx.inputType"/>
+								<inputType id="com.intel.sgx.inputType.742388855" superClass="com.intel.sgx.inputType"/>
 							</tool>
 						</toolChain>
 					</folderInfo>
@@ -34,8 +34,8 @@
 			</storageModule>
 			<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
 		</cconfiguration>
-		<cconfiguration id="com.intel.sgx.configuration.HW.Debug">
-			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.HW.Debug" moduleId="org.eclipse.cdt.core.settings" name="SGX Debug HW Mode">
+		<cconfiguration id="com.intel.sgx.configuration.Sim.Release">
+			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.Sim.Release" moduleId="org.eclipse.cdt.core.settings" name="Intel(R) SGX Simulation">
 				<externalSettings/>
 				<extensions>
 					<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
@@ -50,16 +50,16 @@
 				</extensions>
 			</storageModule>
 			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
-				<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.HW.Debug" name="SGX Debug HW Mode" parent="com.intel.sgx.configuration.HW.Debug">
-					<folderInfo id="com.intel.sgx.configuration.HW.Debug.971320034" name="/" resourcePath="">
-						<toolChain id="com.intel.sgx.toolChain.HW.Debug.1761600540" name="SGX GCC" superClass="com.intel.sgx.toolChain.HW.Debug">
-							<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.131147161" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
-							<builder arguments="SGX_DEBUG=1 SGX_MODE=HW -f Makefile" command="make" id="com.intel.sgx.builder1.1502087524" keepEnvironmentInBuildfile="false" name="Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder1"/>
-							<tool id="com.intel.sgx.compiler.1085280084" name="SGX GCC Compiler" superClass="com.intel.sgx.compiler">
-								<option id="com.intel.sgx.option.includePath.57165741" superClass="com.intel.sgx.option.includePath" valueType="includePath">
-									<listOptionValue builtIn="false" value="/opt/intel/sgxsdk/include"/>
+				<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.Sim.Release" name="Intel(R) SGX Simulation" parent="com.intel.sgx.configuration.Sim.Release">
+					<folderInfo id="com.intel.sgx.configuration.Sim.Release.428839196" name="/" resourcePath="">
+						<toolChain id="com.intel.sgx.toolChain.Sim.Release.709775329" name="Intel(R) SGX" superClass="com.intel.sgx.toolChain.Sim.Release">
+							<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.1866379479" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
+							<builder arguments="SGX_DEBUG=0 SGX_MODE=SIM -f Makefile" command="make" id="com.intel.sgx.builder3.1000705250" keepEnvironmentInBuildfile="false" name="Intel(R) Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder3"/>
+							<tool id="com.intel.sgx.compiler.301453474" name="Intel(R) SGX" superClass="com.intel.sgx.compiler">
+								<option id="com.intel.sgx.option.includePath.1312096753" superClass="com.intel.sgx.option.includePath" valueType="includePath">
+									<listOptionValue builtIn="false" value="&quot;${SGX_SDK}/include&quot;"/>
 								</option>
-								<inputType id="com.intel.sgx.inputType.79844751" superClass="com.intel.sgx.inputType"/>
+								<inputType id="com.intel.sgx.inputType.596141238" superClass="com.intel.sgx.inputType"/>
 							</tool>
 						</toolChain>
 					</folderInfo>
@@ -67,8 +67,8 @@
 			</storageModule>
 			<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
 		</cconfiguration>
-		<cconfiguration id="com.intel.sgx.configuration.Sim.Release">
-			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.Sim.Release" moduleId="org.eclipse.cdt.core.settings" name="SGX Release Sim Mode">
+		<cconfiguration id="com.intel.sgx.configuration.HW.Debug">
+			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.HW.Debug" moduleId="org.eclipse.cdt.core.settings" name="Intel(R) SGX Hardware Debug">
 				<externalSettings/>
 				<extensions>
 					<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
@@ -83,16 +83,16 @@
 				</extensions>
 			</storageModule>
 			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
-				<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.Sim.Release" name="SGX Release Sim Mode" parent="com.intel.sgx.configuration.Sim.Release">
-					<folderInfo id="com.intel.sgx.configuration.Sim.Release.151408355" name="/" resourcePath="">
-						<toolChain id="com.intel.sgx.toolChain.Sim.Release.1055083183" name="SGX GCC" superClass="com.intel.sgx.toolChain.Sim.Release">
-							<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.471419902" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
-							<builder arguments="SGX_DEBUG=0 SGX_MODE=SIM -f Makefile" command="make" id="com.intel.sgx.builder3.1151273037" keepEnvironmentInBuildfile="false" name="Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder3"/>
-							<tool id="com.intel.sgx.compiler.1302347316" name="SGX GCC Compiler" superClass="com.intel.sgx.compiler">
-								<option id="com.intel.sgx.option.includePath.1645761127" superClass="com.intel.sgx.option.includePath" valueType="includePath">
-									<listOptionValue builtIn="false" value="/opt/intel/sgxsdk/include"/>
+				<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.HW.Debug" name="Intel(R) SGX Hardware Debug" parent="com.intel.sgx.configuration.HW.Debug">
+					<folderInfo id="com.intel.sgx.configuration.HW.Debug.562917509" name="/" resourcePath="">
+						<toolChain id="com.intel.sgx.toolChain.HW.Debug.2046051538" name="Intel(R) SGX" superClass="com.intel.sgx.toolChain.HW.Debug">
+							<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.999277922" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
+							<builder arguments="SGX_DEBUG=1 SGX_MODE=HW -f Makefile" command="make" id="com.intel.sgx.builder1.577701014" keepEnvironmentInBuildfile="false" name="Intel(R) Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder1"/>
+							<tool id="com.intel.sgx.compiler.1898704176" name="Intel(R) SGX" superClass="com.intel.sgx.compiler">
+								<option id="com.intel.sgx.option.includePath.1026657138" superClass="com.intel.sgx.option.includePath" valueType="includePath">
+									<listOptionValue builtIn="false" value="&quot;${SGX_SDK}/include&quot;"/>
 								</option>
-								<inputType id="com.intel.sgx.inputType.640775034" superClass="com.intel.sgx.inputType"/>
+								<inputType id="com.intel.sgx.inputType.393162412" superClass="com.intel.sgx.inputType"/>
 							</tool>
 						</toolChain>
 					</folderInfo>
@@ -101,7 +101,7 @@
 			<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
 		</cconfiguration>
 		<cconfiguration id="com.intel.sgx.configuration.HW.Prerelease">
-			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.HW.Prerelease" moduleId="org.eclipse.cdt.core.settings" name="SGX Pre-release Release HW Mode">
+			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.HW.Prerelease" moduleId="org.eclipse.cdt.core.settings" name="Intel(R) SGX Hardware Prerelease">
 				<externalSettings/>
 				<extensions>
 					<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
@@ -116,16 +116,16 @@
 				</extensions>
 			</storageModule>
 			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
-				<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.HW.Prerelease" name="SGX Pre-release Release HW Mode" parent="com.intel.sgx.configuration.HW.Prerelease">
-					<folderInfo id="com.intel.sgx.configuration.HW.Prerelease.1418650208" name="/" resourcePath="">
-						<toolChain id="com.intel.sgx.toolChain.HW.Prerelease.1668578385" name="SGX GCC" superClass="com.intel.sgx.toolChain.HW.Prerelease">
-							<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.977258758" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
-							<builder arguments="SGX_PRERELEASE=1 SGX_MODE=HW -f Makefile" command="make" id="com.intel.sgx.builder5.1888300852" keepEnvironmentInBuildfile="false" name="Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder5"/>
-							<tool id="com.intel.sgx.compiler.2113538546" name="SGX GCC Compiler" superClass="com.intel.sgx.compiler">
-								<option id="com.intel.sgx.option.includePath.904888562" superClass="com.intel.sgx.option.includePath" valueType="includePath">
-									<listOptionValue builtIn="false" value="/opt/intel/sgxsdk/include"/>
+				<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.HW.Prerelease" name="Intel(R) SGX Hardware Prerelease" parent="com.intel.sgx.configuration.HW.Prerelease">
+					<folderInfo id="com.intel.sgx.configuration.HW.Prerelease.2074448686" name="/" resourcePath="">
+						<toolChain id="com.intel.sgx.toolChain.HW.Prerelease.2016152654" name="Intel(R) SGX" superClass="com.intel.sgx.toolChain.HW.Prerelease">
+							<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.1520324017" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
+							<builder arguments="SGX_PRERELEASE=1 SGX_MODE=HW -f Makefile" command="make" id="com.intel.sgx.builder5.293910513" keepEnvironmentInBuildfile="false" name="Intel(R) Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder5"/>
+							<tool id="com.intel.sgx.compiler.845441552" name="Intel(R) SGX" superClass="com.intel.sgx.compiler">
+								<option id="com.intel.sgx.option.includePath.199398937" superClass="com.intel.sgx.option.includePath" valueType="includePath">
+									<listOptionValue builtIn="false" value="&quot;${SGX_SDK}/include&quot;"/>
 								</option>
-								<inputType id="com.intel.sgx.inputType.283498732" superClass="com.intel.sgx.inputType"/>
+								<inputType id="com.intel.sgx.inputType.1555926498" superClass="com.intel.sgx.inputType"/>
 							</tool>
 						</toolChain>
 					</folderInfo>
@@ -134,7 +134,7 @@
 			<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
 		</cconfiguration>
 		<cconfiguration id="com.intel.sgx.configuration.HW.Release">
-			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.HW.Release" moduleId="org.eclipse.cdt.core.settings" name="SGX Release HW Mode">
+			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.HW.Release" moduleId="org.eclipse.cdt.core.settings" name="Intel(R) SGX Hardware Release">
 				<externalSettings/>
 				<extensions>
 					<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
@@ -149,16 +149,16 @@
 				</extensions>
 			</storageModule>
 			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
-				<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.HW.Release" name="SGX Release HW Mode" parent="com.intel.sgx.configuration.HW.Release">
-					<folderInfo id="com.intel.sgx.configuration.HW.Release.1657582763" name="/" resourcePath="">
-						<toolChain id="com.intel.sgx.toolChain.HW.Release.465410401" name="SGX GCC" superClass="com.intel.sgx.toolChain.HW.Release">
-							<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.828352216" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
-							<builder arguments="SGX_DEBUG=0 SGX_MODE=HW -f Makefile" command="make" id="com.intel.sgx.builder6.714105790" keepEnvironmentInBuildfile="false" name="Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder6"/>
-							<tool id="com.intel.sgx.compiler.595797282" name="SGX GCC Compiler" superClass="com.intel.sgx.compiler">
-								<option id="com.intel.sgx.option.includePath.1385078253" superClass="com.intel.sgx.option.includePath" valueType="includePath">
-									<listOptionValue builtIn="false" value="/opt/intel/sgxsdk/include"/>
+				<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.HW.Release" name="Intel(R) SGX Hardware Release" parent="com.intel.sgx.configuration.HW.Release">
+					<folderInfo id="com.intel.sgx.configuration.HW.Release.1347223665" name="/" resourcePath="">
+						<toolChain id="com.intel.sgx.toolChain.HW.Release.1050674831" name="Intel(R) SGX" superClass="com.intel.sgx.toolChain.HW.Release">
+							<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.987781695" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
+							<builder arguments="SGX_DEBUG=0 SGX_MODE=HW -f Makefile" command="make" id="com.intel.sgx.builder6.484951388" keepEnvironmentInBuildfile="false" name="Intel(R) Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder6"/>
+							<tool id="com.intel.sgx.compiler.945246695" name="Intel(R) SGX" superClass="com.intel.sgx.compiler">
+								<option id="com.intel.sgx.option.includePath.119487102" superClass="com.intel.sgx.option.includePath" valueType="includePath">
+									<listOptionValue builtIn="false" value="&quot;${SGX_SDK}/include&quot;"/>
 								</option>
-								<inputType id="com.intel.sgx.inputType.463677873" superClass="com.intel.sgx.inputType"/>
+								<inputType id="com.intel.sgx.inputType.593431891" superClass="com.intel.sgx.inputType"/>
 							</tool>
 						</toolChain>
 					</folderInfo>
@@ -168,50 +168,47 @@
 		</cconfiguration>
 	</storageModule>
 	<storageModule moduleId="cdtBuildSystem" version="4.0.0">
-		<project id="LocalAttestation.null.1312290154" name="LocalAttestation"/>
+		<project id="LocalAttestation.cdt.managedbuild.target.gnu.exe.872917958" name="Executable" projectType="cdt.managedbuild.target.gnu.exe"/>
 	</storageModule>
 	<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
 	<storageModule moduleId="refreshScope" versionNumber="2">
-		<configuration configurationName="SGX Debug HW Mode">
+		<configuration configurationName="Intel(R) SGX Hardware Debug">
 			<resource resourceType="PROJECT" workspacePath="/LocalAttestation"/>
 		</configuration>
-		<configuration configurationName="SGX Debug Sim Mode">
+		<configuration configurationName="Intel(R) SGX Simulation Debug">
 			<resource resourceType="PROJECT" workspacePath="/LocalAttestation"/>
 		</configuration>
-		<configuration configurationName="Debug">
+		<configuration configurationName="Intel(R) SGX Hardware Prerelease">
 			<resource resourceType="PROJECT" workspacePath="/LocalAttestation"/>
 		</configuration>
-		<configuration configurationName="Release">
+		<configuration configurationName="Intel(R) SGX Simulation">
 			<resource resourceType="PROJECT" workspacePath="/LocalAttestation"/>
 		</configuration>
-		<configuration configurationName="SGX Release HW Mode">
+		<configuration configurationName="Intel(R) SGX Hardware Release">
 			<resource resourceType="PROJECT" workspacePath="/LocalAttestation"/>
 		</configuration>
 	</storageModule>
 	<storageModule moduleId="scannerConfiguration">
 		<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
-		<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.release.680828348;cdt.managedbuild.config.gnu.exe.release.680828348.;cdt.managedbuild.tool.gnu.c.compiler.exe.release.2137539087;cdt.managedbuild.tool.gnu.c.compiler.input.762444756">
-			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+		<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.HW.Release;com.intel.sgx.configuration.HW.Release.1347223665;com.intel.sgx.compiler.945246695;com.intel.sgx.inputType.593431891">
+			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.intel.sgx.SGXPerProjectProfile"/>
 		</scannerConfigBuildInfo>
-		<scannerConfigBuildInfo instanceId="com.intel.sgx.SGXtoolChain.977521771;com.intel.sgx.SGXtoolChain.977521771.100429378;com.intel.sgx.compiler.787445976;com.intel.sgx.inputType.1814458059">
+		<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.Sim.Debug;com.intel.sgx.configuration.Sim.Debug.935873960;com.intel.sgx.compiler.81269967;com.intel.sgx.inputType.742388855">
 			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.intel.sgx.SGXPerProjectProfile"/>
 		</scannerConfigBuildInfo>
-		<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.Sim.Release;com.intel.sgx.configuration.Sim.Release.151408355;com.intel.sgx.compiler.1302347316;com.intel.sgx.inputType.640775034">
+		<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.Sim.Release;com.intel.sgx.configuration.Sim.Release.428839196;com.intel.sgx.compiler.301453474;com.intel.sgx.inputType.596141238">
 			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.intel.sgx.SGXPerProjectProfile"/>
 		</scannerConfigBuildInfo>
-		<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.debug.1377487595;cdt.managedbuild.config.gnu.exe.debug.1377487595.;cdt.managedbuild.tool.gnu.c.compiler.exe.debug.1972419354;cdt.managedbuild.tool.gnu.c.compiler.input.1480710981">
+		<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.debug.1609650460;cdt.managedbuild.config.gnu.exe.debug.1609650460.;cdt.managedbuild.tool.gnu.c.compiler.exe.debug.1644119147;cdt.managedbuild.tool.gnu.c.compiler.input.938348551">
 			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
 		</scannerConfigBuildInfo>
-		<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.HW.Release;com.intel.sgx.configuration.HW.Release.1657582763;com.intel.sgx.compiler.595797282;com.intel.sgx.inputType.463677873">
-			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.intel.sgx.SGXPerProjectProfile"/>
-		</scannerConfigBuildInfo>
-		<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.Sim.Debug;com.intel.sgx.configuration.Sim.Debug.292452237;com.intel.sgx.compiler.1853780321;com.intel.sgx.inputType.1817588305">
-			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.intel.sgx.SGXPerProjectProfile"/>
+		<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.release.1394873887;cdt.managedbuild.config.gnu.exe.release.1394873887.;cdt.managedbuild.tool.gnu.c.compiler.exe.release.2035356548;cdt.managedbuild.tool.gnu.c.compiler.input.793813290">
+			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
 		</scannerConfigBuildInfo>
-		<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.HW.Debug;com.intel.sgx.configuration.HW.Debug.971320034;com.intel.sgx.compiler.1085280084;com.intel.sgx.inputType.79844751">
+		<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.HW.Debug;com.intel.sgx.configuration.HW.Debug.562917509;com.intel.sgx.compiler.1898704176;com.intel.sgx.inputType.393162412">
 			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.intel.sgx.SGXPerProjectProfile"/>
 		</scannerConfigBuildInfo>
-		<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.HW.Prerelease;com.intel.sgx.configuration.HW.Prerelease.1418650208;com.intel.sgx.compiler.2113538546;com.intel.sgx.inputType.283498732">
+		<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.HW.Prerelease;com.intel.sgx.configuration.HW.Prerelease.2074448686;com.intel.sgx.compiler.845441552;com.intel.sgx.inputType.1555926498">
 			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.intel.sgx.SGXPerProjectProfile"/>
 		</scannerConfigBuildInfo>
 	</storageModule>

+ 73 - 0
SampleCode/LocalAttestation/.settings/language.settings.xml

@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<project>
+	<configuration id="com.intel.sgx.configuration.Sim.Debug" name="Intel(R) SGX Simulation Debug">
+		<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
+			<provider class="org.eclipse.cdt.core.language.settings.providers.LanguageSettingsGenericProvider" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider" name="CDT User Setting Entries" prefer-non-shared="true" store-entries-with-project="true">
+				<resource project-relative-path="">
+					<entry kind="includePath" name="${SGX_SDK}/include">
+						<flag value="LOCAL"/>
+					</entry>
+				</resource>
+			</provider>
+			<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" ref="shared-provider"/>
+		</extension>
+	</configuration>
+	<configuration id="com.intel.sgx.configuration.Sim.Release" name="Intel(R) SGX Simulation">
+		<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
+			<provider class="org.eclipse.cdt.core.language.settings.providers.LanguageSettingsGenericProvider" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider" name="CDT User Setting Entries" prefer-non-shared="true" store-entries-with-project="true">
+				<resource project-relative-path="">
+					<entry kind="includePath" name="${SGX_SDK}/include">
+						<flag value="LOCAL"/>
+					</entry>
+				</resource>
+			</provider>
+			<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" ref="shared-provider"/>
+		</extension>
+	</configuration>
+	<configuration id="com.intel.sgx.configuration.HW.Debug" name="Intel(R) SGX Hardware Debug">
+		<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
+			<provider class="org.eclipse.cdt.core.language.settings.providers.LanguageSettingsGenericProvider" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider" name="CDT User Setting Entries" prefer-non-shared="true" store-entries-with-project="true">
+				<resource project-relative-path="">
+					<entry kind="includePath" name="${SGX_SDK}/include">
+						<flag value="LOCAL"/>
+					</entry>
+				</resource>
+			</provider>
+			<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" ref="shared-provider"/>
+		</extension>
+	</configuration>
+	<configuration id="com.intel.sgx.configuration.HW.Prerelease" name="Intel(R) SGX Hardware Prerelease">
+		<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
+			<provider class="org.eclipse.cdt.core.language.settings.providers.LanguageSettingsGenericProvider" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider" name="CDT User Setting Entries" prefer-non-shared="true" store-entries-with-project="true">
+				<resource project-relative-path="">
+					<entry kind="includePath" name="${SGX_SDK}/include">
+						<flag value="LOCAL"/>
+					</entry>
+				</resource>
+			</provider>
+			<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" ref="shared-provider"/>
+		</extension>
+	</configuration>
+	<configuration id="com.intel.sgx.configuration.HW.Release" name="Intel(R) SGX Hardware Release">
+		<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
+			<provider class="org.eclipse.cdt.core.language.settings.providers.LanguageSettingsGenericProvider" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider" name="CDT User Setting Entries" prefer-non-shared="true" store-entries-with-project="true">
+				<resource project-relative-path="">
+					<entry kind="includePath" name="${SGX_SDK}/include">
+						<flag value="LOCAL"/>
+					</entry>
+				</resource>
+			</provider>
+			<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" ref="shared-provider"/>
+		</extension>
+	</configuration>
+</project>

+ 16 - 9
SampleCode/LocalAttestation/Makefile

@@ -71,9 +71,9 @@ endif
 Trust_Lib_Name := libLocalAttestation_Trusted.a
 TrustLib_Cpp_Files := $(wildcard LocalAttestationCode/*.cpp)
 TrustLib_Cpp_Objects := $(TrustLib_Cpp_Files:.cpp=.o)
-TrustLib_Include_Paths := -I$(SGX_SDK)/include -I$(SGX_SDK)/include/tlibc -I$(SGX_SDK)/include/stlport -I$(SGX_SDK)/include/epid -I./Include
+TrustLib_Include_Paths := -I$(SGX_SDK)/include -I$(SGX_SDK)/include/tlibc -I$(SGX_SDK)/include/libcxx -I$(SGX_SDK)/include/epid -I./Include
 TrustLib_Compile_Flags := $(SGX_COMMON_CFLAGS) -nostdinc -fvisibility=hidden -fpie -fstack-protector  $(TrustLib_Include_Paths)
-TrustLib_Compile_Cxx_Flags :=  -std=c++03 -nostdinc++
+TrustLib_Compile_Cxx_Flags :=  -std=c++11 -nostdinc++
 
 UnTrustLib_Name := libLocalAttestation_unTrusted.a
 UnTrustLib_Cpp_Files := $(wildcard Untrusted_LocalAttestation/*.cpp)
@@ -134,9 +134,16 @@ Crypto_Library_Name := sgx_tcrypto
 Enclave_Cpp_Files_1 := $(wildcard Enclave1/*.cpp)
 Enclave_Cpp_Files_2 := $(wildcard Enclave2/*.cpp)
 Enclave_Cpp_Files_3 := $(wildcard Enclave3/*.cpp)
-Enclave_Include_Paths := -I$(SGX_SDK)/include -I$(SGX_SDK)/include/tlibc -I$(SGX_SDK)/include/stlport -I./LocalAttestationCode -I./Include
+Enclave_Include_Paths := -I$(SGX_SDK)/include -I$(SGX_SDK)/include/tlibc -I$(SGX_SDK)/include/libcxx -I./LocalAttestationCode -I./Include
 
-Enclave_Compile_Flags := $(SGX_COMMON_CFLAGS) -nostdinc -fvisibility=hidden -fpie -fstack-protector $(Enclave_Include_Paths)
+CC_BELOW_4_9 := $(shell expr "`$(CC) -dumpversion`" \< "4.9")
+ifeq ($(CC_BELOW_4_9), 1)
+	Enclave_Compile_Flags := $(SGX_COMMON_CFLAGS) -nostdinc -fvisibility=hidden -fpie -ffunction-sections -fdata-sections -fstack-protector
+else
+	Enclave_Compile_Flags := $(SGX_COMMON_CFLAGS) -nostdinc -fvisibility=hidden -fpie -ffunction-sections -fdata-sections -fstack-protector-strong
+endif
+
+Enclave_Compile_Flags += $(Enclave_Include_Paths)
 
 # To generate a proper enclave, it is recommended to follow below guideline to link the trusted libraries:
 #    1. Link sgx_trts with the `--whole-archive' and `--no-whole-archive' options,
@@ -147,10 +154,10 @@ Enclave_Compile_Flags := $(SGX_COMMON_CFLAGS) -nostdinc -fvisibility=hidden -fpi
 # Otherwise, you may get some undesirable errors.
 Common_Enclave_Link_Flags := $(SGX_COMMON_CFLAGS) -Wl,--no-undefined -nostdlib -nodefaultlibs -nostartfiles -L$(SGX_LIBRARY_PATH) \
 	-Wl,--whole-archive -l$(Trts_Library_Name) -Wl,--no-whole-archive \
-	-Wl,--start-group -lsgx_tstdc -lsgx_tstdcxx -l$(Crypto_Library_Name) -L. -lLocalAttestation_Trusted -l$(Service_Library_Name) -Wl,--end-group \
+	-Wl,--start-group -lsgx_tstdc -lsgx_tcxx -l$(Crypto_Library_Name) -L. -lLocalAttestation_Trusted -l$(Service_Library_Name) -Wl,--end-group \
 	-Wl,-Bstatic -Wl,-Bsymbolic -Wl,--no-undefined \
 	-Wl,-pie,-eenclave_entry -Wl,--export-dynamic  \
-	-Wl,--defsym,__ImageBase=0
+	-Wl,--defsym,__ImageBase=0 -Wl,--gc-sections
 Enclave1_Link_Flags := $(Common_Enclave_Link_Flags) -Wl,--version-script=$(Enclave1_Version_Script)
 Enclave2_Link_Flags := $(Common_Enclave_Link_Flags) -Wl,--version-script=$(Enclave2_Version_Script)
 Enclave3_Link_Flags := $(Common_Enclave_Link_Flags) -Wl,--version-script=$(Enclave3_Version_Script)
@@ -281,7 +288,7 @@ Enclave1/Enclave1_t.o: Enclave1/Enclave1_t.c
 	@echo "CC   <=  $<"
 
 Enclave1/%.o: Enclave1/%.cpp Enclave1/Enclave1_t.h
-	@$(CXX) -std=c++03 -nostdinc++ $(Enclave_Compile_Flags) -c $< -o $@
+	@$(CXX) -std=c++11 -nostdinc++ $(Enclave_Compile_Flags) -c $< -o $@
 	@echo "CXX  <=  $<"
 
 Enclave1.so: Enclave1/Enclave1_t.o $(Enclave_Cpp_Objects_1) $(Trust_Lib_Name)
@@ -301,7 +308,7 @@ Enclave2/Enclave2_t.o: Enclave2/Enclave2_t.c
 	@echo "CC   <=  $<"
 
 Enclave2/%.o: Enclave2/%.cpp
-	@$(CXX) -std=c++03 -nostdinc++ $(Enclave_Compile_Flags) -c $< -o $@
+	@$(CXX) -std=c++11 -nostdinc++ $(Enclave_Compile_Flags) -c $< -o $@
 	@echo "CXX  <=  $<"
 
 Enclave2.so: Enclave2/Enclave2_t.o $(Enclave_Cpp_Objects_2) $(Trust_Lib_Name)
@@ -321,7 +328,7 @@ Enclave3/Enclave3_t.o: Enclave3/Enclave3_t.c
 	@echo "CC   <=  $<"
 
 Enclave3/%.o: Enclave3/%.cpp
-	@$(CXX) -std=c++03 -nostdinc++ $(Enclave_Compile_Flags) -c $< -o $@
+	@$(CXX) -std=c++11 -nostdinc++ $(Enclave_Compile_Flags) -c $< -o $@
 	@echo "CXX  <=  $<"
 
 Enclave3.so: Enclave3/Enclave3_t.o $(Enclave_Cpp_Objects_3) $(Trust_Lib_Name)

+ 1 - 1
SampleCode/LocalAttestation/README.txt

@@ -8,7 +8,7 @@ The project demonstrates:
 ------------------------------------
 How to Build/Execute the Sample Code
 ------------------------------------
-1. Install Intel(R) SGX SDK for Linux* OS
+1. Install Intel(R) Software Guard Extensions (Intel(R) SGX) SDK for Linux* OS
 2. Build the project with the prepared Makefile:
     a. Hardware Mode, Debug build:
         $ make

+ 67 - 70
SampleCode/PowerTransition/.cproject

@@ -2,7 +2,7 @@
 <?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
 	<storageModule moduleId="org.eclipse.cdt.core.settings">
 		<cconfiguration id="com.intel.sgx.configuration.Sim.Debug">
-			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.Sim.Debug" moduleId="org.eclipse.cdt.core.settings" name="SGX Debug Sim Mode">
+			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.Sim.Debug" moduleId="org.eclipse.cdt.core.settings" name="Intel(R) SGX Simulation Debug">
 				<externalSettings/>
 				<extensions>
 					<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
@@ -17,16 +17,16 @@
 				</extensions>
 			</storageModule>
 			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
-				<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.Sim.Debug" name="SGX Debug Sim Mode" parent="com.intel.sgx.configuration.Sim.Debug">
-					<folderInfo id="com.intel.sgx.configuration.Sim.Debug.292452237" name="/" resourcePath="">
-						<toolChain id="com.intel.sgx.toolChain.Sim.Debug.1618485184" name="SGX GCC" superClass="com.intel.sgx.toolChain.Sim.Debug">
-							<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.1039454044" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
-							<builder arguments="SGX_DEBUG=1 SGX_MODE=SIM -f Makefile" command="make" id="com.intel.sgx.builder2.1591862020" keepEnvironmentInBuildfile="false" name="Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder2"/>
-							<tool id="com.intel.sgx.compiler.1853780321" name="SGX GCC Compiler" superClass="com.intel.sgx.compiler">
-								<option id="com.intel.sgx.option.includePath.1427419865" superClass="com.intel.sgx.option.includePath" valueType="includePath">
-									<listOptionValue builtIn="false" value="/opt/intel/sgxsdk/include"/>
+				<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.Sim.Debug" name="Intel(R) SGX Simulation Debug" parent="com.intel.sgx.configuration.Sim.Debug">
+					<folderInfo id="com.intel.sgx.configuration.Sim.Debug.935873960" name="/" resourcePath="">
+						<toolChain id="com.intel.sgx.toolChain.Sim.Debug.2132595457" name="Intel(R) SGX" superClass="com.intel.sgx.toolChain.Sim.Debug">
+							<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.1678491512" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
+							<builder arguments="SGX_DEBUG=1 SGX_MODE=SIM -f Makefile" command="make" id="com.intel.sgx.builder2.229166714" keepEnvironmentInBuildfile="false" name="Intel(R) Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder2"/>
+							<tool id="com.intel.sgx.compiler.81269967" name="Intel(R) SGX" superClass="com.intel.sgx.compiler">
+								<option id="com.intel.sgx.option.includePath.1694375039" superClass="com.intel.sgx.option.includePath" valueType="includePath">
+									<listOptionValue builtIn="false" value="&quot;${SGX_SDK}/include&quot;"/>
 								</option>
-								<inputType id="com.intel.sgx.inputType.1817588305" superClass="com.intel.sgx.inputType"/>
+								<inputType id="com.intel.sgx.inputType.742388855" superClass="com.intel.sgx.inputType"/>
 							</tool>
 						</toolChain>
 					</folderInfo>
@@ -34,8 +34,8 @@
 			</storageModule>
 			<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
 		</cconfiguration>
-		<cconfiguration id="com.intel.sgx.configuration.HW.Debug">
-			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.HW.Debug" moduleId="org.eclipse.cdt.core.settings" name="SGX Debug HW Mode">
+		<cconfiguration id="com.intel.sgx.configuration.Sim.Release">
+			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.Sim.Release" moduleId="org.eclipse.cdt.core.settings" name="Intel(R) SGX Simulation">
 				<externalSettings/>
 				<extensions>
 					<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
@@ -50,16 +50,16 @@
 				</extensions>
 			</storageModule>
 			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
-				<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.HW.Debug" name="SGX Debug HW Mode" parent="com.intel.sgx.configuration.HW.Debug">
-					<folderInfo id="com.intel.sgx.configuration.HW.Debug.971320034" name="/" resourcePath="">
-						<toolChain id="com.intel.sgx.toolChain.HW.Debug.1761600540" name="SGX GCC" superClass="com.intel.sgx.toolChain.HW.Debug">
-							<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.131147161" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
-							<builder arguments="SGX_DEBUG=1 SGX_MODE=HW -f Makefile" command="make" id="com.intel.sgx.builder1.1502087524" keepEnvironmentInBuildfile="false" name="Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder1"/>
-							<tool id="com.intel.sgx.compiler.1085280084" name="SGX GCC Compiler" superClass="com.intel.sgx.compiler">
-								<option id="com.intel.sgx.option.includePath.57165741" superClass="com.intel.sgx.option.includePath" valueType="includePath">
-									<listOptionValue builtIn="false" value="/opt/intel/sgxsdk/include"/>
+				<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.Sim.Release" name="Intel(R) SGX Simulation" parent="com.intel.sgx.configuration.Sim.Release">
+					<folderInfo id="com.intel.sgx.configuration.Sim.Release.428839196" name="/" resourcePath="">
+						<toolChain id="com.intel.sgx.toolChain.Sim.Release.709775329" name="Intel(R) SGX" superClass="com.intel.sgx.toolChain.Sim.Release">
+							<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.1866379479" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
+							<builder arguments="SGX_DEBUG=0 SGX_MODE=SIM -f Makefile" command="make" id="com.intel.sgx.builder3.1000705250" keepEnvironmentInBuildfile="false" name="Intel(R) Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder3"/>
+							<tool id="com.intel.sgx.compiler.301453474" name="Intel(R) SGX" superClass="com.intel.sgx.compiler">
+								<option id="com.intel.sgx.option.includePath.1312096753" superClass="com.intel.sgx.option.includePath" valueType="includePath">
+									<listOptionValue builtIn="false" value="&quot;${SGX_SDK}/include&quot;"/>
 								</option>
-								<inputType id="com.intel.sgx.inputType.79844751" superClass="com.intel.sgx.inputType"/>
+								<inputType id="com.intel.sgx.inputType.596141238" superClass="com.intel.sgx.inputType"/>
 							</tool>
 						</toolChain>
 					</folderInfo>
@@ -67,8 +67,8 @@
 			</storageModule>
 			<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
 		</cconfiguration>
-		<cconfiguration id="com.intel.sgx.configuration.Sim.Release">
-			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.Sim.Release" moduleId="org.eclipse.cdt.core.settings" name="SGX Release Sim Mode">
+		<cconfiguration id="com.intel.sgx.configuration.HW.Debug">
+			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.HW.Debug" moduleId="org.eclipse.cdt.core.settings" name="Intel(R) SGX Hardware Debug">
 				<externalSettings/>
 				<extensions>
 					<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
@@ -83,16 +83,16 @@
 				</extensions>
 			</storageModule>
 			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
-				<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.Sim.Release" name="SGX Release Sim Mode" parent="com.intel.sgx.configuration.Sim.Release">
-					<folderInfo id="com.intel.sgx.configuration.Sim.Release.151408355" name="/" resourcePath="">
-						<toolChain id="com.intel.sgx.toolChain.Sim.Release.1055083183" name="SGX GCC" superClass="com.intel.sgx.toolChain.Sim.Release">
-							<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.471419902" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
-							<builder arguments="SGX_DEBUG=0 SGX_MODE=SIM -f Makefile" command="make" id="com.intel.sgx.builder3.1151273037" keepEnvironmentInBuildfile="false" name="Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder3"/>
-							<tool id="com.intel.sgx.compiler.1302347316" name="SGX GCC Compiler" superClass="com.intel.sgx.compiler">
-								<option id="com.intel.sgx.option.includePath.1645761127" superClass="com.intel.sgx.option.includePath" valueType="includePath">
-									<listOptionValue builtIn="false" value="/opt/intel/sgxsdk/include"/>
+				<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.HW.Debug" name="Intel(R) SGX Hardware Debug" parent="com.intel.sgx.configuration.HW.Debug">
+					<folderInfo id="com.intel.sgx.configuration.HW.Debug.562917509" name="/" resourcePath="">
+						<toolChain id="com.intel.sgx.toolChain.HW.Debug.2046051538" name="Intel(R) SGX" superClass="com.intel.sgx.toolChain.HW.Debug">
+							<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.999277922" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
+							<builder arguments="SGX_DEBUG=1 SGX_MODE=HW -f Makefile" command="make" id="com.intel.sgx.builder1.577701014" keepEnvironmentInBuildfile="false" name="Intel(R) Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder1"/>
+							<tool id="com.intel.sgx.compiler.1898704176" name="Intel(R) SGX" superClass="com.intel.sgx.compiler">
+								<option id="com.intel.sgx.option.includePath.1026657138" superClass="com.intel.sgx.option.includePath" valueType="includePath">
+									<listOptionValue builtIn="false" value="&quot;${SGX_SDK}/include&quot;"/>
 								</option>
-								<inputType id="com.intel.sgx.inputType.640775034" superClass="com.intel.sgx.inputType"/>
+								<inputType id="com.intel.sgx.inputType.393162412" superClass="com.intel.sgx.inputType"/>
 							</tool>
 						</toolChain>
 					</folderInfo>
@@ -101,7 +101,7 @@
 			<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
 		</cconfiguration>
 		<cconfiguration id="com.intel.sgx.configuration.HW.Prerelease">
-			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.HW.Prerelease" moduleId="org.eclipse.cdt.core.settings" name="SGX Pre-release Release HW Mode">
+			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.HW.Prerelease" moduleId="org.eclipse.cdt.core.settings" name="Intel(R) SGX Hardware Prerelease">
 				<externalSettings/>
 				<extensions>
 					<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
@@ -116,16 +116,16 @@
 				</extensions>
 			</storageModule>
 			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
-				<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.HW.Prerelease" name="SGX Pre-release Release HW Mode" parent="com.intel.sgx.configuration.HW.Prerelease">
-					<folderInfo id="com.intel.sgx.configuration.HW.Prerelease.1418650208" name="/" resourcePath="">
-						<toolChain id="com.intel.sgx.toolChain.HW.Prerelease.1668578385" name="SGX GCC" superClass="com.intel.sgx.toolChain.HW.Prerelease">
-							<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.977258758" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
-							<builder arguments="SGX_PRERELEASE=1 SGX_MODE=HW -f Makefile" command="make" id="com.intel.sgx.builder5.1888300852" keepEnvironmentInBuildfile="false" name="Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder5"/>
-							<tool id="com.intel.sgx.compiler.2113538546" name="SGX GCC Compiler" superClass="com.intel.sgx.compiler">
-								<option id="com.intel.sgx.option.includePath.904888562" superClass="com.intel.sgx.option.includePath" valueType="includePath">
-									<listOptionValue builtIn="false" value="/opt/intel/sgxsdk/include"/>
+				<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.HW.Prerelease" name="Intel(R) SGX Hardware Prerelease" parent="com.intel.sgx.configuration.HW.Prerelease">
+					<folderInfo id="com.intel.sgx.configuration.HW.Prerelease.2074448686" name="/" resourcePath="">
+						<toolChain id="com.intel.sgx.toolChain.HW.Prerelease.2016152654" name="Intel(R) SGX" superClass="com.intel.sgx.toolChain.HW.Prerelease">
+							<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.1520324017" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
+							<builder arguments="SGX_PRERELEASE=1 SGX_MODE=HW -f Makefile" command="make" id="com.intel.sgx.builder5.293910513" keepEnvironmentInBuildfile="false" name="Intel(R) Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder5"/>
+							<tool id="com.intel.sgx.compiler.845441552" name="Intel(R) SGX" superClass="com.intel.sgx.compiler">
+								<option id="com.intel.sgx.option.includePath.199398937" superClass="com.intel.sgx.option.includePath" valueType="includePath">
+									<listOptionValue builtIn="false" value="&quot;${SGX_SDK}/include&quot;"/>
 								</option>
-								<inputType id="com.intel.sgx.inputType.283498732" superClass="com.intel.sgx.inputType"/>
+								<inputType id="com.intel.sgx.inputType.1555926498" superClass="com.intel.sgx.inputType"/>
 							</tool>
 						</toolChain>
 					</folderInfo>
@@ -134,7 +134,7 @@
 			<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
 		</cconfiguration>
 		<cconfiguration id="com.intel.sgx.configuration.HW.Release">
-			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.HW.Release" moduleId="org.eclipse.cdt.core.settings" name="SGX Release HW Mode">
+			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.HW.Release" moduleId="org.eclipse.cdt.core.settings" name="Intel(R) SGX Hardware Release">
 				<externalSettings/>
 				<extensions>
 					<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
@@ -149,16 +149,16 @@
 				</extensions>
 			</storageModule>
 			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
-				<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.HW.Release" name="SGX Release HW Mode" parent="com.intel.sgx.configuration.HW.Release">
-					<folderInfo id="com.intel.sgx.configuration.HW.Release.1657582763" name="/" resourcePath="">
-						<toolChain id="com.intel.sgx.toolChain.HW.Release.465410401" name="SGX GCC" superClass="com.intel.sgx.toolChain.HW.Release">
-							<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.828352216" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
-							<builder arguments="SGX_DEBUG=0 SGX_MODE=HW -f Makefile" command="make" id="com.intel.sgx.builder6.714105790" keepEnvironmentInBuildfile="false" name="Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder6"/>
-							<tool id="com.intel.sgx.compiler.595797282" name="SGX GCC Compiler" superClass="com.intel.sgx.compiler">
-								<option id="com.intel.sgx.option.includePath.1385078253" superClass="com.intel.sgx.option.includePath" valueType="includePath">
-									<listOptionValue builtIn="false" value="/opt/intel/sgxsdk/include"/>
+				<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.HW.Release" name="Intel(R) SGX Hardware Release" parent="com.intel.sgx.configuration.HW.Release">
+					<folderInfo id="com.intel.sgx.configuration.HW.Release.1347223665" name="/" resourcePath="">
+						<toolChain id="com.intel.sgx.toolChain.HW.Release.1050674831" name="Intel(R) SGX" superClass="com.intel.sgx.toolChain.HW.Release">
+							<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.987781695" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
+							<builder arguments="SGX_DEBUG=0 SGX_MODE=HW -f Makefile" command="make" id="com.intel.sgx.builder6.484951388" keepEnvironmentInBuildfile="false" name="Intel(R) Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder6"/>
+							<tool id="com.intel.sgx.compiler.945246695" name="Intel(R) SGX" superClass="com.intel.sgx.compiler">
+								<option id="com.intel.sgx.option.includePath.119487102" superClass="com.intel.sgx.option.includePath" valueType="includePath">
+									<listOptionValue builtIn="false" value="&quot;${SGX_SDK}/include&quot;"/>
 								</option>
-								<inputType id="com.intel.sgx.inputType.463677873" superClass="com.intel.sgx.inputType"/>
+								<inputType id="com.intel.sgx.inputType.593431891" superClass="com.intel.sgx.inputType"/>
 							</tool>
 						</toolChain>
 					</folderInfo>
@@ -168,50 +168,47 @@
 		</cconfiguration>
 	</storageModule>
 	<storageModule moduleId="cdtBuildSystem" version="4.0.0">
-		<project id="PowerTransition.null.1312290154" name="PowerTransition"/>
+		<project id="PowerTransition.cdt.managedbuild.target.gnu.exe.872917958" name="Executable" projectType="cdt.managedbuild.target.gnu.exe"/>
 	</storageModule>
 	<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
 	<storageModule moduleId="refreshScope" versionNumber="2">
-		<configuration configurationName="SGX Debug HW Mode">
+		<configuration configurationName="Intel(R) SGX Hardware Debug">
 			<resource resourceType="PROJECT" workspacePath="/PowerTransition"/>
 		</configuration>
-		<configuration configurationName="SGX Debug Sim Mode">
+		<configuration configurationName="Intel(R) SGX Simulation Debug">
 			<resource resourceType="PROJECT" workspacePath="/PowerTransition"/>
 		</configuration>
-		<configuration configurationName="Debug">
+		<configuration configurationName="Intel(R) SGX Hardware Prerelease">
 			<resource resourceType="PROJECT" workspacePath="/PowerTransition"/>
 		</configuration>
-		<configuration configurationName="Release">
+		<configuration configurationName="Intel(R) SGX Simulation">
 			<resource resourceType="PROJECT" workspacePath="/PowerTransition"/>
 		</configuration>
-		<configuration configurationName="SGX Release HW Mode">
+		<configuration configurationName="Intel(R) SGX Hardware Release">
 			<resource resourceType="PROJECT" workspacePath="/PowerTransition"/>
 		</configuration>
 	</storageModule>
 	<storageModule moduleId="scannerConfiguration">
 		<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
-		<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.release.680828348;cdt.managedbuild.config.gnu.exe.release.680828348.;cdt.managedbuild.tool.gnu.c.compiler.exe.release.2137539087;cdt.managedbuild.tool.gnu.c.compiler.input.762444756">
-			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+		<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.HW.Release;com.intel.sgx.configuration.HW.Release.1347223665;com.intel.sgx.compiler.945246695;com.intel.sgx.inputType.593431891">
+			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.intel.sgx.SGXPerProjectProfile"/>
 		</scannerConfigBuildInfo>
-		<scannerConfigBuildInfo instanceId="com.intel.sgx.SGXtoolChain.977521771;com.intel.sgx.SGXtoolChain.977521771.100429378;com.intel.sgx.compiler.787445976;com.intel.sgx.inputType.1814458059">
+		<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.Sim.Debug;com.intel.sgx.configuration.Sim.Debug.935873960;com.intel.sgx.compiler.81269967;com.intel.sgx.inputType.742388855">
 			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.intel.sgx.SGXPerProjectProfile"/>
 		</scannerConfigBuildInfo>
-		<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.Sim.Release;com.intel.sgx.configuration.Sim.Release.151408355;com.intel.sgx.compiler.1302347316;com.intel.sgx.inputType.640775034">
+		<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.Sim.Release;com.intel.sgx.configuration.Sim.Release.428839196;com.intel.sgx.compiler.301453474;com.intel.sgx.inputType.596141238">
 			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.intel.sgx.SGXPerProjectProfile"/>
 		</scannerConfigBuildInfo>
-		<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.debug.1377487595;cdt.managedbuild.config.gnu.exe.debug.1377487595.;cdt.managedbuild.tool.gnu.c.compiler.exe.debug.1972419354;cdt.managedbuild.tool.gnu.c.compiler.input.1480710981">
+		<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.debug.1609650460;cdt.managedbuild.config.gnu.exe.debug.1609650460.;cdt.managedbuild.tool.gnu.c.compiler.exe.debug.1644119147;cdt.managedbuild.tool.gnu.c.compiler.input.938348551">
 			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
 		</scannerConfigBuildInfo>
-		<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.HW.Release;com.intel.sgx.configuration.HW.Release.1657582763;com.intel.sgx.compiler.595797282;com.intel.sgx.inputType.463677873">
-			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.intel.sgx.SGXPerProjectProfile"/>
-		</scannerConfigBuildInfo>
-		<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.Sim.Debug;com.intel.sgx.configuration.Sim.Debug.292452237;com.intel.sgx.compiler.1853780321;com.intel.sgx.inputType.1817588305">
-			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.intel.sgx.SGXPerProjectProfile"/>
+		<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.release.1394873887;cdt.managedbuild.config.gnu.exe.release.1394873887.;cdt.managedbuild.tool.gnu.c.compiler.exe.release.2035356548;cdt.managedbuild.tool.gnu.c.compiler.input.793813290">
+			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
 		</scannerConfigBuildInfo>
-		<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.HW.Debug;com.intel.sgx.configuration.HW.Debug.971320034;com.intel.sgx.compiler.1085280084;com.intel.sgx.inputType.79844751">
+		<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.HW.Debug;com.intel.sgx.configuration.HW.Debug.562917509;com.intel.sgx.compiler.1898704176;com.intel.sgx.inputType.393162412">
 			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.intel.sgx.SGXPerProjectProfile"/>
 		</scannerConfigBuildInfo>
-		<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.HW.Prerelease;com.intel.sgx.configuration.HW.Prerelease.1418650208;com.intel.sgx.compiler.2113538546;com.intel.sgx.inputType.283498732">
+		<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.HW.Prerelease;com.intel.sgx.configuration.HW.Prerelease.2074448686;com.intel.sgx.compiler.845441552;com.intel.sgx.inputType.1555926498">
 			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.intel.sgx.SGXPerProjectProfile"/>
 		</scannerConfigBuildInfo>
 	</storageModule>

+ 73 - 0
SampleCode/PowerTransition/.settings/language.settings.xml

@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<project>
+	<configuration id="com.intel.sgx.configuration.Sim.Debug" name="Intel(R) SGX Simulation Debug">
+		<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
+			<provider class="org.eclipse.cdt.core.language.settings.providers.LanguageSettingsGenericProvider" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider" name="CDT User Setting Entries" prefer-non-shared="true" store-entries-with-project="true">
+				<resource project-relative-path="">
+					<entry kind="includePath" name="${SGX_SDK}/include">
+						<flag value="LOCAL"/>
+					</entry>
+				</resource>
+			</provider>
+			<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" ref="shared-provider"/>
+		</extension>
+	</configuration>
+	<configuration id="com.intel.sgx.configuration.Sim.Release" name="Intel(R) SGX Simulation">
+		<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
+			<provider class="org.eclipse.cdt.core.language.settings.providers.LanguageSettingsGenericProvider" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider" name="CDT User Setting Entries" prefer-non-shared="true" store-entries-with-project="true">
+				<resource project-relative-path="">
+					<entry kind="includePath" name="${SGX_SDK}/include">
+						<flag value="LOCAL"/>
+					</entry>
+				</resource>
+			</provider>
+			<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" ref="shared-provider"/>
+		</extension>
+	</configuration>
+	<configuration id="com.intel.sgx.configuration.HW.Debug" name="Intel(R) SGX Hardware Debug">
+		<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
+			<provider class="org.eclipse.cdt.core.language.settings.providers.LanguageSettingsGenericProvider" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider" name="CDT User Setting Entries" prefer-non-shared="true" store-entries-with-project="true">
+				<resource project-relative-path="">
+					<entry kind="includePath" name="${SGX_SDK}/include">
+						<flag value="LOCAL"/>
+					</entry>
+				</resource>
+			</provider>
+			<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" ref="shared-provider"/>
+		</extension>
+	</configuration>
+	<configuration id="com.intel.sgx.configuration.HW.Prerelease" name="Intel(R) SGX Hardware Prerelease">
+		<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
+			<provider class="org.eclipse.cdt.core.language.settings.providers.LanguageSettingsGenericProvider" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider" name="CDT User Setting Entries" prefer-non-shared="true" store-entries-with-project="true">
+				<resource project-relative-path="">
+					<entry kind="includePath" name="${SGX_SDK}/include">
+						<flag value="LOCAL"/>
+					</entry>
+				</resource>
+			</provider>
+			<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" ref="shared-provider"/>
+		</extension>
+	</configuration>
+	<configuration id="com.intel.sgx.configuration.HW.Release" name="Intel(R) SGX Hardware Release">
+		<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
+			<provider class="org.eclipse.cdt.core.language.settings.providers.LanguageSettingsGenericProvider" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider" name="CDT User Setting Entries" prefer-non-shared="true" store-entries-with-project="true">
+				<resource project-relative-path="">
+					<entry kind="includePath" name="${SGX_SDK}/include">
+						<flag value="LOCAL"/>
+					</entry>
+				</resource>
+			</provider>
+			<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" ref="shared-provider"/>
+		</extension>
+	</configuration>
+</project>

+ 11 - 6
SampleCode/PowerTransition/Makefile

@@ -120,11 +120,16 @@ Crypto_Library_Name := sgx_tcrypto
 
 Enclave_Cpp_Files := $(wildcard Enclave/*.cpp)
 
-Enclave_Include_Paths := -I$(SGX_SDK)/include -I$(SGX_SDK)/include/tlibc -I$(SGX_SDK)/include/stlport -I./Common
+Enclave_Include_Paths := -I$(SGX_SDK)/include -I$(SGX_SDK)/include/tlibc -I$(SGX_SDK)/include/libcxx -I./Common
 
-Enclave_Compile_CFlags := -nostdinc -ffreestanding -fvisibility=hidden -fpie \
-			 $(Enclave_Include_Paths)
-Enclave_Compile_CXXFlags := -nostdinc++ -std=c++03 $(Enclave_Compile_CFlags)
+CC_BELOW_4_9 := $(shell expr "`$(CC) -dumpversion`" \< "4.9")
+ifeq ($(CC_BELOW_4_9), 1)
+	Enclave_Compile_CFlags := -fstack-protector
+else
+	Enclave_Compile_CFlags := -fstack-protector-strong
+endif
+Enclave_Compile_CFlags += -nostdinc -ffreestanding -fvisibility=hidden -fpie -ffunction-sections -fdata-sections $(Enclave_Include_Paths)
+Enclave_Compile_CXXFlags := -nostdinc++ -std=c++11 $(Enclave_Compile_CFlags)
 
 # To generate a proper enclave, it is recommended to follow below guideline to link the trusted libraries:
 #    1. Link sgx_trts with the `--whole-archive' and `--no-whole-archive' options,
@@ -135,9 +140,9 @@ Enclave_Compile_CXXFlags := -nostdinc++ -std=c++03 $(Enclave_Compile_CFlags)
 # Otherwise, you may get some undesirable errors.
 Enclave_Link_Flags := -Wl,--no-undefined -nostdlib -nodefaultlibs -nostartfiles -L$(SGX_LIBRARY_PATH) \
 	-Wl,--whole-archive -l$(Trts_Library_Name) -Wl,--no-whole-archive \
-	-Wl,--start-group -lsgx_tstdc -lsgx_tstdcxx -l$(Crypto_Library_Name) -l$(Service_Library_Name) -Wl,--end-group \
+	-Wl,--start-group -lsgx_tstdc -lsgx_tcxx -l$(Crypto_Library_Name) -l$(Service_Library_Name) -Wl,--end-group \
 	-Wl,--version-script=Enclave/Enclave.lds -Wl,-Bstatic -Wl,-Bsymbolic -Wl,--no-undefined \
-        -Wl,-pie,-eenclave_entry -Wl,--export-dynamic -Wl,--defsym,__ImageBase=0
+	-Wl,-pie,-eenclave_entry -Wl,--export-dynamic -Wl,--defsym,__ImageBase=0 -Wl,--gc-sections
 
 Enclave_Cpp_Objects := $(Enclave_Cpp_Files:.cpp=.o)
 Gen_Trusted_Source := Enclave/Enclave_t.c

+ 1 - 1
SampleCode/PowerTransition/README.txt

@@ -7,7 +7,7 @@ Software Guard Extensions projects development.
 ------------------------------------
 How to Build/Execute the Sample Code
 ------------------------------------
-1. Install Intel(R) SGX SDK for Linux* OS
+1. Install Intel(R) Software Guard Extensions (Intel(R) SGX) SDK for Linux* OS
 2. Build the project with the prepared Makefile:
     a. Hardware Mode, Debug build:
         $ make

+ 67 - 70
SampleCode/RemoteAttestation/.cproject

@@ -2,7 +2,7 @@
 <?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
 	<storageModule moduleId="org.eclipse.cdt.core.settings">
 		<cconfiguration id="com.intel.sgx.configuration.Sim.Debug">
-			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.Sim.Debug" moduleId="org.eclipse.cdt.core.settings" name="SGX Debug Sim Mode">
+			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.Sim.Debug" moduleId="org.eclipse.cdt.core.settings" name="Intel(R) SGX Simulation Debug">
 				<externalSettings/>
 				<extensions>
 					<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
@@ -17,16 +17,16 @@
 				</extensions>
 			</storageModule>
 			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
-				<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.Sim.Debug" name="SGX Debug Sim Mode" parent="com.intel.sgx.configuration.Sim.Debug">
-					<folderInfo id="com.intel.sgx.configuration.Sim.Debug.292452237" name="/" resourcePath="">
-						<toolChain id="com.intel.sgx.toolChain.Sim.Debug.1618485184" name="SGX GCC" superClass="com.intel.sgx.toolChain.Sim.Debug">
-							<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.1039454044" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
-							<builder arguments="SGX_DEBUG=1 SGX_MODE=SIM -f Makefile" command="make" id="com.intel.sgx.builder2.1591862020" keepEnvironmentInBuildfile="false" name="Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder2"/>
-							<tool id="com.intel.sgx.compiler.1853780321" name="SGX GCC Compiler" superClass="com.intel.sgx.compiler">
-								<option id="com.intel.sgx.option.includePath.1427419865" superClass="com.intel.sgx.option.includePath" valueType="includePath">
-									<listOptionValue builtIn="false" value="/opt/intel/sgxsdk/include"/>
+				<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.Sim.Debug" name="Intel(R) SGX Simulation Debug" parent="com.intel.sgx.configuration.Sim.Debug">
+					<folderInfo id="com.intel.sgx.configuration.Sim.Debug.935873960" name="/" resourcePath="">
+						<toolChain id="com.intel.sgx.toolChain.Sim.Debug.2132595457" name="Intel(R) SGX" superClass="com.intel.sgx.toolChain.Sim.Debug">
+							<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.1678491512" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
+							<builder arguments="SGX_DEBUG=1 SGX_MODE=SIM -f Makefile" command="make" id="com.intel.sgx.builder2.229166714" keepEnvironmentInBuildfile="false" name="Intel(R) Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder2"/>
+							<tool id="com.intel.sgx.compiler.81269967" name="Intel(R) SGX" superClass="com.intel.sgx.compiler">
+								<option id="com.intel.sgx.option.includePath.1694375039" superClass="com.intel.sgx.option.includePath" valueType="includePath">
+									<listOptionValue builtIn="false" value="&quot;${SGX_SDK}/include&quot;"/>
 								</option>
-								<inputType id="com.intel.sgx.inputType.1817588305" superClass="com.intel.sgx.inputType"/>
+								<inputType id="com.intel.sgx.inputType.742388855" superClass="com.intel.sgx.inputType"/>
 							</tool>
 						</toolChain>
 					</folderInfo>
@@ -34,8 +34,8 @@
 			</storageModule>
 			<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
 		</cconfiguration>
-		<cconfiguration id="com.intel.sgx.configuration.HW.Debug">
-			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.HW.Debug" moduleId="org.eclipse.cdt.core.settings" name="SGX Debug HW Mode">
+		<cconfiguration id="com.intel.sgx.configuration.Sim.Release">
+			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.Sim.Release" moduleId="org.eclipse.cdt.core.settings" name="Intel(R) SGX Simulation">
 				<externalSettings/>
 				<extensions>
 					<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
@@ -50,16 +50,16 @@
 				</extensions>
 			</storageModule>
 			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
-				<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.HW.Debug" name="SGX Debug HW Mode" parent="com.intel.sgx.configuration.HW.Debug">
-					<folderInfo id="com.intel.sgx.configuration.HW.Debug.971320034" name="/" resourcePath="">
-						<toolChain id="com.intel.sgx.toolChain.HW.Debug.1761600540" name="SGX GCC" superClass="com.intel.sgx.toolChain.HW.Debug">
-							<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.131147161" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
-							<builder arguments="SGX_DEBUG=1 SGX_MODE=HW -f Makefile" command="make" id="com.intel.sgx.builder1.1502087524" keepEnvironmentInBuildfile="false" name="Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder1"/>
-							<tool id="com.intel.sgx.compiler.1085280084" name="SGX GCC Compiler" superClass="com.intel.sgx.compiler">
-								<option id="com.intel.sgx.option.includePath.57165741" superClass="com.intel.sgx.option.includePath" valueType="includePath">
-									<listOptionValue builtIn="false" value="/opt/intel/sgxsdk/include"/>
+				<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.Sim.Release" name="Intel(R) SGX Simulation" parent="com.intel.sgx.configuration.Sim.Release">
+					<folderInfo id="com.intel.sgx.configuration.Sim.Release.428839196" name="/" resourcePath="">
+						<toolChain id="com.intel.sgx.toolChain.Sim.Release.709775329" name="Intel(R) SGX" superClass="com.intel.sgx.toolChain.Sim.Release">
+							<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.1866379479" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
+							<builder arguments="SGX_DEBUG=0 SGX_MODE=SIM -f Makefile" command="make" id="com.intel.sgx.builder3.1000705250" keepEnvironmentInBuildfile="false" name="Intel(R) Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder3"/>
+							<tool id="com.intel.sgx.compiler.301453474" name="Intel(R) SGX" superClass="com.intel.sgx.compiler">
+								<option id="com.intel.sgx.option.includePath.1312096753" superClass="com.intel.sgx.option.includePath" valueType="includePath">
+									<listOptionValue builtIn="false" value="&quot;${SGX_SDK}/include&quot;"/>
 								</option>
-								<inputType id="com.intel.sgx.inputType.79844751" superClass="com.intel.sgx.inputType"/>
+								<inputType id="com.intel.sgx.inputType.596141238" superClass="com.intel.sgx.inputType"/>
 							</tool>
 						</toolChain>
 					</folderInfo>
@@ -67,8 +67,8 @@
 			</storageModule>
 			<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
 		</cconfiguration>
-		<cconfiguration id="com.intel.sgx.configuration.Sim.Release">
-			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.Sim.Release" moduleId="org.eclipse.cdt.core.settings" name="SGX Release Sim Mode">
+		<cconfiguration id="com.intel.sgx.configuration.HW.Debug">
+			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.HW.Debug" moduleId="org.eclipse.cdt.core.settings" name="Intel(R) SGX Hardware Debug">
 				<externalSettings/>
 				<extensions>
 					<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
@@ -83,16 +83,16 @@
 				</extensions>
 			</storageModule>
 			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
-				<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.Sim.Release" name="SGX Release Sim Mode" parent="com.intel.sgx.configuration.Sim.Release">
-					<folderInfo id="com.intel.sgx.configuration.Sim.Release.151408355" name="/" resourcePath="">
-						<toolChain id="com.intel.sgx.toolChain.Sim.Release.1055083183" name="SGX GCC" superClass="com.intel.sgx.toolChain.Sim.Release">
-							<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.471419902" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
-							<builder arguments="SGX_DEBUG=0 SGX_MODE=SIM -f Makefile" command="make" id="com.intel.sgx.builder3.1151273037" keepEnvironmentInBuildfile="false" name="Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder3"/>
-							<tool id="com.intel.sgx.compiler.1302347316" name="SGX GCC Compiler" superClass="com.intel.sgx.compiler">
-								<option id="com.intel.sgx.option.includePath.1645761127" superClass="com.intel.sgx.option.includePath" valueType="includePath">
-									<listOptionValue builtIn="false" value="/opt/intel/sgxsdk/include"/>
+				<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.HW.Debug" name="Intel(R) SGX Hardware Debug" parent="com.intel.sgx.configuration.HW.Debug">
+					<folderInfo id="com.intel.sgx.configuration.HW.Debug.562917509" name="/" resourcePath="">
+						<toolChain id="com.intel.sgx.toolChain.HW.Debug.2046051538" name="Intel(R) SGX" superClass="com.intel.sgx.toolChain.HW.Debug">
+							<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.999277922" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
+							<builder arguments="SGX_DEBUG=1 SGX_MODE=HW -f Makefile" command="make" id="com.intel.sgx.builder1.577701014" keepEnvironmentInBuildfile="false" name="Intel(R) Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder1"/>
+							<tool id="com.intel.sgx.compiler.1898704176" name="Intel(R) SGX" superClass="com.intel.sgx.compiler">
+								<option id="com.intel.sgx.option.includePath.1026657138" superClass="com.intel.sgx.option.includePath" valueType="includePath">
+									<listOptionValue builtIn="false" value="&quot;${SGX_SDK}/include&quot;"/>
 								</option>
-								<inputType id="com.intel.sgx.inputType.640775034" superClass="com.intel.sgx.inputType"/>
+								<inputType id="com.intel.sgx.inputType.393162412" superClass="com.intel.sgx.inputType"/>
 							</tool>
 						</toolChain>
 					</folderInfo>
@@ -101,7 +101,7 @@
 			<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
 		</cconfiguration>
 		<cconfiguration id="com.intel.sgx.configuration.HW.Prerelease">
-			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.HW.Prerelease" moduleId="org.eclipse.cdt.core.settings" name="SGX Pre-release Release HW Mode">
+			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.HW.Prerelease" moduleId="org.eclipse.cdt.core.settings" name="Intel(R) SGX Hardware Prerelease">
 				<externalSettings/>
 				<extensions>
 					<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
@@ -116,16 +116,16 @@
 				</extensions>
 			</storageModule>
 			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
-				<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.HW.Prerelease" name="SGX Pre-release Release HW Mode" parent="com.intel.sgx.configuration.HW.Prerelease">
-					<folderInfo id="com.intel.sgx.configuration.HW.Prerelease.1418650208" name="/" resourcePath="">
-						<toolChain id="com.intel.sgx.toolChain.HW.Prerelease.1668578385" name="SGX GCC" superClass="com.intel.sgx.toolChain.HW.Prerelease">
-							<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.977258758" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
-							<builder arguments="SGX_PRERELEASE=1 SGX_MODE=HW -f Makefile" command="make" id="com.intel.sgx.builder5.1888300852" keepEnvironmentInBuildfile="false" name="Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder5"/>
-							<tool id="com.intel.sgx.compiler.2113538546" name="SGX GCC Compiler" superClass="com.intel.sgx.compiler">
-								<option id="com.intel.sgx.option.includePath.904888562" superClass="com.intel.sgx.option.includePath" valueType="includePath">
-									<listOptionValue builtIn="false" value="/opt/intel/sgxsdk/include"/>
+				<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.HW.Prerelease" name="Intel(R) SGX Hardware Prerelease" parent="com.intel.sgx.configuration.HW.Prerelease">
+					<folderInfo id="com.intel.sgx.configuration.HW.Prerelease.2074448686" name="/" resourcePath="">
+						<toolChain id="com.intel.sgx.toolChain.HW.Prerelease.2016152654" name="Intel(R) SGX" superClass="com.intel.sgx.toolChain.HW.Prerelease">
+							<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.1520324017" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
+							<builder arguments="SGX_PRERELEASE=1 SGX_MODE=HW -f Makefile" command="make" id="com.intel.sgx.builder5.293910513" keepEnvironmentInBuildfile="false" name="Intel(R) Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder5"/>
+							<tool id="com.intel.sgx.compiler.845441552" name="Intel(R) SGX" superClass="com.intel.sgx.compiler">
+								<option id="com.intel.sgx.option.includePath.199398937" superClass="com.intel.sgx.option.includePath" valueType="includePath">
+									<listOptionValue builtIn="false" value="&quot;${SGX_SDK}/include&quot;"/>
 								</option>
-								<inputType id="com.intel.sgx.inputType.283498732" superClass="com.intel.sgx.inputType"/>
+								<inputType id="com.intel.sgx.inputType.1555926498" superClass="com.intel.sgx.inputType"/>
 							</tool>
 						</toolChain>
 					</folderInfo>
@@ -134,7 +134,7 @@
 			<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
 		</cconfiguration>
 		<cconfiguration id="com.intel.sgx.configuration.HW.Release">
-			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.HW.Release" moduleId="org.eclipse.cdt.core.settings" name="SGX Release HW Mode">
+			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.HW.Release" moduleId="org.eclipse.cdt.core.settings" name="Intel(R) SGX Hardware Release">
 				<externalSettings/>
 				<extensions>
 					<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
@@ -149,16 +149,16 @@
 				</extensions>
 			</storageModule>
 			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
-				<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.HW.Release" name="SGX Release HW Mode" parent="com.intel.sgx.configuration.HW.Release">
-					<folderInfo id="com.intel.sgx.configuration.HW.Release.1657582763" name="/" resourcePath="">
-						<toolChain id="com.intel.sgx.toolChain.HW.Release.465410401" name="SGX GCC" superClass="com.intel.sgx.toolChain.HW.Release">
-							<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.828352216" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
-							<builder arguments="SGX_DEBUG=0 SGX_MODE=HW -f Makefile" command="make" id="com.intel.sgx.builder6.714105790" keepEnvironmentInBuildfile="false" name="Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder6"/>
-							<tool id="com.intel.sgx.compiler.595797282" name="SGX GCC Compiler" superClass="com.intel.sgx.compiler">
-								<option id="com.intel.sgx.option.includePath.1385078253" superClass="com.intel.sgx.option.includePath" valueType="includePath">
-									<listOptionValue builtIn="false" value="/opt/intel/sgxsdk/include"/>
+				<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.HW.Release" name="Intel(R) SGX Hardware Release" parent="com.intel.sgx.configuration.HW.Release">
+					<folderInfo id="com.intel.sgx.configuration.HW.Release.1347223665" name="/" resourcePath="">
+						<toolChain id="com.intel.sgx.toolChain.HW.Release.1050674831" name="Intel(R) SGX" superClass="com.intel.sgx.toolChain.HW.Release">
+							<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.987781695" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
+							<builder arguments="SGX_DEBUG=0 SGX_MODE=HW -f Makefile" command="make" id="com.intel.sgx.builder6.484951388" keepEnvironmentInBuildfile="false" name="Intel(R) Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder6"/>
+							<tool id="com.intel.sgx.compiler.945246695" name="Intel(R) SGX" superClass="com.intel.sgx.compiler">
+								<option id="com.intel.sgx.option.includePath.119487102" superClass="com.intel.sgx.option.includePath" valueType="includePath">
+									<listOptionValue builtIn="false" value="&quot;${SGX_SDK}/include&quot;"/>
 								</option>
-								<inputType id="com.intel.sgx.inputType.463677873" superClass="com.intel.sgx.inputType"/>
+								<inputType id="com.intel.sgx.inputType.593431891" superClass="com.intel.sgx.inputType"/>
 							</tool>
 						</toolChain>
 					</folderInfo>
@@ -168,50 +168,47 @@
 		</cconfiguration>
 	</storageModule>
 	<storageModule moduleId="cdtBuildSystem" version="4.0.0">
-		<project id="RemoteAttestation.null.1312290154" name="RemoteAttestation"/>
+		<project id="RemoteAttestation.cdt.managedbuild.target.gnu.exe.872917958" name="Executable" projectType="cdt.managedbuild.target.gnu.exe"/>
 	</storageModule>
 	<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
 	<storageModule moduleId="refreshScope" versionNumber="2">
-		<configuration configurationName="SGX Debug HW Mode">
+		<configuration configurationName="Intel(R) SGX Hardware Debug">
 			<resource resourceType="PROJECT" workspacePath="/RemoteAttestation"/>
 		</configuration>
-		<configuration configurationName="SGX Debug Sim Mode">
+		<configuration configurationName="Intel(R) SGX Simulation Debug">
 			<resource resourceType="PROJECT" workspacePath="/RemoteAttestation"/>
 		</configuration>
-		<configuration configurationName="Debug">
+		<configuration configurationName="Intel(R) SGX Hardware Prerelease">
 			<resource resourceType="PROJECT" workspacePath="/RemoteAttestation"/>
 		</configuration>
-		<configuration configurationName="Release">
+		<configuration configurationName="Intel(R) SGX Simulation">
 			<resource resourceType="PROJECT" workspacePath="/RemoteAttestation"/>
 		</configuration>
-		<configuration configurationName="SGX Release HW Mode">
+		<configuration configurationName="Intel(R) SGX Hardware Release">
 			<resource resourceType="PROJECT" workspacePath="/RemoteAttestation"/>
 		</configuration>
 	</storageModule>
 	<storageModule moduleId="scannerConfiguration">
 		<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
-		<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.release.680828348;cdt.managedbuild.config.gnu.exe.release.680828348.;cdt.managedbuild.tool.gnu.c.compiler.exe.release.2137539087;cdt.managedbuild.tool.gnu.c.compiler.input.762444756">
-			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+		<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.HW.Release;com.intel.sgx.configuration.HW.Release.1347223665;com.intel.sgx.compiler.945246695;com.intel.sgx.inputType.593431891">
+			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.intel.sgx.SGXPerProjectProfile"/>
 		</scannerConfigBuildInfo>
-		<scannerConfigBuildInfo instanceId="com.intel.sgx.SGXtoolChain.977521771;com.intel.sgx.SGXtoolChain.977521771.100429378;com.intel.sgx.compiler.787445976;com.intel.sgx.inputType.1814458059">
+		<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.Sim.Debug;com.intel.sgx.configuration.Sim.Debug.935873960;com.intel.sgx.compiler.81269967;com.intel.sgx.inputType.742388855">
 			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.intel.sgx.SGXPerProjectProfile"/>
 		</scannerConfigBuildInfo>
-		<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.Sim.Release;com.intel.sgx.configuration.Sim.Release.151408355;com.intel.sgx.compiler.1302347316;com.intel.sgx.inputType.640775034">
+		<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.Sim.Release;com.intel.sgx.configuration.Sim.Release.428839196;com.intel.sgx.compiler.301453474;com.intel.sgx.inputType.596141238">
 			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.intel.sgx.SGXPerProjectProfile"/>
 		</scannerConfigBuildInfo>
-		<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.debug.1377487595;cdt.managedbuild.config.gnu.exe.debug.1377487595.;cdt.managedbuild.tool.gnu.c.compiler.exe.debug.1972419354;cdt.managedbuild.tool.gnu.c.compiler.input.1480710981">
+		<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.debug.1609650460;cdt.managedbuild.config.gnu.exe.debug.1609650460.;cdt.managedbuild.tool.gnu.c.compiler.exe.debug.1644119147;cdt.managedbuild.tool.gnu.c.compiler.input.938348551">
 			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
 		</scannerConfigBuildInfo>
-		<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.HW.Release;com.intel.sgx.configuration.HW.Release.1657582763;com.intel.sgx.compiler.595797282;com.intel.sgx.inputType.463677873">
-			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.intel.sgx.SGXPerProjectProfile"/>
-		</scannerConfigBuildInfo>
-		<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.Sim.Debug;com.intel.sgx.configuration.Sim.Debug.292452237;com.intel.sgx.compiler.1853780321;com.intel.sgx.inputType.1817588305">
-			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.intel.sgx.SGXPerProjectProfile"/>
+		<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.release.1394873887;cdt.managedbuild.config.gnu.exe.release.1394873887.;cdt.managedbuild.tool.gnu.c.compiler.exe.release.2035356548;cdt.managedbuild.tool.gnu.c.compiler.input.793813290">
+			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
 		</scannerConfigBuildInfo>
-		<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.HW.Debug;com.intel.sgx.configuration.HW.Debug.971320034;com.intel.sgx.compiler.1085280084;com.intel.sgx.inputType.79844751">
+		<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.HW.Debug;com.intel.sgx.configuration.HW.Debug.562917509;com.intel.sgx.compiler.1898704176;com.intel.sgx.inputType.393162412">
 			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.intel.sgx.SGXPerProjectProfile"/>
 		</scannerConfigBuildInfo>
-		<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.HW.Prerelease;com.intel.sgx.configuration.HW.Prerelease.1418650208;com.intel.sgx.compiler.2113538546;com.intel.sgx.inputType.283498732">
+		<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.HW.Prerelease;com.intel.sgx.configuration.HW.Prerelease.2074448686;com.intel.sgx.compiler.845441552;com.intel.sgx.inputType.1555926498">
 			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.intel.sgx.SGXPerProjectProfile"/>
 		</scannerConfigBuildInfo>
 	</storageModule>

+ 73 - 0
SampleCode/RemoteAttestation/.settings/language.settings.xml

@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<project>
+	<configuration id="com.intel.sgx.configuration.Sim.Debug" name="Intel(R) SGX Simulation Debug">
+		<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
+			<provider class="org.eclipse.cdt.core.language.settings.providers.LanguageSettingsGenericProvider" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider" name="CDT User Setting Entries" prefer-non-shared="true" store-entries-with-project="true">
+				<resource project-relative-path="">
+					<entry kind="includePath" name="${SGX_SDK}/include">
+						<flag value="LOCAL"/>
+					</entry>
+				</resource>
+			</provider>
+			<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" ref="shared-provider"/>
+		</extension>
+	</configuration>
+	<configuration id="com.intel.sgx.configuration.Sim.Release" name="Intel(R) SGX Simulation">
+		<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
+			<provider class="org.eclipse.cdt.core.language.settings.providers.LanguageSettingsGenericProvider" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider" name="CDT User Setting Entries" prefer-non-shared="true" store-entries-with-project="true">
+				<resource project-relative-path="">
+					<entry kind="includePath" name="${SGX_SDK}/include">
+						<flag value="LOCAL"/>
+					</entry>
+				</resource>
+			</provider>
+			<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" ref="shared-provider"/>
+		</extension>
+	</configuration>
+	<configuration id="com.intel.sgx.configuration.HW.Debug" name="Intel(R) SGX Hardware Debug">
+		<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
+			<provider class="org.eclipse.cdt.core.language.settings.providers.LanguageSettingsGenericProvider" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider" name="CDT User Setting Entries" prefer-non-shared="true" store-entries-with-project="true">
+				<resource project-relative-path="">
+					<entry kind="includePath" name="${SGX_SDK}/include">
+						<flag value="LOCAL"/>
+					</entry>
+				</resource>
+			</provider>
+			<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" ref="shared-provider"/>
+		</extension>
+	</configuration>
+	<configuration id="com.intel.sgx.configuration.HW.Prerelease" name="Intel(R) SGX Hardware Prerelease">
+		<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
+			<provider class="org.eclipse.cdt.core.language.settings.providers.LanguageSettingsGenericProvider" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider" name="CDT User Setting Entries" prefer-non-shared="true" store-entries-with-project="true">
+				<resource project-relative-path="">
+					<entry kind="includePath" name="${SGX_SDK}/include">
+						<flag value="LOCAL"/>
+					</entry>
+				</resource>
+			</provider>
+			<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" ref="shared-provider"/>
+		</extension>
+	</configuration>
+	<configuration id="com.intel.sgx.configuration.HW.Release" name="Intel(R) SGX Hardware Release">
+		<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
+			<provider class="org.eclipse.cdt.core.language.settings.providers.LanguageSettingsGenericProvider" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider" name="CDT User Setting Entries" prefer-non-shared="true" store-entries-with-project="true">
+				<resource project-relative-path="">
+					<entry kind="includePath" name="${SGX_SDK}/include">
+						<flag value="LOCAL"/>
+					</entry>
+				</resource>
+			</provider>
+			<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" ref="shared-provider"/>
+		</extension>
+	</configuration>
+</project>

+ 12 - 6
SampleCode/RemoteAttestation/Makefile

@@ -110,7 +110,7 @@ App_Name := app
 ######## Service Provider Settings ########
 
 ServiceProvider_Cpp_Files := service_provider/ecp.cpp service_provider/network_ra.cpp service_provider/service_provider.cpp service_provider/ias_ra.cpp 
-ServiceProvider_Include_Paths := -I$(SGX_SDK)/include -I$(SGX_SDK)/include/tlibc -I$(SGX_SDK)/include/stlport -Isample_libcrypto
+ServiceProvider_Include_Paths := -I$(SGX_SDK)/include -I$(SGX_SDK)/include/tlibc -I$(SGX_SDK)/include/libcxx -Isample_libcrypto
 
 ServiceProvider_C_Flags := $(SGX_COMMON_CFLAGS) -fPIC -Wno-attributes -I$(SGX_SDK)/include -Isample_libcrypto
 ServiceProvider_Cpp_Flags := $(ServiceProvider_C_Flags) -std=c++11
@@ -130,10 +130,16 @@ endif
 Crypto_Library_Name := sgx_tcrypto
 
 Enclave_Cpp_Files := isv_enclave/isv_enclave.cpp
-Enclave_Include_Paths := -I$(SGX_SDK)/include -I$(SGX_SDK)/include/tlibc -I$(SGX_SDK)/include/stlport
+Enclave_Include_Paths := -I$(SGX_SDK)/include -I$(SGX_SDK)/include/tlibc -I$(SGX_SDK)/include/libcxx
 
-Enclave_C_Flags := $(SGX_COMMON_CFLAGS) -nostdinc -fvisibility=hidden -fpie -fstack-protector $(Enclave_Include_Paths)
-Enclave_Cpp_Flags := $(Enclave_C_Flags) -std=c++03 -nostdinc++
+CC_BELOW_4_9 := $(shell expr "`$(CC) -dumpversion`" \< "4.9")
+ifeq ($(CC_BELOW_4_9), 1)
+	Enclave_C_Flags := $(SGX_COMMON_CFLAGS) -nostdinc -fvisibility=hidden -fpie -ffunction-sections -fdata-sections -fstack-protector
+else
+	Enclave_C_Flags := $(SGX_COMMON_CFLAGS) -nostdinc -fvisibility=hidden -fpie -ffunction-sections -fdata-sections -fstack-protector-strong
+endif
+Enclave_C_Flags += $(Enclave_Include_Paths)
+Enclave_Cpp_Flags := $(Enclave_C_Flags) -std=c++11 -nostdinc++
 
 # To generate a proper enclave, it is recommended to follow below guideline to link the trusted libraries:
 #    1. Link sgx_trts with the `--whole-archive' and `--no-whole-archive' options,
@@ -144,10 +150,10 @@ Enclave_Cpp_Flags := $(Enclave_C_Flags) -std=c++03 -nostdinc++
 # Otherwise, you may get some undesirable errors.
 Enclave_Link_Flags := $(SGX_COMMON_CFLAGS) -Wl,--no-undefined -nostdlib -nodefaultlibs -nostartfiles -L$(SGX_LIBRARY_PATH) \
 	-Wl,--whole-archive -l$(Trts_Library_Name) -Wl,--no-whole-archive \
-	-Wl,--start-group -lsgx_tstdc -lsgx_tstdcxx -lsgx_tkey_exchange -l$(Crypto_Library_Name) -l$(Service_Library_Name) -Wl,--end-group \
+	-Wl,--start-group -lsgx_tstdc -lsgx_tcxx -lsgx_tkey_exchange -l$(Crypto_Library_Name) -l$(Service_Library_Name) -Wl,--end-group \
 	-Wl,-Bstatic -Wl,-Bsymbolic -Wl,--no-undefined \
 	-Wl,-pie,-eenclave_entry -Wl,--export-dynamic  \
-	-Wl,--defsym,__ImageBase=0 \
+	-Wl,--defsym,__ImageBase=0 -Wl,--gc-sections   \
 	-Wl,--version-script=isv_enclave/isv_enclave.lds 
 
 Enclave_Cpp_Objects := $(Enclave_Cpp_Files:.cpp=.o)

+ 1 - 1
SampleCode/RemoteAttestation/README.txt

@@ -8,7 +8,7 @@ The project demonstrates:
 ------------------------------------
 How to Build/Execute the Sample Code
 ------------------------------------
-1. Install Intel(R) SGX SDK for Linux* OS
+1. Install Intel(R) Software Guard Extensions (Intel(R) SGX) SDK for Linux* OS
 2. Build the project with the prepared Makefile:
     a. Hardware Mode, Debug build:
         $ make

+ 8 - 5
SampleCode/RemoteAttestation/isv_app/isv_app.cpp

@@ -71,7 +71,7 @@
 
 uint8_t* msg1_samples[] = { msg1_sample1, msg1_sample2 };
 uint8_t* msg2_samples[] = { msg2_sample1, msg2_sample2 };
-uint8_t* msg3_samples[MSG3_BODY_SIZE] = { msg3_sample1, msg3_sample2 };
+uint8_t* msg3_samples[] = { msg3_sample1, msg3_sample2 };
 uint8_t* attestation_msg_samples[] =
     { attestation_msg_sample1, attestation_msg_sample2};
 
@@ -437,8 +437,10 @@ int main(int argc, char* argv[])
                 ra_samp_response_header_t* precomputed_msg2 =
                     (ra_samp_response_header_t *)
                     msg2_samples[GET_VERIFICATION_ARRAY_INDEX()];
-                if(memcmp( precomputed_msg2, p_msg2_full,
-                   sizeof(ra_samp_response_header_t) + p_msg2_full->size))
+                if(MSG2_BODY_SIZE !=
+                    sizeof(ra_samp_response_header_t) + p_msg2_full->size ||
+                    memcmp( precomputed_msg2, p_msg2_full,
+                        sizeof(ra_samp_response_header_t) + p_msg2_full->size))
                 {
                     fprintf(OUTPUT, "\nVerification ERROR. Our precomputed "
                                     "value for MSG2 does NOT match.\n");
@@ -575,7 +577,8 @@ int main(int argc, char* argv[])
                             "result message back\n.");
             if( VERIFICATION_INDEX_IS_VALID() )
             {
-                if(memcmp(p_att_result_msg_full->body,
+                if(ATTESTATION_MSG_BODY_SIZE != p_att_result_msg_full->size ||
+                    memcmp(p_att_result_msg_full->body,
                         attestation_msg_samples[GET_VERIFICATION_ARRAY_INDEX()],
                         p_att_result_msg_full->size) )
                 {
@@ -585,7 +588,7 @@ int main(int argc, char* argv[])
                     fprintf(OUTPUT, "\nEXPECTED ATTESTATION RESULT -");
                     PRINT_BYTE_ARRAY(OUTPUT,
                         attestation_msg_samples[GET_VERIFICATION_ARRAY_INDEX()],
-                        p_att_result_msg_full->size);
+                        ATTESTATION_MSG_BODY_SIZE);
                 }
             }
         }

+ 12 - 6
SampleCode/RemoteAttestation/isv_app/sample_messages.h

@@ -37,7 +37,9 @@
 
 #include <stdint.h>
 
-uint8_t msg1_sample1[] =
+#define MSG1_BODY_SIZE 68
+
+uint8_t msg1_sample1[MSG1_BODY_SIZE] =
 {
     0xe8, 0xcf, 0xf, 0x97, 0x8a, 0xf4, 0x24, 0x8a,
     0xf5, 0x5b, 0x56, 0xf0, 0xac, 0x7f, 0x78, 0x39,
@@ -50,7 +52,7 @@ uint8_t msg1_sample1[] =
     0x3, 0x1, 0x0, 0x0
 };
 
-uint8_t msg1_sample2[] =
+uint8_t msg1_sample2[MSG1_BODY_SIZE] =
 {
     0xa8, 0x56, 0x72, 0xc1, 0x14, 0x41, 0xa, 0x2f,
     0xdc, 0xb0, 0xa8, 0xa1, 0x3a, 0x51, 0x40, 0xf9,
@@ -63,7 +65,9 @@ uint8_t msg1_sample2[] =
     0x3, 0x1, 0x0, 0x0
 };
 
-uint8_t msg2_sample1[] =
+#define MSG2_BODY_SIZE 176
+
+uint8_t msg2_sample1[MSG2_BODY_SIZE] =
 {
     0x2, 0x0, 0x0, 0xa8, 0x0, 0x0, 0x0, 0x0,
     0x6a, 0x83, 0xdc, 0x84, 0xd4, 0x4c, 0x8a, 0xbb,
@@ -89,7 +93,7 @@ uint8_t msg2_sample1[] =
     0x27, 0xc2, 0x55, 0xb9, 0x0, 0x0, 0x0, 0x0
 };
 
-uint8_t msg2_sample2[] =
+uint8_t msg2_sample2[MSG2_BODY_SIZE] =
 {
     0x2, 0x0, 0x0, 0xa8, 0x0, 0x0, 0x0, 0x0,
     0x6a, 0x83, 0xdc, 0x84, 0xd4, 0x4c, 0x8a, 0xbb,
@@ -490,7 +494,9 @@ uint8_t msg3_sample2[MSG3_BODY_SIZE] =
     0xe8, 0x1e, 0x5e, 0xd8
 };
 
-uint8_t attestation_msg_sample1[] =
+#define ATTESTATION_MSG_BODY_SIZE 145
+
+uint8_t attestation_msg_sample1[ATTESTATION_MSG_BODY_SIZE] =
 {
     0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
     0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
@@ -513,7 +519,7 @@ uint8_t attestation_msg_sample1[] =
     0xc0
 };
 
-uint8_t attestation_msg_sample2[] =
+uint8_t attestation_msg_sample2[ATTESTATION_MSG_BODY_SIZE] =
 {
     0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
     0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,

+ 4 - 4
SampleCode/RemoteAttestation/service_provider/ecp.cpp

@@ -144,8 +144,8 @@ bool derive_key(
     sample_ret = sample_sha256_close(sha_context);
 
     static_assert(sizeof(sample_ec_key_128bit_t)* 2 == sizeof(sample_sha256_hash_t), "structure size mismatch.");
-    memcpy(first_derived_key, &key_material, sizeof(sample_ec_key_128bit_t));
-    memcpy(second_derived_key, (uint8_t*)&key_material + sizeof(sample_ec_key_128bit_t), sizeof(sample_ec_key_128bit_t));
+    memcpy_s(first_derived_key, sizeof(sample_ec_key_128bit_t), &key_material, sizeof(sample_ec_key_128bit_t));
+    memcpy_s(second_derived_key, sizeof(sample_ec_key_128bit_t), (uint8_t*)&key_material + sizeof(sample_ec_key_128bit_t), sizeof(sample_ec_key_128bit_t));
 
     // memset here can be optimized away by compiler, so please use memset_s on
     // windows for production code and similar functions on other OSes.
@@ -233,7 +233,7 @@ bool derive_key(
     /*counter = 0x01 */
     p_derivation_buffer[0] = 0x01;
     /*label*/
-    memcpy(&p_derivation_buffer[1], label, label_length);
+    memcpy_s(&p_derivation_buffer[1], derivation_buffer_length - 1, label, label_length);
     /*output_key_len=0x0080*/
     uint16_t *key_len = (uint16_t *)(&(p_derivation_buffer[derivation_buffer_length - 2]));
     *key_len = 0x0080;
@@ -254,4 +254,4 @@ bool derive_key(
     }
     return true;
 }
-#endif
+#endif

+ 67 - 70
SampleCode/SampleEnclave/.cproject

@@ -2,7 +2,7 @@
 <?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
 	<storageModule moduleId="org.eclipse.cdt.core.settings">
 		<cconfiguration id="com.intel.sgx.configuration.Sim.Debug">
-			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.Sim.Debug" moduleId="org.eclipse.cdt.core.settings" name="SGX Debug Sim Mode">
+			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.Sim.Debug" moduleId="org.eclipse.cdt.core.settings" name="Intel(R) SGX Simulation Debug">
 				<externalSettings/>
 				<extensions>
 					<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
@@ -17,16 +17,16 @@
 				</extensions>
 			</storageModule>
 			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
-				<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.Sim.Debug" name="SGX Debug Sim Mode" parent="com.intel.sgx.configuration.Sim.Debug">
-					<folderInfo id="com.intel.sgx.configuration.Sim.Debug.292452237" name="/" resourcePath="">
-						<toolChain id="com.intel.sgx.toolChain.Sim.Debug.1618485184" name="SGX GCC" superClass="com.intel.sgx.toolChain.Sim.Debug">
-							<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.1039454044" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
-							<builder arguments="SGX_DEBUG=1 SGX_MODE=SIM -f Makefile" command="make" id="com.intel.sgx.builder2.1591862020" keepEnvironmentInBuildfile="false" name="Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder2"/>
-							<tool id="com.intel.sgx.compiler.1853780321" name="SGX GCC Compiler" superClass="com.intel.sgx.compiler">
-								<option id="com.intel.sgx.option.includePath.1427419865" superClass="com.intel.sgx.option.includePath" valueType="includePath">
-									<listOptionValue builtIn="false" value="/opt/intel/sgxsdk/include"/>
+				<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.Sim.Debug" name="Intel(R) SGX Simulation Debug" parent="com.intel.sgx.configuration.Sim.Debug">
+					<folderInfo id="com.intel.sgx.configuration.Sim.Debug.935873960" name="/" resourcePath="">
+						<toolChain id="com.intel.sgx.toolChain.Sim.Debug.2132595457" name="Intel(R) SGX" superClass="com.intel.sgx.toolChain.Sim.Debug">
+							<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.1678491512" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
+							<builder arguments="SGX_DEBUG=1 SGX_MODE=SIM -f Makefile" command="make" id="com.intel.sgx.builder2.229166714" keepEnvironmentInBuildfile="false" name="Intel(R) Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder2"/>
+							<tool id="com.intel.sgx.compiler.81269967" name="Intel(R) SGX" superClass="com.intel.sgx.compiler">
+								<option id="com.intel.sgx.option.includePath.1694375039" superClass="com.intel.sgx.option.includePath" valueType="includePath">
+									<listOptionValue builtIn="false" value="&quot;${SGX_SDK}/include&quot;"/>
 								</option>
-								<inputType id="com.intel.sgx.inputType.1817588305" superClass="com.intel.sgx.inputType"/>
+								<inputType id="com.intel.sgx.inputType.742388855" superClass="com.intel.sgx.inputType"/>
 							</tool>
 						</toolChain>
 					</folderInfo>
@@ -34,8 +34,8 @@
 			</storageModule>
 			<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
 		</cconfiguration>
-		<cconfiguration id="com.intel.sgx.configuration.HW.Debug">
-			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.HW.Debug" moduleId="org.eclipse.cdt.core.settings" name="SGX Debug HW Mode">
+		<cconfiguration id="com.intel.sgx.configuration.Sim.Release">
+			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.Sim.Release" moduleId="org.eclipse.cdt.core.settings" name="Intel(R) SGX Simulation">
 				<externalSettings/>
 				<extensions>
 					<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
@@ -50,16 +50,16 @@
 				</extensions>
 			</storageModule>
 			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
-				<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.HW.Debug" name="SGX Debug HW Mode" parent="com.intel.sgx.configuration.HW.Debug">
-					<folderInfo id="com.intel.sgx.configuration.HW.Debug.971320034" name="/" resourcePath="">
-						<toolChain id="com.intel.sgx.toolChain.HW.Debug.1761600540" name="SGX GCC" superClass="com.intel.sgx.toolChain.HW.Debug">
-							<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.131147161" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
-							<builder arguments="SGX_DEBUG=1 SGX_MODE=HW -f Makefile" command="make" id="com.intel.sgx.builder1.1502087524" keepEnvironmentInBuildfile="false" name="Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder1"/>
-							<tool id="com.intel.sgx.compiler.1085280084" name="SGX GCC Compiler" superClass="com.intel.sgx.compiler">
-								<option id="com.intel.sgx.option.includePath.57165741" superClass="com.intel.sgx.option.includePath" valueType="includePath">
-									<listOptionValue builtIn="false" value="/opt/intel/sgxsdk/include"/>
+				<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.Sim.Release" name="Intel(R) SGX Simulation" parent="com.intel.sgx.configuration.Sim.Release">
+					<folderInfo id="com.intel.sgx.configuration.Sim.Release.428839196" name="/" resourcePath="">
+						<toolChain id="com.intel.sgx.toolChain.Sim.Release.709775329" name="Intel(R) SGX" superClass="com.intel.sgx.toolChain.Sim.Release">
+							<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.1866379479" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
+							<builder arguments="SGX_DEBUG=0 SGX_MODE=SIM -f Makefile" command="make" id="com.intel.sgx.builder3.1000705250" keepEnvironmentInBuildfile="false" name="Intel(R) Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder3"/>
+							<tool id="com.intel.sgx.compiler.301453474" name="Intel(R) SGX" superClass="com.intel.sgx.compiler">
+								<option id="com.intel.sgx.option.includePath.1312096753" superClass="com.intel.sgx.option.includePath" valueType="includePath">
+									<listOptionValue builtIn="false" value="&quot;${SGX_SDK}/include&quot;"/>
 								</option>
-								<inputType id="com.intel.sgx.inputType.79844751" superClass="com.intel.sgx.inputType"/>
+								<inputType id="com.intel.sgx.inputType.596141238" superClass="com.intel.sgx.inputType"/>
 							</tool>
 						</toolChain>
 					</folderInfo>
@@ -67,8 +67,8 @@
 			</storageModule>
 			<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
 		</cconfiguration>
-		<cconfiguration id="com.intel.sgx.configuration.Sim.Release">
-			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.Sim.Release" moduleId="org.eclipse.cdt.core.settings" name="SGX Release Sim Mode">
+		<cconfiguration id="com.intel.sgx.configuration.HW.Debug">
+			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.HW.Debug" moduleId="org.eclipse.cdt.core.settings" name="Intel(R) SGX Hardware Debug">
 				<externalSettings/>
 				<extensions>
 					<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
@@ -83,16 +83,16 @@
 				</extensions>
 			</storageModule>
 			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
-				<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.Sim.Release" name="SGX Release Sim Mode" parent="com.intel.sgx.configuration.Sim.Release">
-					<folderInfo id="com.intel.sgx.configuration.Sim.Release.151408355" name="/" resourcePath="">
-						<toolChain id="com.intel.sgx.toolChain.Sim.Release.1055083183" name="SGX GCC" superClass="com.intel.sgx.toolChain.Sim.Release">
-							<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.471419902" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
-							<builder arguments="SGX_DEBUG=0 SGX_MODE=SIM -f Makefile" command="make" id="com.intel.sgx.builder3.1151273037" keepEnvironmentInBuildfile="false" name="Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder3"/>
-							<tool id="com.intel.sgx.compiler.1302347316" name="SGX GCC Compiler" superClass="com.intel.sgx.compiler">
-								<option id="com.intel.sgx.option.includePath.1645761127" superClass="com.intel.sgx.option.includePath" valueType="includePath">
-									<listOptionValue builtIn="false" value="/opt/intel/sgxsdk/include"/>
+				<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.HW.Debug" name="Intel(R) SGX Hardware Debug" parent="com.intel.sgx.configuration.HW.Debug">
+					<folderInfo id="com.intel.sgx.configuration.HW.Debug.562917509" name="/" resourcePath="">
+						<toolChain id="com.intel.sgx.toolChain.HW.Debug.2046051538" name="Intel(R) SGX" superClass="com.intel.sgx.toolChain.HW.Debug">
+							<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.999277922" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
+							<builder arguments="SGX_DEBUG=1 SGX_MODE=HW -f Makefile" command="make" id="com.intel.sgx.builder1.577701014" keepEnvironmentInBuildfile="false" name="Intel(R) Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder1"/>
+							<tool id="com.intel.sgx.compiler.1898704176" name="Intel(R) SGX" superClass="com.intel.sgx.compiler">
+								<option id="com.intel.sgx.option.includePath.1026657138" superClass="com.intel.sgx.option.includePath" valueType="includePath">
+									<listOptionValue builtIn="false" value="&quot;${SGX_SDK}/include&quot;"/>
 								</option>
-								<inputType id="com.intel.sgx.inputType.640775034" superClass="com.intel.sgx.inputType"/>
+								<inputType id="com.intel.sgx.inputType.393162412" superClass="com.intel.sgx.inputType"/>
 							</tool>
 						</toolChain>
 					</folderInfo>
@@ -101,7 +101,7 @@
 			<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
 		</cconfiguration>
 		<cconfiguration id="com.intel.sgx.configuration.HW.Prerelease">
-			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.HW.Prerelease" moduleId="org.eclipse.cdt.core.settings" name="SGX Pre-release Release HW Mode">
+			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.HW.Prerelease" moduleId="org.eclipse.cdt.core.settings" name="Intel(R) SGX Hardware Prerelease">
 				<externalSettings/>
 				<extensions>
 					<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
@@ -116,16 +116,16 @@
 				</extensions>
 			</storageModule>
 			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
-				<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.HW.Prerelease" name="SGX Pre-release Release HW Mode" parent="com.intel.sgx.configuration.HW.Prerelease">
-					<folderInfo id="com.intel.sgx.configuration.HW.Prerelease.1418650208" name="/" resourcePath="">
-						<toolChain id="com.intel.sgx.toolChain.HW.Prerelease.1668578385" name="SGX GCC" superClass="com.intel.sgx.toolChain.HW.Prerelease">
-							<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.977258758" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
-							<builder arguments="SGX_PRERELEASE=1 SGX_MODE=HW -f Makefile" command="make" id="com.intel.sgx.builder5.1888300852" keepEnvironmentInBuildfile="false" name="Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder5"/>
-							<tool id="com.intel.sgx.compiler.2113538546" name="SGX GCC Compiler" superClass="com.intel.sgx.compiler">
-								<option id="com.intel.sgx.option.includePath.904888562" superClass="com.intel.sgx.option.includePath" valueType="includePath">
-									<listOptionValue builtIn="false" value="/opt/intel/sgxsdk/include"/>
+				<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.HW.Prerelease" name="Intel(R) SGX Hardware Prerelease" parent="com.intel.sgx.configuration.HW.Prerelease">
+					<folderInfo id="com.intel.sgx.configuration.HW.Prerelease.2074448686" name="/" resourcePath="">
+						<toolChain id="com.intel.sgx.toolChain.HW.Prerelease.2016152654" name="Intel(R) SGX" superClass="com.intel.sgx.toolChain.HW.Prerelease">
+							<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.1520324017" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
+							<builder arguments="SGX_PRERELEASE=1 SGX_MODE=HW -f Makefile" command="make" id="com.intel.sgx.builder5.293910513" keepEnvironmentInBuildfile="false" name="Intel(R) Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder5"/>
+							<tool id="com.intel.sgx.compiler.845441552" name="Intel(R) SGX" superClass="com.intel.sgx.compiler">
+								<option id="com.intel.sgx.option.includePath.199398937" superClass="com.intel.sgx.option.includePath" valueType="includePath">
+									<listOptionValue builtIn="false" value="&quot;${SGX_SDK}/include&quot;"/>
 								</option>
-								<inputType id="com.intel.sgx.inputType.283498732" superClass="com.intel.sgx.inputType"/>
+								<inputType id="com.intel.sgx.inputType.1555926498" superClass="com.intel.sgx.inputType"/>
 							</tool>
 						</toolChain>
 					</folderInfo>
@@ -134,7 +134,7 @@
 			<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
 		</cconfiguration>
 		<cconfiguration id="com.intel.sgx.configuration.HW.Release">
-			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.HW.Release" moduleId="org.eclipse.cdt.core.settings" name="SGX Release HW Mode">
+			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.HW.Release" moduleId="org.eclipse.cdt.core.settings" name="Intel(R) SGX Hardware Release">
 				<externalSettings/>
 				<extensions>
 					<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
@@ -149,16 +149,16 @@
 				</extensions>
 			</storageModule>
 			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
-				<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.HW.Release" name="SGX Release HW Mode" parent="com.intel.sgx.configuration.HW.Release">
-					<folderInfo id="com.intel.sgx.configuration.HW.Release.1657582763" name="/" resourcePath="">
-						<toolChain id="com.intel.sgx.toolChain.HW.Release.465410401" name="SGX GCC" superClass="com.intel.sgx.toolChain.HW.Release">
-							<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.828352216" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
-							<builder arguments="SGX_DEBUG=0 SGX_MODE=HW -f Makefile" command="make" id="com.intel.sgx.builder6.714105790" keepEnvironmentInBuildfile="false" name="Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder6"/>
-							<tool id="com.intel.sgx.compiler.595797282" name="SGX GCC Compiler" superClass="com.intel.sgx.compiler">
-								<option id="com.intel.sgx.option.includePath.1385078253" superClass="com.intel.sgx.option.includePath" valueType="includePath">
-									<listOptionValue builtIn="false" value="/opt/intel/sgxsdk/include"/>
+				<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.HW.Release" name="Intel(R) SGX Hardware Release" parent="com.intel.sgx.configuration.HW.Release">
+					<folderInfo id="com.intel.sgx.configuration.HW.Release.1347223665" name="/" resourcePath="">
+						<toolChain id="com.intel.sgx.toolChain.HW.Release.1050674831" name="Intel(R) SGX" superClass="com.intel.sgx.toolChain.HW.Release">
+							<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.987781695" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
+							<builder arguments="SGX_DEBUG=0 SGX_MODE=HW -f Makefile" command="make" id="com.intel.sgx.builder6.484951388" keepEnvironmentInBuildfile="false" name="Intel(R) Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder6"/>
+							<tool id="com.intel.sgx.compiler.945246695" name="Intel(R) SGX" superClass="com.intel.sgx.compiler">
+								<option id="com.intel.sgx.option.includePath.119487102" superClass="com.intel.sgx.option.includePath" valueType="includePath">
+									<listOptionValue builtIn="false" value="&quot;${SGX_SDK}/include&quot;"/>
 								</option>
-								<inputType id="com.intel.sgx.inputType.463677873" superClass="com.intel.sgx.inputType"/>
+								<inputType id="com.intel.sgx.inputType.593431891" superClass="com.intel.sgx.inputType"/>
 							</tool>
 						</toolChain>
 					</folderInfo>
@@ -168,50 +168,47 @@
 		</cconfiguration>
 	</storageModule>
 	<storageModule moduleId="cdtBuildSystem" version="4.0.0">
-		<project id="SampleEnclave.null.1312290154" name="SampleEnclave"/>
+		<project id="SampleEnclave.cdt.managedbuild.target.gnu.exe.872917958" name="Executable" projectType="cdt.managedbuild.target.gnu.exe"/>
 	</storageModule>
 	<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
 	<storageModule moduleId="refreshScope" versionNumber="2">
-		<configuration configurationName="SGX Debug HW Mode">
+		<configuration configurationName="Intel(R) SGX Hardware Debug">
 			<resource resourceType="PROJECT" workspacePath="/SampleEnclave"/>
 		</configuration>
-		<configuration configurationName="SGX Debug Sim Mode">
+		<configuration configurationName="Intel(R) SGX Simulation Debug">
 			<resource resourceType="PROJECT" workspacePath="/SampleEnclave"/>
 		</configuration>
-		<configuration configurationName="Debug">
+		<configuration configurationName="Intel(R) SGX Hardware Prerelease">
 			<resource resourceType="PROJECT" workspacePath="/SampleEnclave"/>
 		</configuration>
-		<configuration configurationName="Release">
+		<configuration configurationName="Intel(R) SGX Simulation">
 			<resource resourceType="PROJECT" workspacePath="/SampleEnclave"/>
 		</configuration>
-		<configuration configurationName="SGX Release HW Mode">
+		<configuration configurationName="Intel(R) SGX Hardware Release">
 			<resource resourceType="PROJECT" workspacePath="/SampleEnclave"/>
 		</configuration>
 	</storageModule>
 	<storageModule moduleId="scannerConfiguration">
 		<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
-		<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.release.680828348;cdt.managedbuild.config.gnu.exe.release.680828348.;cdt.managedbuild.tool.gnu.c.compiler.exe.release.2137539087;cdt.managedbuild.tool.gnu.c.compiler.input.762444756">
-			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+		<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.HW.Release;com.intel.sgx.configuration.HW.Release.1347223665;com.intel.sgx.compiler.945246695;com.intel.sgx.inputType.593431891">
+			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.intel.sgx.SGXPerProjectProfile"/>
 		</scannerConfigBuildInfo>
-		<scannerConfigBuildInfo instanceId="com.intel.sgx.SGXtoolChain.977521771;com.intel.sgx.SGXtoolChain.977521771.100429378;com.intel.sgx.compiler.787445976;com.intel.sgx.inputType.1814458059">
+		<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.Sim.Debug;com.intel.sgx.configuration.Sim.Debug.935873960;com.intel.sgx.compiler.81269967;com.intel.sgx.inputType.742388855">
 			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.intel.sgx.SGXPerProjectProfile"/>
 		</scannerConfigBuildInfo>
-		<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.Sim.Release;com.intel.sgx.configuration.Sim.Release.151408355;com.intel.sgx.compiler.1302347316;com.intel.sgx.inputType.640775034">
+		<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.Sim.Release;com.intel.sgx.configuration.Sim.Release.428839196;com.intel.sgx.compiler.301453474;com.intel.sgx.inputType.596141238">
 			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.intel.sgx.SGXPerProjectProfile"/>
 		</scannerConfigBuildInfo>
-		<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.debug.1377487595;cdt.managedbuild.config.gnu.exe.debug.1377487595.;cdt.managedbuild.tool.gnu.c.compiler.exe.debug.1972419354;cdt.managedbuild.tool.gnu.c.compiler.input.1480710981">
+		<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.debug.1609650460;cdt.managedbuild.config.gnu.exe.debug.1609650460.;cdt.managedbuild.tool.gnu.c.compiler.exe.debug.1644119147;cdt.managedbuild.tool.gnu.c.compiler.input.938348551">
 			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
 		</scannerConfigBuildInfo>
-		<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.HW.Release;com.intel.sgx.configuration.HW.Release.1657582763;com.intel.sgx.compiler.595797282;com.intel.sgx.inputType.463677873">
-			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.intel.sgx.SGXPerProjectProfile"/>
-		</scannerConfigBuildInfo>
-		<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.Sim.Debug;com.intel.sgx.configuration.Sim.Debug.292452237;com.intel.sgx.compiler.1853780321;com.intel.sgx.inputType.1817588305">
-			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.intel.sgx.SGXPerProjectProfile"/>
+		<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.release.1394873887;cdt.managedbuild.config.gnu.exe.release.1394873887.;cdt.managedbuild.tool.gnu.c.compiler.exe.release.2035356548;cdt.managedbuild.tool.gnu.c.compiler.input.793813290">
+			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
 		</scannerConfigBuildInfo>
-		<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.HW.Debug;com.intel.sgx.configuration.HW.Debug.971320034;com.intel.sgx.compiler.1085280084;com.intel.sgx.inputType.79844751">
+		<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.HW.Debug;com.intel.sgx.configuration.HW.Debug.562917509;com.intel.sgx.compiler.1898704176;com.intel.sgx.inputType.393162412">
 			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.intel.sgx.SGXPerProjectProfile"/>
 		</scannerConfigBuildInfo>
-		<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.HW.Prerelease;com.intel.sgx.configuration.HW.Prerelease.1418650208;com.intel.sgx.compiler.2113538546;com.intel.sgx.inputType.283498732">
+		<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.HW.Prerelease;com.intel.sgx.configuration.HW.Prerelease.2074448686;com.intel.sgx.compiler.845441552;com.intel.sgx.inputType.1555926498">
 			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.intel.sgx.SGXPerProjectProfile"/>
 		</scannerConfigBuildInfo>
 	</storageModule>

+ 73 - 0
SampleCode/SampleEnclave/.settings/language.settings.xml

@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<project>
+	<configuration id="com.intel.sgx.configuration.Sim.Debug" name="Intel(R) SGX Simulation Debug">
+		<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
+			<provider class="org.eclipse.cdt.core.language.settings.providers.LanguageSettingsGenericProvider" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider" name="CDT User Setting Entries" prefer-non-shared="true" store-entries-with-project="true">
+				<resource project-relative-path="">
+					<entry kind="includePath" name="${SGX_SDK}/include">
+						<flag value="LOCAL"/>
+					</entry>
+				</resource>
+			</provider>
+			<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" ref="shared-provider"/>
+		</extension>
+	</configuration>
+	<configuration id="com.intel.sgx.configuration.Sim.Release" name="Intel(R) SGX Simulation">
+		<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
+			<provider class="org.eclipse.cdt.core.language.settings.providers.LanguageSettingsGenericProvider" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider" name="CDT User Setting Entries" prefer-non-shared="true" store-entries-with-project="true">
+				<resource project-relative-path="">
+					<entry kind="includePath" name="${SGX_SDK}/include">
+						<flag value="LOCAL"/>
+					</entry>
+				</resource>
+			</provider>
+			<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" ref="shared-provider"/>
+		</extension>
+	</configuration>
+	<configuration id="com.intel.sgx.configuration.HW.Debug" name="Intel(R) SGX Hardware Debug">
+		<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
+			<provider class="org.eclipse.cdt.core.language.settings.providers.LanguageSettingsGenericProvider" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider" name="CDT User Setting Entries" prefer-non-shared="true" store-entries-with-project="true">
+				<resource project-relative-path="">
+					<entry kind="includePath" name="${SGX_SDK}/include">
+						<flag value="LOCAL"/>
+					</entry>
+				</resource>
+			</provider>
+			<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" ref="shared-provider"/>
+		</extension>
+	</configuration>
+	<configuration id="com.intel.sgx.configuration.HW.Prerelease" name="Intel(R) SGX Hardware Prerelease">
+		<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
+			<provider class="org.eclipse.cdt.core.language.settings.providers.LanguageSettingsGenericProvider" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider" name="CDT User Setting Entries" prefer-non-shared="true" store-entries-with-project="true">
+				<resource project-relative-path="">
+					<entry kind="includePath" name="${SGX_SDK}/include">
+						<flag value="LOCAL"/>
+					</entry>
+				</resource>
+			</provider>
+			<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" ref="shared-provider"/>
+		</extension>
+	</configuration>
+	<configuration id="com.intel.sgx.configuration.HW.Release" name="Intel(R) SGX Hardware Release">
+		<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
+			<provider class="org.eclipse.cdt.core.language.settings.providers.LanguageSettingsGenericProvider" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider" name="CDT User Setting Entries" prefer-non-shared="true" store-entries-with-project="true">
+				<resource project-relative-path="">
+					<entry kind="includePath" name="${SGX_SDK}/include">
+						<flag value="LOCAL"/>
+					</entry>
+				</resource>
+			</provider>
+			<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" ref="shared-provider"/>
+		</extension>
+	</configuration>
+</project>

+ 4 - 4
SampleCode/SampleEnclave/App/Edger8rSyntax/Pointers.cpp

@@ -76,25 +76,25 @@ void edger8r_pointer_attributes(void)
     ret = ecall_pointer_string(global_eid, str1);
     if (ret != SGX_SUCCESS)
         abort();
-    assert(memcmp(str1, "0987654321", strlen(str1)) == 0);
+    assert(strlen(str1) == 10 && memcmp(str1, "0987654321", strlen(str1)) == 0);
 
     const char str2[] = "1234567890";
     ret = ecall_pointer_string_const(global_eid, str2);
     if (ret != SGX_SUCCESS)
         abort();
-    assert(memcmp(str2, "1234567890", strlen(str2)) == 0);
+    assert(strlen(str2) == 10 && memcmp(str2, "1234567890", strlen(str2)) == 0);
 
     char str3[] = "1234567890";
     ret = ecall_pointer_size(global_eid, (void*)str3, strlen(str3));
     if (ret != SGX_SUCCESS)
         abort();
-    assert(memcmp(str3, "0987654321", strlen(str3)) == 0);
+    assert(strlen(str3) == 10 && memcmp(str3, "0987654321", strlen(str3)) == 0);
 
     char str4[] = "1234567890";
     ret = ecall_pointer_isptr_readonly(global_eid, (buffer_t)str4, strlen(str4));
     if (ret != SGX_SUCCESS)
         abort();
-    assert(memcmp(str4, "1234567890", strlen(str4)) == 0);
+    assert(strlen(str4) == 10 && memcmp(str4, "1234567890", strlen(str4)) == 0);
 
     int arr[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
     ret = ecall_pointer_count(global_eid, arr, 10);

+ 1 - 1
SampleCode/SampleEnclave/Enclave/TrustedLibrary/Libc.cpp

@@ -31,7 +31,7 @@
 
 
 #include <string.h>
-#include <sgx_cpuid.h>
+#include "sgx_cpuid.h"
 
 #include "sgx_trts.h"
 #include "../Enclave.h"

+ 1 - 1
SampleCode/SampleEnclave/Enclave/TrustedLibrary/Thread.cpp

@@ -33,7 +33,7 @@
 #include "../Enclave.h"
 #include "Enclave_t.h"
 
-#include <sgx_thread.h>
+#include "sgx_thread.h"
 
 static size_t global_counter = 0;
 static sgx_thread_mutex_t global_mutex = SGX_THREAD_MUTEX_INITIALIZER;

+ 12 - 5
SampleCode/SampleEnclave/Makefile

@@ -116,10 +116,17 @@ endif
 Crypto_Library_Name := sgx_tcrypto
 
 Enclave_Cpp_Files := Enclave/Enclave.cpp $(wildcard Enclave/Edger8rSyntax/*.cpp) $(wildcard Enclave/TrustedLibrary/*.cpp)
-Enclave_Include_Paths := -IInclude -IEnclave -I$(SGX_SDK)/include -I$(SGX_SDK)/include/tlibc -I$(SGX_SDK)/include/stlport
+Enclave_Include_Paths := -IInclude -IEnclave -I$(SGX_SDK)/include -I$(SGX_SDK)/include/tlibc -I$(SGX_SDK)/include/libcxx
 
-Enclave_C_Flags := $(SGX_COMMON_CFLAGS) -nostdinc -fvisibility=hidden -fpie -fstack-protector $(Enclave_Include_Paths)
-Enclave_Cpp_Flags := $(Enclave_C_Flags) -std=c++03 -nostdinc++
+CC_BELOW_4_9 := $(shell expr "`$(CC) -dumpversion`" \< "4.9")
+ifeq ($(CC_BELOW_4_9), 1)
+	Enclave_C_Flags := $(SGX_COMMON_CFLAGS) -nostdinc -fvisibility=hidden -fpie -ffunction-sections -fdata-sections -fstack-protector
+else
+	Enclave_C_Flags := $(SGX_COMMON_CFLAGS) -nostdinc -fvisibility=hidden -fpie -ffunction-sections -fdata-sections -fstack-protector-strong
+endif
+
+Enclave_C_Flags += $(Enclave_Include_Paths)
+Enclave_Cpp_Flags := $(Enclave_C_Flags) -std=c++11 -nostdinc++
 
 # To generate a proper enclave, it is recommended to follow below guideline to link the trusted libraries:
 #    1. Link sgx_trts with the `--whole-archive' and `--no-whole-archive' options,
@@ -130,10 +137,10 @@ Enclave_Cpp_Flags := $(Enclave_C_Flags) -std=c++03 -nostdinc++
 # Otherwise, you may get some undesirable errors.
 Enclave_Link_Flags := $(SGX_COMMON_CFLAGS) -Wl,--no-undefined -nostdlib -nodefaultlibs -nostartfiles -L$(SGX_LIBRARY_PATH) \
 	-Wl,--whole-archive -l$(Trts_Library_Name) -Wl,--no-whole-archive \
-	-Wl,--start-group -lsgx_tstdc -lsgx_tstdcxx -l$(Crypto_Library_Name) -l$(Service_Library_Name) -Wl,--end-group \
+	-Wl,--start-group -lsgx_tstdc -lsgx_tcxx -l$(Crypto_Library_Name) -l$(Service_Library_Name) -Wl,--end-group \
 	-Wl,-Bstatic -Wl,-Bsymbolic -Wl,--no-undefined \
 	-Wl,-pie,-eenclave_entry -Wl,--export-dynamic  \
-	-Wl,--defsym,__ImageBase=0 \
+	-Wl,--defsym,__ImageBase=0 -Wl,--gc-sections   \
 	-Wl,--version-script=Enclave/Enclave.lds
 
 Enclave_Cpp_Objects := $(Enclave_Cpp_Files:.cpp=.o)

+ 1 - 1
SampleCode/SampleEnclave/README.txt

@@ -2,7 +2,7 @@
 Purpose of SampleEnclave
 ------------------------
 The project demonstrates several fundamental usages of Intel(R) Software Guard 
-Extensions (SGX) SDK:
+Extensions (Intel(R) SGX) SDK:
 - Initializing and destroying an enclave
 - Creating ECALLs or OCALLs
 - Calling trusted libraries inside the enclave

+ 67 - 70
SampleCode/SealedData/.cproject

@@ -2,7 +2,7 @@
 <?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
 	<storageModule moduleId="org.eclipse.cdt.core.settings">
 		<cconfiguration id="com.intel.sgx.configuration.Sim.Debug">
-			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.Sim.Debug" moduleId="org.eclipse.cdt.core.settings" name="SGX Debug Sim Mode">
+			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.Sim.Debug" moduleId="org.eclipse.cdt.core.settings" name="Intel(R) SGX Simulation Debug">
 				<externalSettings/>
 				<extensions>
 					<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
@@ -17,16 +17,16 @@
 				</extensions>
 			</storageModule>
 			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
-				<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.Sim.Debug" name="SGX Debug Sim Mode" parent="com.intel.sgx.configuration.Sim.Debug">
-					<folderInfo id="com.intel.sgx.configuration.Sim.Debug.292452237" name="/" resourcePath="">
-						<toolChain id="com.intel.sgx.toolChain.Sim.Debug.1618485184" name="SGX GCC" superClass="com.intel.sgx.toolChain.Sim.Debug">
-							<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.1039454044" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
-							<builder arguments="SGX_DEBUG=1 SGX_MODE=SIM -f Makefile" command="make" id="com.intel.sgx.builder2.1591862020" keepEnvironmentInBuildfile="false" name="Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder2"/>
-							<tool id="com.intel.sgx.compiler.1853780321" name="SGX GCC Compiler" superClass="com.intel.sgx.compiler">
-								<option id="com.intel.sgx.option.includePath.1427419865" superClass="com.intel.sgx.option.includePath" valueType="includePath">
-									<listOptionValue builtIn="false" value="/opt/intel/sgxsdk/include"/>
+				<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.Sim.Debug" name="Intel(R) SGX Simulation Debug" parent="com.intel.sgx.configuration.Sim.Debug">
+					<folderInfo id="com.intel.sgx.configuration.Sim.Debug.935873960" name="/" resourcePath="">
+						<toolChain id="com.intel.sgx.toolChain.Sim.Debug.2132595457" name="Intel(R) SGX" superClass="com.intel.sgx.toolChain.Sim.Debug">
+							<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.1678491512" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
+							<builder arguments="SGX_DEBUG=1 SGX_MODE=SIM -f Makefile" command="make" id="com.intel.sgx.builder2.229166714" keepEnvironmentInBuildfile="false" name="Intel(R) Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder2"/>
+							<tool id="com.intel.sgx.compiler.81269967" name="Intel(R) SGX" superClass="com.intel.sgx.compiler">
+								<option id="com.intel.sgx.option.includePath.1694375039" superClass="com.intel.sgx.option.includePath" valueType="includePath">
+									<listOptionValue builtIn="false" value="&quot;${SGX_SDK}/include&quot;"/>
 								</option>
-								<inputType id="com.intel.sgx.inputType.1817588305" superClass="com.intel.sgx.inputType"/>
+								<inputType id="com.intel.sgx.inputType.742388855" superClass="com.intel.sgx.inputType"/>
 							</tool>
 						</toolChain>
 					</folderInfo>
@@ -34,8 +34,8 @@
 			</storageModule>
 			<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
 		</cconfiguration>
-		<cconfiguration id="com.intel.sgx.configuration.HW.Debug">
-			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.HW.Debug" moduleId="org.eclipse.cdt.core.settings" name="SGX Debug HW Mode">
+		<cconfiguration id="com.intel.sgx.configuration.Sim.Release">
+			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.Sim.Release" moduleId="org.eclipse.cdt.core.settings" name="Intel(R) SGX Simulation">
 				<externalSettings/>
 				<extensions>
 					<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
@@ -50,16 +50,16 @@
 				</extensions>
 			</storageModule>
 			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
-				<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.HW.Debug" name="SGX Debug HW Mode" parent="com.intel.sgx.configuration.HW.Debug">
-					<folderInfo id="com.intel.sgx.configuration.HW.Debug.971320034" name="/" resourcePath="">
-						<toolChain id="com.intel.sgx.toolChain.HW.Debug.1761600540" name="SGX GCC" superClass="com.intel.sgx.toolChain.HW.Debug">
-							<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.131147161" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
-							<builder arguments="SGX_DEBUG=1 SGX_MODE=HW -f Makefile" command="make" id="com.intel.sgx.builder1.1502087524" keepEnvironmentInBuildfile="false" name="Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder1"/>
-							<tool id="com.intel.sgx.compiler.1085280084" name="SGX GCC Compiler" superClass="com.intel.sgx.compiler">
-								<option id="com.intel.sgx.option.includePath.57165741" superClass="com.intel.sgx.option.includePath" valueType="includePath">
-									<listOptionValue builtIn="false" value="/opt/intel/sgxsdk/include"/>
+				<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.Sim.Release" name="Intel(R) SGX Simulation" parent="com.intel.sgx.configuration.Sim.Release">
+					<folderInfo id="com.intel.sgx.configuration.Sim.Release.428839196" name="/" resourcePath="">
+						<toolChain id="com.intel.sgx.toolChain.Sim.Release.709775329" name="Intel(R) SGX" superClass="com.intel.sgx.toolChain.Sim.Release">
+							<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.1866379479" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
+							<builder arguments="SGX_DEBUG=0 SGX_MODE=SIM -f Makefile" command="make" id="com.intel.sgx.builder3.1000705250" keepEnvironmentInBuildfile="false" name="Intel(R) Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder3"/>
+							<tool id="com.intel.sgx.compiler.301453474" name="Intel(R) SGX" superClass="com.intel.sgx.compiler">
+								<option id="com.intel.sgx.option.includePath.1312096753" superClass="com.intel.sgx.option.includePath" valueType="includePath">
+									<listOptionValue builtIn="false" value="&quot;${SGX_SDK}/include&quot;"/>
 								</option>
-								<inputType id="com.intel.sgx.inputType.79844751" superClass="com.intel.sgx.inputType"/>
+								<inputType id="com.intel.sgx.inputType.596141238" superClass="com.intel.sgx.inputType"/>
 							</tool>
 						</toolChain>
 					</folderInfo>
@@ -67,8 +67,8 @@
 			</storageModule>
 			<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
 		</cconfiguration>
-		<cconfiguration id="com.intel.sgx.configuration.Sim.Release">
-			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.Sim.Release" moduleId="org.eclipse.cdt.core.settings" name="SGX Release Sim Mode">
+		<cconfiguration id="com.intel.sgx.configuration.HW.Debug">
+			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.HW.Debug" moduleId="org.eclipse.cdt.core.settings" name="Intel(R) SGX Hardware Debug">
 				<externalSettings/>
 				<extensions>
 					<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
@@ -83,16 +83,16 @@
 				</extensions>
 			</storageModule>
 			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
-				<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.Sim.Release" name="SGX Release Sim Mode" parent="com.intel.sgx.configuration.Sim.Release">
-					<folderInfo id="com.intel.sgx.configuration.Sim.Release.151408355" name="/" resourcePath="">
-						<toolChain id="com.intel.sgx.toolChain.Sim.Release.1055083183" name="SGX GCC" superClass="com.intel.sgx.toolChain.Sim.Release">
-							<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.471419902" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
-							<builder arguments="SGX_DEBUG=0 SGX_MODE=SIM -f Makefile" command="make" id="com.intel.sgx.builder3.1151273037" keepEnvironmentInBuildfile="false" name="Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder3"/>
-							<tool id="com.intel.sgx.compiler.1302347316" name="SGX GCC Compiler" superClass="com.intel.sgx.compiler">
-								<option id="com.intel.sgx.option.includePath.1645761127" superClass="com.intel.sgx.option.includePath" valueType="includePath">
-									<listOptionValue builtIn="false" value="/opt/intel/sgxsdk/include"/>
+				<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.HW.Debug" name="Intel(R) SGX Hardware Debug" parent="com.intel.sgx.configuration.HW.Debug">
+					<folderInfo id="com.intel.sgx.configuration.HW.Debug.562917509" name="/" resourcePath="">
+						<toolChain id="com.intel.sgx.toolChain.HW.Debug.2046051538" name="Intel(R) SGX" superClass="com.intel.sgx.toolChain.HW.Debug">
+							<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.999277922" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
+							<builder arguments="SGX_DEBUG=1 SGX_MODE=HW -f Makefile" command="make" id="com.intel.sgx.builder1.577701014" keepEnvironmentInBuildfile="false" name="Intel(R) Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder1"/>
+							<tool id="com.intel.sgx.compiler.1898704176" name="Intel(R) SGX" superClass="com.intel.sgx.compiler">
+								<option id="com.intel.sgx.option.includePath.1026657138" superClass="com.intel.sgx.option.includePath" valueType="includePath">
+									<listOptionValue builtIn="false" value="&quot;${SGX_SDK}/include&quot;"/>
 								</option>
-								<inputType id="com.intel.sgx.inputType.640775034" superClass="com.intel.sgx.inputType"/>
+								<inputType id="com.intel.sgx.inputType.393162412" superClass="com.intel.sgx.inputType"/>
 							</tool>
 						</toolChain>
 					</folderInfo>
@@ -101,7 +101,7 @@
 			<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
 		</cconfiguration>
 		<cconfiguration id="com.intel.sgx.configuration.HW.Prerelease">
-			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.HW.Prerelease" moduleId="org.eclipse.cdt.core.settings" name="SGX Pre-release Release HW Mode">
+			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.HW.Prerelease" moduleId="org.eclipse.cdt.core.settings" name="Intel(R) SGX Hardware Prerelease">
 				<externalSettings/>
 				<extensions>
 					<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
@@ -116,16 +116,16 @@
 				</extensions>
 			</storageModule>
 			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
-				<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.HW.Prerelease" name="SGX Pre-release Release HW Mode" parent="com.intel.sgx.configuration.HW.Prerelease">
-					<folderInfo id="com.intel.sgx.configuration.HW.Prerelease.1418650208" name="/" resourcePath="">
-						<toolChain id="com.intel.sgx.toolChain.HW.Prerelease.1668578385" name="SGX GCC" superClass="com.intel.sgx.toolChain.HW.Prerelease">
-							<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.977258758" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
-							<builder arguments="SGX_PRERELEASE=1 SGX_MODE=HW -f Makefile" command="make" id="com.intel.sgx.builder5.1888300852" keepEnvironmentInBuildfile="false" name="Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder5"/>
-							<tool id="com.intel.sgx.compiler.2113538546" name="SGX GCC Compiler" superClass="com.intel.sgx.compiler">
-								<option id="com.intel.sgx.option.includePath.904888562" superClass="com.intel.sgx.option.includePath" valueType="includePath">
-									<listOptionValue builtIn="false" value="/opt/intel/sgxsdk/include"/>
+				<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.HW.Prerelease" name="Intel(R) SGX Hardware Prerelease" parent="com.intel.sgx.configuration.HW.Prerelease">
+					<folderInfo id="com.intel.sgx.configuration.HW.Prerelease.2074448686" name="/" resourcePath="">
+						<toolChain id="com.intel.sgx.toolChain.HW.Prerelease.2016152654" name="Intel(R) SGX" superClass="com.intel.sgx.toolChain.HW.Prerelease">
+							<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.1520324017" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
+							<builder arguments="SGX_PRERELEASE=1 SGX_MODE=HW -f Makefile" command="make" id="com.intel.sgx.builder5.293910513" keepEnvironmentInBuildfile="false" name="Intel(R) Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder5"/>
+							<tool id="com.intel.sgx.compiler.845441552" name="Intel(R) SGX" superClass="com.intel.sgx.compiler">
+								<option id="com.intel.sgx.option.includePath.199398937" superClass="com.intel.sgx.option.includePath" valueType="includePath">
+									<listOptionValue builtIn="false" value="&quot;${SGX_SDK}/include&quot;"/>
 								</option>
-								<inputType id="com.intel.sgx.inputType.283498732" superClass="com.intel.sgx.inputType"/>
+								<inputType id="com.intel.sgx.inputType.1555926498" superClass="com.intel.sgx.inputType"/>
 							</tool>
 						</toolChain>
 					</folderInfo>
@@ -134,7 +134,7 @@
 			<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
 		</cconfiguration>
 		<cconfiguration id="com.intel.sgx.configuration.HW.Release">
-			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.HW.Release" moduleId="org.eclipse.cdt.core.settings" name="SGX Release HW Mode">
+			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.HW.Release" moduleId="org.eclipse.cdt.core.settings" name="Intel(R) SGX Hardware Release">
 				<externalSettings/>
 				<extensions>
 					<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
@@ -149,16 +149,16 @@
 				</extensions>
 			</storageModule>
 			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
-				<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.HW.Release" name="SGX Release HW Mode" parent="com.intel.sgx.configuration.HW.Release">
-					<folderInfo id="com.intel.sgx.configuration.HW.Release.1657582763" name="/" resourcePath="">
-						<toolChain id="com.intel.sgx.toolChain.HW.Release.465410401" name="SGX GCC" superClass="com.intel.sgx.toolChain.HW.Release">
-							<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.828352216" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
-							<builder arguments="SGX_DEBUG=0 SGX_MODE=HW -f Makefile" command="make" id="com.intel.sgx.builder6.714105790" keepEnvironmentInBuildfile="false" name="Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder6"/>
-							<tool id="com.intel.sgx.compiler.595797282" name="SGX GCC Compiler" superClass="com.intel.sgx.compiler">
-								<option id="com.intel.sgx.option.includePath.1385078253" superClass="com.intel.sgx.option.includePath" valueType="includePath">
-									<listOptionValue builtIn="false" value="/opt/intel/sgxsdk/include"/>
+				<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.HW.Release" name="Intel(R) SGX Hardware Release" parent="com.intel.sgx.configuration.HW.Release">
+					<folderInfo id="com.intel.sgx.configuration.HW.Release.1347223665" name="/" resourcePath="">
+						<toolChain id="com.intel.sgx.toolChain.HW.Release.1050674831" name="Intel(R) SGX" superClass="com.intel.sgx.toolChain.HW.Release">
+							<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.987781695" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
+							<builder arguments="SGX_DEBUG=0 SGX_MODE=HW -f Makefile" command="make" id="com.intel.sgx.builder6.484951388" keepEnvironmentInBuildfile="false" name="Intel(R) Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder6"/>
+							<tool id="com.intel.sgx.compiler.945246695" name="Intel(R) SGX" superClass="com.intel.sgx.compiler">
+								<option id="com.intel.sgx.option.includePath.119487102" superClass="com.intel.sgx.option.includePath" valueType="includePath">
+									<listOptionValue builtIn="false" value="&quot;${SGX_SDK}/include&quot;"/>
 								</option>
-								<inputType id="com.intel.sgx.inputType.463677873" superClass="com.intel.sgx.inputType"/>
+								<inputType id="com.intel.sgx.inputType.593431891" superClass="com.intel.sgx.inputType"/>
 							</tool>
 						</toolChain>
 					</folderInfo>
@@ -168,50 +168,47 @@
 		</cconfiguration>
 	</storageModule>
 	<storageModule moduleId="cdtBuildSystem" version="4.0.0">
-		<project id="SealedData.null.1312290154" name="SealedData"/>
+		<project id="SealedData.cdt.managedbuild.target.gnu.exe.872917958" name="Executable" projectType="cdt.managedbuild.target.gnu.exe"/>
 	</storageModule>
 	<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
 	<storageModule moduleId="refreshScope" versionNumber="2">
-		<configuration configurationName="SGX Debug HW Mode">
+		<configuration configurationName="Intel(R) SGX Hardware Debug">
 			<resource resourceType="PROJECT" workspacePath="/SealedData"/>
 		</configuration>
-		<configuration configurationName="SGX Debug Sim Mode">
+		<configuration configurationName="Intel(R) SGX Simulation Debug">
 			<resource resourceType="PROJECT" workspacePath="/SealedData"/>
 		</configuration>
-		<configuration configurationName="Debug">
+		<configuration configurationName="Intel(R) SGX Hardware Prerelease">
 			<resource resourceType="PROJECT" workspacePath="/SealedData"/>
 		</configuration>
-		<configuration configurationName="Release">
+		<configuration configurationName="Intel(R) SGX Simulation">
 			<resource resourceType="PROJECT" workspacePath="/SealedData"/>
 		</configuration>
-		<configuration configurationName="SGX Release HW Mode">
+		<configuration configurationName="Intel(R) SGX Hardware Release">
 			<resource resourceType="PROJECT" workspacePath="/SealedData"/>
 		</configuration>
 	</storageModule>
 	<storageModule moduleId="scannerConfiguration">
 		<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
-		<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.release.680828348;cdt.managedbuild.config.gnu.exe.release.680828348.;cdt.managedbuild.tool.gnu.c.compiler.exe.release.2137539087;cdt.managedbuild.tool.gnu.c.compiler.input.762444756">
-			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+		<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.HW.Release;com.intel.sgx.configuration.HW.Release.1347223665;com.intel.sgx.compiler.945246695;com.intel.sgx.inputType.593431891">
+			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.intel.sgx.SGXPerProjectProfile"/>
 		</scannerConfigBuildInfo>
-		<scannerConfigBuildInfo instanceId="com.intel.sgx.SGXtoolChain.977521771;com.intel.sgx.SGXtoolChain.977521771.100429378;com.intel.sgx.compiler.787445976;com.intel.sgx.inputType.1814458059">
+		<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.Sim.Debug;com.intel.sgx.configuration.Sim.Debug.935873960;com.intel.sgx.compiler.81269967;com.intel.sgx.inputType.742388855">
 			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.intel.sgx.SGXPerProjectProfile"/>
 		</scannerConfigBuildInfo>
-		<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.Sim.Release;com.intel.sgx.configuration.Sim.Release.151408355;com.intel.sgx.compiler.1302347316;com.intel.sgx.inputType.640775034">
+		<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.Sim.Release;com.intel.sgx.configuration.Sim.Release.428839196;com.intel.sgx.compiler.301453474;com.intel.sgx.inputType.596141238">
 			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.intel.sgx.SGXPerProjectProfile"/>
 		</scannerConfigBuildInfo>
-		<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.debug.1377487595;cdt.managedbuild.config.gnu.exe.debug.1377487595.;cdt.managedbuild.tool.gnu.c.compiler.exe.debug.1972419354;cdt.managedbuild.tool.gnu.c.compiler.input.1480710981">
+		<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.debug.1609650460;cdt.managedbuild.config.gnu.exe.debug.1609650460.;cdt.managedbuild.tool.gnu.c.compiler.exe.debug.1644119147;cdt.managedbuild.tool.gnu.c.compiler.input.938348551">
 			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
 		</scannerConfigBuildInfo>
-		<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.HW.Release;com.intel.sgx.configuration.HW.Release.1657582763;com.intel.sgx.compiler.595797282;com.intel.sgx.inputType.463677873">
-			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.intel.sgx.SGXPerProjectProfile"/>
-		</scannerConfigBuildInfo>
-		<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.Sim.Debug;com.intel.sgx.configuration.Sim.Debug.292452237;com.intel.sgx.compiler.1853780321;com.intel.sgx.inputType.1817588305">
-			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.intel.sgx.SGXPerProjectProfile"/>
+		<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.release.1394873887;cdt.managedbuild.config.gnu.exe.release.1394873887.;cdt.managedbuild.tool.gnu.c.compiler.exe.release.2035356548;cdt.managedbuild.tool.gnu.c.compiler.input.793813290">
+			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
 		</scannerConfigBuildInfo>
-		<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.HW.Debug;com.intel.sgx.configuration.HW.Debug.971320034;com.intel.sgx.compiler.1085280084;com.intel.sgx.inputType.79844751">
+		<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.HW.Debug;com.intel.sgx.configuration.HW.Debug.562917509;com.intel.sgx.compiler.1898704176;com.intel.sgx.inputType.393162412">
 			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.intel.sgx.SGXPerProjectProfile"/>
 		</scannerConfigBuildInfo>
-		<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.HW.Prerelease;com.intel.sgx.configuration.HW.Prerelease.1418650208;com.intel.sgx.compiler.2113538546;com.intel.sgx.inputType.283498732">
+		<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.HW.Prerelease;com.intel.sgx.configuration.HW.Prerelease.2074448686;com.intel.sgx.compiler.845441552;com.intel.sgx.inputType.1555926498">
 			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.intel.sgx.SGXPerProjectProfile"/>
 		</scannerConfigBuildInfo>
 	</storageModule>

+ 73 - 0
SampleCode/SealedData/.settings/language.settings.xml

@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<project>
+	<configuration id="com.intel.sgx.configuration.Sim.Debug" name="Intel(R) SGX Simulation Debug">
+		<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
+			<provider class="org.eclipse.cdt.core.language.settings.providers.LanguageSettingsGenericProvider" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider" name="CDT User Setting Entries" prefer-non-shared="true" store-entries-with-project="true">
+				<resource project-relative-path="">
+					<entry kind="includePath" name="${SGX_SDK}/include">
+						<flag value="LOCAL"/>
+					</entry>
+				</resource>
+			</provider>
+			<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" ref="shared-provider"/>
+		</extension>
+	</configuration>
+	<configuration id="com.intel.sgx.configuration.Sim.Release" name="Intel(R) SGX Simulation">
+		<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
+			<provider class="org.eclipse.cdt.core.language.settings.providers.LanguageSettingsGenericProvider" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider" name="CDT User Setting Entries" prefer-non-shared="true" store-entries-with-project="true">
+				<resource project-relative-path="">
+					<entry kind="includePath" name="${SGX_SDK}/include">
+						<flag value="LOCAL"/>
+					</entry>
+				</resource>
+			</provider>
+			<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" ref="shared-provider"/>
+		</extension>
+	</configuration>
+	<configuration id="com.intel.sgx.configuration.HW.Debug" name="Intel(R) SGX Hardware Debug">
+		<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
+			<provider class="org.eclipse.cdt.core.language.settings.providers.LanguageSettingsGenericProvider" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider" name="CDT User Setting Entries" prefer-non-shared="true" store-entries-with-project="true">
+				<resource project-relative-path="">
+					<entry kind="includePath" name="${SGX_SDK}/include">
+						<flag value="LOCAL"/>
+					</entry>
+				</resource>
+			</provider>
+			<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" ref="shared-provider"/>
+		</extension>
+	</configuration>
+	<configuration id="com.intel.sgx.configuration.HW.Prerelease" name="Intel(R) SGX Hardware Prerelease">
+		<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
+			<provider class="org.eclipse.cdt.core.language.settings.providers.LanguageSettingsGenericProvider" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider" name="CDT User Setting Entries" prefer-non-shared="true" store-entries-with-project="true">
+				<resource project-relative-path="">
+					<entry kind="includePath" name="${SGX_SDK}/include">
+						<flag value="LOCAL"/>
+					</entry>
+				</resource>
+			</provider>
+			<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" ref="shared-provider"/>
+		</extension>
+	</configuration>
+	<configuration id="com.intel.sgx.configuration.HW.Release" name="Intel(R) SGX Hardware Release">
+		<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
+			<provider class="org.eclipse.cdt.core.language.settings.providers.LanguageSettingsGenericProvider" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider" name="CDT User Setting Entries" prefer-non-shared="true" store-entries-with-project="true">
+				<resource project-relative-path="">
+					<entry kind="includePath" name="${SGX_SDK}/include">
+						<flag value="LOCAL"/>
+					</entry>
+				</resource>
+			</provider>
+			<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
+			<provider-reference id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" ref="shared-provider"/>
+		</extension>
+	</configuration>
+</project>

+ 11 - 5
SampleCode/SealedData/Makefile

@@ -116,10 +116,16 @@ endif
 Crypto_Library_Name := sgx_tcrypto
 
 Enclave_Cpp_Files := DRM_enclave/DRM_enclave.cpp
-Enclave_Include_Paths := -I$(SGX_SDK)/include -I$(SGX_SDK)/include/tlibc -I$(SGX_SDK)/include/stlport
+Enclave_Include_Paths := -I$(SGX_SDK)/include -I$(SGX_SDK)/include/tlibc -I$(SGX_SDK)/include/libcxx
 
-Enclave_C_Flags := $(SGX_COMMON_CFLAGS) -nostdinc -fvisibility=hidden -fpie -fstack-protector $(Enclave_Include_Paths)
-Enclave_Cpp_Flags := $(Enclave_C_Flags) -std=c++03 -nostdinc++
+CC_BELOW_4_9 := $(shell expr "`$(CC) -dumpversion`" \< "4.9")
+ifeq ($(CC_BELOW_4_9), 1)
+	Enclave_C_Flags := $(SGX_COMMON_CFLAGS) -nostdinc -fvisibility=hidden -fpie -ffunction-sections -fdata-sections -fstack-protector
+else
+	Enclave_C_Flags := $(SGX_COMMON_CFLAGS) -nostdinc -fvisibility=hidden -fpie -ffunction-sections -fdata-sections -fstack-protector-strong
+endif
+Enclave_C_Flags += $(Enclave_Include_Paths)
+Enclave_Cpp_Flags := $(Enclave_C_Flags) -std=c++11 -nostdinc++
 
 # To generate a proper enclave, it is recommended to follow below guideline to link the trusted libraries:
 #    1. Link sgx_trts with the `--whole-archive' and `--no-whole-archive' options,
@@ -130,10 +136,10 @@ Enclave_Cpp_Flags := $(Enclave_C_Flags) -std=c++03 -nostdinc++
 # Otherwise, you may get some undesirable errors.
 Enclave_Link_Flags := $(SGX_COMMON_CFLAGS) -Wl,--no-undefined -nostdlib -nodefaultlibs -nostartfiles -L$(SGX_LIBRARY_PATH) \
 	-Wl,--whole-archive -l$(Trts_Library_Name) -Wl,--no-whole-archive \
-	-Wl,--start-group -lsgx_tstdc -lsgx_tstdcxx -l$(Crypto_Library_Name) -l$(Service_Library_Name) -Wl,--end-group \
+	-Wl,--start-group -lsgx_tstdc -lsgx_tcxx -l$(Crypto_Library_Name) -l$(Service_Library_Name) -Wl,--end-group \
 	-Wl,-Bstatic -Wl,-Bsymbolic -Wl,--no-undefined \
 	-Wl,-pie,-eenclave_entry -Wl,--export-dynamic  \
-	-Wl,--defsym,__ImageBase=0 \
+	-Wl,--defsym,__ImageBase=0 -Wl,--gc-sections   \
 	-Wl,--version-script=DRM_enclave/DRM_enclave.lds 
 
 Enclave_Cpp_Objects := $(Enclave_Cpp_Files:.cpp=.o)

+ 1 - 1
SampleCode/SealedData/README.txt

@@ -10,7 +10,7 @@ replay-protected policy, and Trusted Time to enforce time based policy
 ------------------------------------
 How to Build/Execute the Sample Code
 ------------------------------------
-1. Install Intel(R) SGX SDK for Linux* OS
+1. Install Intel(R) Software Guard Extensions (Intel(R) SGX) SDK for Linux* OS
 2. Build the project with the prepared Makefile:
     a. Hardware Mode, Debug build:
         $ make

+ 8 - 1
buildenv.mk

@@ -67,7 +67,12 @@ INCLUDE :=
 CUR_DIR := $(realpath $(call parent-dir,$(lastword $(wordlist 2,$(words $(MAKEFILE_LIST)),x $(MAKEFILE_LIST)))))
 
 # turn on stack protector for SDK
-COMMON_FLAGS += -fstack-protector
+CC_BELOW_4_9 := $(shell expr "`$(CC) -dumpversion`" \< "4.9")
+ifeq ($(CC_BELOW_4_9), 1)
+    COMMON_FLAGS += -fstack-protector
+else
+    COMMON_FLAGS += -fstack-protector-strong
+endif
 
 ifdef DEBUG
     COMMON_FLAGS += -ggdb -DDEBUG -UNDEBUG
@@ -80,6 +85,8 @@ ifdef SE_SIM
     COMMON_FLAGS += -DSE_SIM
 endif
 
+COMMON_FLAGS += -ffunction-sections -fdata-sections
+
 # turn on compiler warnings as much as possible
 COMMON_FLAGS += -Wall -Wextra -Winit-self -Wpointer-arith -Wreturn-type \
 		-Waddress -Wsequence-point -Wformat-security \

+ 4 - 1
common/inc/internal/metadata.h

@@ -38,7 +38,10 @@
 
  /* version of metadata */
 #define MAJOR_VERSION 1         /* MAJOR_VERSION should not larger than 0ffffffff */
-#define MINOR_VERSION 3         /* MINOR_VERSION should not larger than 0ffffffff */
+#define MINOR_VERSION 4         /* MINOR_VERSION should not larger than 0ffffffff */
+
+#define SGX_1_5_MAJOR_VERSION 1         //MAJOR_VERSION should not larger than 0ffffffff
+#define SGX_1_5_MINOR_VERSION 3         //MINOR_VERSION should not larger than 0ffffffff
 
 #define META_DATA_MAKE_VERSION(major, minor) (((uint64_t)major)<<32 | minor)
 

+ 1 - 1
common/inc/internal/routine.h

@@ -52,4 +52,4 @@ sgx_status_t SGXAPI sgx_ecall(const sgx_enclave_id_t enclave_id, const int proc,
 }
 #endif
 
-#endif
+#endif

+ 5 - 4
common/inc/internal/se_cdefs.h

@@ -93,10 +93,11 @@
 #endif
 
 #define SGX_ACCESS_VERSION(libname, num)                    \
-    MY_EXTERN const char *sgx_##libname##_version;          \
-    const char * __attribute__((destructor)) libname##_access_version_dummy##num()      \
-    {                                                       \
-        return sgx_##libname##_version;                     \
+    MY_EXTERN char sgx_##libname##_version[];          \
+    MY_EXTERN char * __attribute__((destructor)) libname##_access_version_dummy##num()      \
+    {                                                                                       \
+        sgx_##libname##_version[0] = 's';                                                   \
+        return sgx_##libname##_version;                                                     \
     } 
 
 

+ 1 - 1
common/inc/internal/se_macro.h

@@ -37,4 +37,4 @@
 #define SGX_HYPERV_ECO
 #endif
  
- #endif
+ #endif

+ 1 - 1
common/inc/internal/se_version.h

@@ -28,5 +28,5 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
  */
-#define STRFILEVER      "1.8.100.37739"
+#define STRFILEVER      "1.9.100.39124"
 

+ 5 - 5
common/inc/sgx_attributes.h

@@ -39,14 +39,14 @@
 #define SGX_FLAGS_DEBUG          0x0000000000000002ULL     /* If set, then the enclave is debug */
 #define SGX_FLAGS_MODE64BIT      0x0000000000000004ULL     /* If set, then the enclave is 64 bit */
 #define SGX_FLAGS_PROVISION_KEY  0x0000000000000010ULL     /* If set, then the enclave has access to provision key */
-#define SGX_FLAGS_EINITTOKEN_KEY  0x0000000000000020ULL     /* If set, then the enclave has access to EINITTOKEN key */
+#define SGX_FLAGS_EINITTOKEN_KEY 0x0000000000000020ULL     /* If set, then the enclave has access to EINITTOKEN key */
 #define SGX_FLAGS_RESERVED       (~(SGX_FLAGS_INITTED | SGX_FLAGS_DEBUG | SGX_FLAGS_MODE64BIT | SGX_FLAGS_PROVISION_KEY | SGX_FLAGS_EINITTOKEN_KEY))
 
 /* XSAVE Feature Request Mask */
-#define SGX_XFRM_LEGACY          0x0000000000000003ULL     /* Legacy XFRM */
-#define SGX_XFRM_AVX             0x0000000000000006ULL     /* AVX */
-#define SGX_XFRM_AVX512          0x00000000000000E6ULL     /* AVX-512 - not supported */
-#define SGX_XFRM_MPX             0x0000000000000018ULL     /* MPX - not supported */
+#define SGX_XFRM_LEGACY          0x0000000000000003ULL     /* Legacy XFRM which includes the basic feature bits required by SGX, x87 state(0x01) and SSE state(0x02) */
+#define SGX_XFRM_AVX             0x0000000000000006ULL     /* AVX XFRM which includes AVX state(0x04) and SSE state(0x02) required by AVX */
+#define SGX_XFRM_AVX512          0x00000000000000E6ULL     /* AVX-512 XFRM - not supported */
+#define SGX_XFRM_MPX             0x0000000000000018ULL     /* MPX XFRM - not supported */
 
 #define SGX_XFRM_RESERVED        (~(SGX_XFRM_LEGACY | SGX_XFRM_AVX))
 

+ 2 - 0
common/inc/sgx_defs.h

@@ -48,6 +48,8 @@
 # define SGX_DLLIMPORT
 # define SGX_UBRIDGE(attr, fname, args...) attr fname args
 
+# define SGX_DEPRECATED __attribute__((deprecated))
+
 
 #define SGX_NOCONVENTION /* Empty.  No calling convention specified. */
 

+ 2 - 2
common/inc/sgx_error.h

@@ -72,8 +72,8 @@ typedef enum _status_t
     SGX_ERROR_INVALID_ISVSVN     = SGX_MK_ERROR(0x3004),      /* The isv svn is greater than the enclave's isv svn */
     SGX_ERROR_INVALID_KEYNAME    = SGX_MK_ERROR(0x3005),      /* The key name is an unsupported value */
 
-    SGX_ERROR_SERVICE_UNAVAILABLE       = SGX_MK_ERROR(0x4001),   /* Indicates aesm didn't response or the requested service is not supported */
-    SGX_ERROR_SERVICE_TIMEOUT           = SGX_MK_ERROR(0x4002),   /* The request to aesm time out */
+    SGX_ERROR_SERVICE_UNAVAILABLE       = SGX_MK_ERROR(0x4001),   /* Indicates aesm didn't respond or the requested service is not supported */
+    SGX_ERROR_SERVICE_TIMEOUT           = SGX_MK_ERROR(0x4002),   /* The request to aesm timed out */
     SGX_ERROR_AE_INVALID_EPIDBLOB       = SGX_MK_ERROR(0x4003),   /* Indicates epid blob verification error */
     SGX_ERROR_SERVICE_INVALID_PRIVILEGE = SGX_MK_ERROR(0x4004),   /* Enclave has no privilege to get launch token */
     SGX_ERROR_EPID_MEMBER_REVOKED       = SGX_MK_ERROR(0x4005),   /* The EPID group membership is revoked. */

+ 1 - 1
common/inc/sgx_report.h

@@ -63,7 +63,7 @@ typedef uint16_t            sgx_prod_id_t;
 #define SGX_TARGET_INFO_RESERVED1_BYTES 4
 #define SGX_TARGET_INFO_RESERVED2_BYTES 456
 
-typedef struct _targe_info_t
+typedef struct _target_info_t
 {
     sgx_measurement_t       mr_enclave;     /* (  0) The MRENCLAVE of the target enclave */
     sgx_attributes_t        attributes;     /* ( 32) The ATTRIBUTES field of the target enclave */

+ 73 - 6
common/inc/sgx_tcrypto.h

@@ -52,6 +52,9 @@
 #define SGX_CMAC_KEY_SIZE               16
 #define SGX_CMAC_MAC_SIZE               16
 #define SGX_AESCTR_KEY_SIZE             16
+#define SGX_RSA3072_KEY_SIZE            384
+#define SGX_RSA3072_PRI_EXP_SIZE        384
+#define SGX_RSA3072_PUB_EXP_SIZE        4
 
 typedef struct _sgx_ec256_dh_shared_t
 {
@@ -81,6 +84,20 @@ typedef struct _sgx_ec256_signature_t
     uint32_t y[SGX_NISTP_ECP256_KEY_SIZE];
 } sgx_ec256_signature_t;
 
+typedef struct _sgx_rsa3072_public_key_t
+{
+    uint8_t mod[SGX_RSA3072_KEY_SIZE];
+    uint8_t exp[SGX_RSA3072_PUB_EXP_SIZE];
+} sgx_rsa3072_public_key_t;
+
+typedef struct _sgx_rsa3072_private_key_t
+{
+    uint8_t mod[SGX_RSA3072_KEY_SIZE];
+    uint8_t exp[SGX_RSA3072_PRI_EXP_SIZE];
+} sgx_rsa3072_private_key_t;
+
+typedef uint8_t sgx_rsa3072_signature_t[SGX_RSA3072_KEY_SIZE];
+
 typedef void* sgx_sha_state_handle_t;
 typedef void* sgx_cmac_state_handle_t;
 typedef void* sgx_ecc_state_handle_t;
@@ -120,6 +137,12 @@ typedef enum {
 } sgx_generic_ecresult_t;
 
 
+typedef enum {
+	SGX_RSA_VALID,               /* validation pass successfully     */
+
+	SGX_RSA_INVALID_SIGNATURE    /* invalid signature */
+} sgx_rsa_result_t;
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -437,7 +460,7 @@ extern "C" {
     * The private key p_private is a number that lies in the range of [1, n-1] where n is
     * the order of the elliptic curve base point.
     *
-    * The public key p_public is an elliptic curve point such that p_public = p_private ?G,
+    * The public key p_public is an elliptic curve point such that p_public = p_private *G,
     * where G is the base point of the elliptic curve.
     *
     * The context of the point p_public as an elliptic curve point must be created by using
@@ -483,19 +506,19 @@ extern "C" {
     *
     * According to the scheme, Alice and Bob perform the following operations:
     * 1. Alice calculates her own public key pubKeyA by using her private key
-    *    privKeyA: pubKeyA = privKeyA ?G, where G is the base point of the elliptic curve.
+    *    privKeyA: pubKeyA = privKeyA *G, where G is the base point of the elliptic curve.
     * 2. Alice passes the public key to Bob.
     * 3. Bob calculates his own public key pubKeyB by using his private key
-    *    privKeyB: pubKeyB = privKeyB ?G, where G is a base point of the elliptic curve.
+    *    privKeyB: pubKeyB = privKeyB *G, where G is a base point of the elliptic curve.
     * 4. Bob passes the public key to Alice.
     * 5. Alice gets Bob's public key and calculates the secret point shareA. When calculating,
     *    she uses her own private key and Bob's public key and applies the following formula:
-    *    shareA = privKeyA ?pubKeyB = privKeyA ?privKeyB ?G.
+    *    shareA = privKeyA *pubKeyB = privKeyA *privKeyB *G.
     * 6. Bob gets Alice's public key and calculates the secret point shareB. When calculating,
     *    he uses his own private key and Alice's public key and applies the following formula:
-    *    shareB = privKeyB ?pubKeyA = privKeyB ?privKeyA ?G.
+    *    shareB = privKeyB *pubKeyA = privKeyB *privKeyA *G.
     *
-    * Because the following equation is true privKeyA ?privKeyB ?G = privKeyB ?privKeyA ?G,
+    * Because the following equation is true privKeyA *privKeyB *G = privKeyB *privKeyA *G,
     * the result of both calculations is the same, that is, the equation shareA = shareB is true.
     * The secret point serves as a secret key.
     *
@@ -600,6 +623,50 @@ extern "C" {
                                         uint8_t *p_result,
                                         sgx_ecc_state_handle_t ecc_handle);
 
+    /** Computes signature for a given data based on RSA 3072 private key
+    *
+    * A digital signature over a message consists of a 3072 bit number.
+    *
+    * Return: If private key, signature or data pointer is NULL,
+    *                    SGX_ERROR_INVALID_PARAMETER is returned.
+    *         If the signing process fails then SGX_ERROR_UNEXPECTED is returned.
+    * Parameters:
+    *   Return: sgx_status_t  - SGX_SUCCESS or failure as defined in sgx_error.h
+    *   Inputs: uint8_t *p_data - Pointer to the data to be signed
+    *           uint32_t data_size - Size of the data to be signed
+    *           sgx_rsa3072_private_key_t *p_private - Pointer to the private key
+    *   Output: sgx_rsa3072_signature_t *p_signature - Pointer to the signature output
+    */
+    sgx_status_t sgx_rsa3072_sign(const uint8_t *p_data,
+        uint32_t data_size,
+        const sgx_rsa3072_private_key_t *p_private,
+        sgx_rsa3072_signature_t *p_signature);
+
+    /** Verifies the signature for the given data based on the RSA 3072 public key.
+    *
+    * A digital signature over a message consists of a 3072 bit number.
+    *
+    * The typical result of the digital signature verification is one of the two values:
+    *     SGX_Generic_ECValid - Digital signature is valid
+    *     SGX_Generic_ECInvalidSignature -  Digital signature is not valid
+    *
+    * Return: If public key, signature, result or data pointer is NULL,
+    *                    SGX_ERROR_INVALID_PARAMETER is returned.
+    *         If the verification process fails then SGX_ERROR_UNEXPECTED is returned.
+    * Parameters:
+    *   Return: sgx_status_t  - SGX_SUCCESS or failure as defined in sgx_error.h
+    *   Inputs: uint8_t *p_data - Pointer to the data to be verified
+    *           uint32_t data_size - Size of the data to be verified
+    *           sgx_rsa3072_public_key_t *p_public - Pointer to the public key
+    *           sgx_rsa3072_signature_t *p_signature - Pointer to the signature
+    *   Output: sgx_rsa_result_t *p_result - Pointer to the result of verification check
+    */
+    sgx_status_t sgx_rsa3072_verify(const uint8_t *p_data,
+        uint32_t data_size,
+        const sgx_rsa3072_public_key_t *p_public,
+        const sgx_rsa3072_signature_t *p_signature,
+		sgx_rsa_result_t *p_result);
+
 #ifdef __cplusplus
 }
 #endif

+ 5 - 5
common/inc/sgx_thread.h

@@ -38,14 +38,14 @@
 
 typedef uintptr_t sgx_thread_t;
 
-typedef struct sgx_thread_queue
+typedef struct _sgx_thread_queue_t
 {
     sgx_thread_t        m_first;  /* first element */
     sgx_thread_t        m_last;   /* last element */
 } sgx_thread_queue_t;
 
 /* Mutex */
-typedef struct sgx_thread_mutex
+typedef struct _sgx_thread_mutex_t
 {
     size_t              m_refcount;
     uint32_t            m_control;
@@ -65,13 +65,13 @@ typedef struct sgx_thread_mutex
 #define SGX_THREAD_MUTEX_INITIALIZER \
             SGX_THREAD_NONRECURSIVE_MUTEX_INITIALIZER
 
-typedef struct sgx_thread_mutex_attr
+typedef struct _sgx_thread_mutex_attr_t
 {
     unsigned char       m_dummy;  /* for C syntax check */
 } sgx_thread_mutexattr_t;
 
 /* Condition Variable */
-typedef struct sgx_thread_cond
+typedef struct _sgx_thread_cond_t
 {
     volatile uint32_t   m_lock;   /* use sgx_spinlock_t */
     sgx_thread_queue_t  m_queue;
@@ -79,7 +79,7 @@ typedef struct sgx_thread_cond
 
 #define SGX_THREAD_COND_INITIALIZER  {0, {SGX_THREAD_T_NULL, SGX_THREAD_T_NULL}}
 
-typedef struct sgx_thread_cond_attr
+typedef struct _sgx_thread_cond_attr_t
 {
     unsigned char       m_dummy;  /* for C syntax check */
 } sgx_thread_condattr_t;

+ 1 - 1
common/inc/sgx_tkey_exchange.h

@@ -121,7 +121,7 @@ typedef sgx_status_t(*sgx_ra_derive_secret_keys_t)(
  *                      shared keys (SMK, SK, MK and VK).
  * @param p_context The output context for the subsequent remote attestation
  *                  and key exchange process, to be used in sgx_ra_get_msg1 and
- *                  sgx_ra_get_msg2.
+ *                  sgx_ra_proc_msg2.
  * @return sgx_status_t SGX_SUCCESS                     Indicates success.
  *                      SGX_ERROR_INVALID_PARAMETER     Indicates an error that
  *                                                      the input parameters are

+ 49 - 0
common/inc/sgx_tprotected_fs.edl

@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2011-2017 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in
+ *     the documentation and/or other materials provided with the
+ *     distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+enclave {
+
+from "sgx_tae_service.edl" import *;
+
+    untrusted {
+		void*   u_sgxprotectedfs_exclusive_file_open([in, string] const char* filename, uint8_t read_only, [out] int64_t* file_size, [out] int32_t* error_code);
+		uint8_t u_sgxprotectedfs_check_if_file_exists([in, string] const char* filename);
+		int32_t u_sgxprotectedfs_fread_node([user_check] void* f, uint64_t node_number, [out, size=node_size] uint8_t* buffer, uint32_t node_size);
+		int32_t u_sgxprotectedfs_fwrite_node([user_check] void* f, uint64_t node_number, [in, size=node_size] uint8_t* buffer, uint32_t node_size);
+		int32_t u_sgxprotectedfs_fclose([user_check] void* f);
+		uint8_t u_sgxprotectedfs_fflush([user_check] void* f);
+		int32_t u_sgxprotectedfs_remove([in, string] const char* filename);
+
+		void*   u_sgxprotectedfs_recovery_file_open([in, string] const char* filename);
+		uint8_t u_sgxprotectedfs_fwrite_recovery_node([user_check] void* f, [in, count=data_length] uint8_t* data, uint32_t data_length);
+		int32_t u_sgxprotectedfs_do_file_recovery([in, string] const char* filename, [in, string] const char* recovery_filename, uint32_t node_size);
+    };
+};

+ 276 - 0
common/inc/sgx_tprotected_fs.h

@@ -0,0 +1,276 @@
+/*
+ * Copyright (C) 2011-2017 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in
+ *     the documentation and/or other materials provided with the
+ *     distribution.
+ *   * Neither the name of Intel Corporation nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+
+/**
+* File: sgx_tprotected_fs.h
+* Description:
+*     Interface for file API
+*/
+
+#pragma once
+
+#ifndef _SGX_TPROTECTED_FS_H_
+#define _SGX_TPROTECTED_FS_H_
+
+#include <stddef.h>
+
+#include "sgx_defs.h"
+#include "sgx_key.h"
+
+#define SGX_FILE void
+
+#define EOF        (-1)
+
+#define SEEK_SET    0
+#define SEEK_CUR    1
+#define SEEK_END    2
+
+#define FILENAME_MAX  260
+#define FOPEN_MAX     20
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* sgx_fopen
+ *  Purpose: open existing protected file (created with previous call to sgc_fopen) or create a new one (see c++ fopen documentation for more details).
+ *
+ *  Parameters:
+ *      filename - [IN] the name of the file to open/create.
+ *      mode - [IN] open mode. only supports 'r' or 'w' or 'a' (one and only one of them must be present), and optionally 'b' and/or '+'.
+ *      key - [IN] encryption key that will be used for the file encryption
+ *      NOTE - the key is actually used as a KDK (key derivation key) and only for the meta-data node, and not used directly for the encryption of any part of the file
+ *             this is important in order to prevent hitting the key wear-out problem, and some other issues with GCM encryptions using the same key
+ *
+ *  Return value:
+ *     SGX_FILE*  - pointer to the newly created file handle, NULL if an error occurred - check errno for the error code.
+*/
+SGX_FILE* SGXAPI sgx_fopen(const char* filename, const char* mode, sgx_key_128bit_t *key);
+
+
+/* sgx_fopen_auto_key
+*  Purpose: open existing protected file (created with previous call to sgc_fopen_auto_key) or create a new one (see c++ fopen documentation for more details).
+*           this API doesn't require a key from the user, and instead uses the enclave's SEAL key as a KDK for deriving the mete-data encryption keys
+*           using the SEAL key as a KDK, may result losing file access in cases of disaster-recovery or in cases of VM migration in servers
+*           users that any of these scenarious apply to them, are advised to use sgx_fopen, where they can provide their own key and manage the keys provisioning for those scenarious
+*           for further information, please read the SGX SDK manual
+*
+*  Parameters:
+*      filename - [IN] the name of the file to open/create.
+*      mode - [IN] open mode. only supports 'r' or 'w' or 'a' (one and only one of them must be present), and optionally 'b' and/or '+'.
+*
+*  Return value:
+*     SGX_FILE*  - pointer to the newly created file handle, NULL if an error occurred - check errno for the error code.
+*/
+SGX_FILE* SGXAPI sgx_fopen_auto_key(const char* filename, const char* mode);
+
+
+/* sgx_fwrite
+ *  Purpose: write data to a file (see c++ fwrite documentation for more details).
+ *
+ *  Parameters:
+ *      ptr - [IN] pointer to the input data buffer
+ *      size - [IN] size of data block
+ *      count - [IN] count of data blocks to write
+ *      stream - [IN] the file handle (opened with sgx_fopen or sgx_fopen_auto_key)
+ *
+ *  Return value:
+ *     size_t  - number of 'size' blocks written to the file, 0 in case of an error - check sgx_ferror for error code
+*/
+size_t SGXAPI sgx_fwrite(const void* ptr, size_t size, size_t count, SGX_FILE* stream);
+
+
+/* sgx_fread
+ *  Purpose: read data from a file (see c++ fread documentation for more details).
+ *
+ *  Parameters:
+ *      ptr - [OUT] pointer to the output data buffer
+ *      size - [IN] size of data block
+ *      count - [IN] count of data blocks to write
+ *      stream - [IN] the file handle (opened with sgx_fopen or sgx_fopen_auto_key)
+ *
+ *  Return value:
+ *     size_t  - number of 'size' blocks read from the file, 0 in case of an error - check sgx_ferror for error code
+*/
+size_t SGXAPI sgx_fread(void* ptr, size_t size, size_t count, SGX_FILE* stream);
+
+
+/* sgx_ftell
+ *  Purpose: get the current value of the position indicator of the file (see c++ ftell documentation for more details).
+ *
+ *  Parameters:
+ *      stream - [IN] the file handle (opened with sgx_fopen or sgx_fopen_auto_key)
+ *
+ *  Return value:
+ *     int64_t  - the current value of the position indicator, -1 on error - check errno for the error code
+*/
+int64_t SGXAPI sgx_ftell(SGX_FILE* stream);
+
+
+/* sgx_fseek
+ *  Purpose: set the current value of the position indicator of the file (see c++ fseek documentation for more details).
+ *
+ *  Parameters:
+ *      stream - [IN] the file handle (opened with sgx_fopen or sgx_fopen_auto_key)
+ *      offset - [IN] the new required value, relative to the origin parameter
+ *      origin - [IN] the origin from which to calculate the offset (SEEK_SET, SEEK_CUR or SEEK_END)
+ *
+ *  Return value:
+ *     int32_t  - result, 0 on success, -1 in case of an error - check sgx_ferror for error code
+*/
+int32_t SGXAPI sgx_fseek(SGX_FILE* stream, int64_t offset, int origin);
+
+
+/* sgx_fflush
+ *  Purpose: force actual write of all the cached data to the disk (see c++ fflush documentation for more details).
+ *
+ *  Parameters:
+ *      stream - [IN] the file handle (opened with sgx_fopen or sgx_fopen_auto_key)
+ *
+ *  Return value:
+ *     int32_t  - result, 0 on success, 1 in case of an error - check sgx_ferror for error code
+*/
+int32_t SGXAPI sgx_fflush(SGX_FILE* stream);
+
+
+/* sgx_ferror
+ *  Purpose: get the latest operation error code (see c++ ferror documentation for more details).
+ *
+ *  Parameters:
+ *      stream - [IN] the file handle (opened with sgx_fopen or sgx_fopen_auto_key)
+ *
+ *  Return value:
+ *     int32_t  - the error code, 0 means no error, anything else is the latest operation error code
+*/
+int32_t SGXAPI sgx_ferror(SGX_FILE* stream);
+
+
+/* sgx_feof
+ *  Purpose: did the file's position indicator hit the end of the file in a previous read operation (see c++ feof documentation for more details).
+ *
+ *  Parameters:
+ *      stream - [IN] the file handle (opened with sgx_fopen or sgx_fopen_auto_key)
+ *
+ *  Return value:
+ *     int32_t  - 1 - end of file was reached, 0 - end of file wasn't reached
+*/
+int32_t SGXAPI sgx_feof(SGX_FILE* stream);
+
+
+/* sgx_clearerr
+ *  Purpose: try to clear an error in the file status, also clears the end-of-file flag (see c++ clearerr documentation for more details).
+ *           call sgx_ferror or sgx_feof after a call to this function to learn if it was successful or not
+ *
+ *  Parameters:
+ *      stream - [IN] the file handle (opened with sgx_fopen or sgx_fopen_auto_key)
+ *
+ *  Return value:
+ *      none
+*/
+void SGXAPI sgx_clearerr(SGX_FILE* stream);
+
+
+/* sgx_fclose
+ *  Purpose: close an open file handle (see c++ fclose documentation for more details).
+ *           after a call to this function, the handle is invalid even if an error is returned
+ *
+ *  Parameters:
+ *      stream - [IN] the file handle (opened with sgx_fopen or sgx_fopen_auto_key)
+ *
+ *  Return value:
+ *     int32_t  - result, 0 - file was closed successfully, 1 - there were errors during the operation
+*/
+int32_t SGXAPI sgx_fclose(SGX_FILE* stream);
+
+
+/* sgx_remove
+ *  Purpose: delete a file from the file system (see c++ remove documentation for more details).
+ *
+ *  Parameters:
+ *      filename - [IN] the name of the file to remvoe.
+ *
+ *  Return value:
+ *     int32_t  - result, 0 - success, 1 - there was an error, check errno for the error code
+*/
+int32_t SGXAPI sgx_remove(const char* filename);
+
+
+/* sgx_fexport_auto_key
+*  Purpose: export the last key that was used in the encryption of the file.
+*           with this key we can import the file in a different enclave/system
+*           NOTE - 1. in order for this function to work, the file should not be opened in any other process
+*                  2. this function only works with files created with sgx_fopen_auto_key
+*
+*  Parameters:
+*      filename - [IN] the name of the file to export the encryption key from.
+*      key - [OUT] the exported encryption key
+*
+*  Return value:
+*     int32_t  - result, 0 - success, 1 - there was an error, check errno for the error code
+*/
+int32_t SGXAPI sgx_fexport_auto_key(const char* filename, sgx_key_128bit_t *key);
+
+
+/* sgx_fimport_auto_key
+*  Purpose: import a file that was created in a different enclave/system and make it a local file
+*           after this call return successfully, the file can be opened with sgx_fopen_auto_key
+*           NOTE - this function only works with files created with sgx_fopen_auto_key
+*
+*  Parameters:
+*      filename - [IN] the name of the file to be imported.
+*      key - [IN] the encryption key, exported with a call to sgx_fexport_auto_key in the source enclave/system
+*
+*  Return value:
+*     int32_t  - result, 0 - success, 1 - there was an error, check errno for the error code
+*/
+int32_t SGXAPI sgx_fimport_auto_key(const char* filename, sgx_key_128bit_t *key);
+
+
+/* sgx_fclear_cache
+*  Purpose: scrubs and delete the internal cache used by the file, any changed data is flushed to disk before deletion
+*           Note - only the secrets that were in the cache are deleted, the file structure itself still holds keys and plain file data
+*                  if a user wishes to remove all secrets from memory, he should close the file handle with sgx_fclose
+*
+*  Parameters:
+*      stream - [IN] the file handle (opened with sgx_fopen or sgx_fopen_auto_key
+*
+*  Return value:
+*     int32_t  - result, 0 - success, 1 - there was an error, check errno for the error code
+*/
+int32_t SGXAPI sgx_fclear_cache(SGX_FILE* stream);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // _SGX_TPROTECTED_FS_H_

+ 1 - 1
common/inc/sgx_trts_exception.h

@@ -125,7 +125,7 @@ extern "C" {
  *      exception_handler - a pointer to the handler to be called.
  * Return Value
  *      handler - success
- *          NULL - fail
+ *         NULL - fail
 */
 void * SGXAPI sgx_register_exception_handler(int is_first_handler, sgx_exception_handler_t exception_handler);
 

+ 2 - 0
common/inc/sgx_tseal.h

@@ -85,10 +85,12 @@ extern "C" {
      *
      * Return Value:
      *      uint32_t - The number of bytes in the optional additional MAC buffer
+     *      If the function fails, the return value is UINT32_MAX
     */
     uint32_t sgx_get_add_mac_txt_len(const sgx_sealed_data_t* p_sealed_data);
 
     /* sgx_get_encrypt_txt_len
+     * Purpose: This function is used to determine how much memory to allocate for the decrypted data returned by the sgx_unseal_data function
      *
      * Parameter:
      *      p_sealed_data - [IN] Pointer to the sgx_sealed_data_t structure which was populated by the sgx_seal_data function

+ 16 - 0
common/inc/sgx_uae_service.h

@@ -74,6 +74,21 @@ sgx_status_t SGXAPI sgx_init_quote(
 
 
 /*
+ * Function used to calculate quote size.
+ *
+ * @param p_sig_rl[in] OPTIONAL Signature Revocation List.
+ * @param sig_rl_size[in] Signature Revocation List size, in bytes.
+ * @param p_quote_size[out] Quote size, in bytes.
+ * @return If quote size is calculated,return SGX_SUCCESS, otherwise return
+ *            SGX_ERROR_INVALID_PARAMETER to indicate special error condition.
+ */
+sgx_status_t SGXAPI sgx_calc_quote_size(
+    const uint8_t *p_sig_rl,
+    uint32_t sig_rl_size,
+    uint32_t* p_quote_size);
+
+/*
+ * [DEPRECATED] Use sgx_calc_quote_size function instead of this one
  * Function used to get quote size.
  *
  * @param p_sig_rl[in] OPTIONAL Signature Revocation List.
@@ -81,6 +96,7 @@ sgx_status_t SGXAPI sgx_init_quote(
  * @return If quote size is calculated,return SGX_SCCUESS, otherwise return
  *            SGX_ERROR_INVALID_PARAMETER to indicate special error condition.
  */
+SGX_DEPRECATED
 sgx_status_t SGXAPI sgx_get_quote_size(
     const uint8_t *p_sig_rl,
     uint32_t* p_quote_size);

+ 2 - 2
common/inc/sgx_ukey_exchange.h

@@ -118,7 +118,7 @@ sgx_status_t SGXAPI sgx_ra_get_msg1(
     sgx_ra_msg1_t *p_msg1);
 
 /*
- * sgx_ra_get_msg2 is used to process the remote attestation and key exchange
+ * sgx_ra_proc_msg2 is used to process the remote attestation and key exchange
  * protocol message 2 from the service provider and generate message 3 to send
  * to the service provider. If the service provider accepts message 3,
  * negotiated session keys between the application enclave and the service
@@ -134,7 +134,7 @@ sgx_status_t SGXAPI sgx_ra_get_msg1(
  *                      generated by sgx_edger8r. The application enclave should
  *                      link with sgx_tkey_exchange library and import the
  *                      sgx_tkey_exchange.edl in the application enclave's EDL
- *                      file to expose the ECALL proxy for sgx_ra_get_msg2.
+ *                      file to expose the ECALL proxy for sgx_ra_proc_msg2.
  * @param p_get_msg3    Function pointer of the ECALL proxy sgx_ra_get_msg3_trusted
  *                      generated by sgx_edger8r. The application enclave should
  *                      link with sgx_tkey_exchange library and import the

+ 10 - 0
common/inc/stdc++/linux/typeinfo

@@ -133,6 +133,16 @@ namespace std
 		bad_typeid& operator=(const bad_typeid &__rhs) throw();
 		virtual const char* what() const throw();
 	};
+
+    class bad_array_new_length: public bad_alloc
+    { 
+        public:
+            bad_array_new_length() throw();
+            bad_array_new_length(const bad_array_new_length&) throw();
+            bad_array_new_length& operator=(const bad_array_new_length&) throw();
+            virtual ~bad_array_new_length();
+            virtual const char *what() const throw();
+    };
 }
 
 #endif /* _LINUX_TYPEINFO_ */

+ 5 - 4
common/inc/tlibc/setjmp.h

@@ -40,11 +40,11 @@
 #define _SETJMP_H_
 
 #ifndef _JB_ATTRIBUTES
-#define _JB_ATTRIBUTES	/**/
+#define _JB_ATTRIBUTES /**/
 #else
 #endif
 #ifndef _BSD_JBSLOT_T_
-#define	_BSD_JBSLOT_T_	long
+#define _BSD_JBSLOT_T_ long
 #endif
 
 #define _JBLEN 8 
@@ -55,9 +55,10 @@ typedef _BSD_JBSLOT_T_ jmp_buf[_JBLEN] _JB_ATTRIBUTES;
 #define __returns_twice __attribute__((__returns_twice__))
 #define __dead 
 
+
 __BEGIN_DECLS
-int	_setjmp(jmp_buf) __returns_twice;
-void	_longjmp(jmp_buf, int) __dead;
+int setjmp(jmp_buf) __returns_twice;
+void longjmp(jmp_buf, int) __dead;
 __END_DECLS
 
 #endif /* !_SETJMP_H_ */

+ 6 - 1
common/inc/tlibc/sys/_types.h

@@ -42,8 +42,13 @@ typedef short               __int16_t;
 typedef unsigned short      __uint16_t;
 typedef int                 __int32_t;
 typedef unsigned int        __uint32_t;
+#ifdef __x86_64__
+typedef long                __int64_t;
+typedef unsigned long       __uint64_t;
+#else
 typedef long long           __int64_t;
 typedef unsigned long long  __uint64_t;
+#endif
 
 /* 7.18.1.2 Minimum-width integer types */
 typedef __int8_t            __int_least8_t;
@@ -105,7 +110,7 @@ typedef long                __clock_t;
 
 typedef long                __time_t;
 typedef __builtin_va_list   __va_list;
-typedef int                 __wint_t;
+typedef unsigned int        __wint_t;
 /* wctype_t and wctrans_t are defined in wchar.h */
 typedef unsigned long int   __wctype_t;
 typedef int *               __wctrans_t;

+ 12 - 0
common/inc/tlibc/sys/stdint.h

@@ -110,17 +110,29 @@ typedef __uintmax_t     uintmax_t;
 #define INT8_MIN        (-0x7f - 1)
 #define INT16_MIN       (-0x7fff - 1)
 #define INT32_MIN       (-0x7fffffff - 1)
+#ifdef __x86_64__
+#define INT64_MIN       (-0x7fffffffffffffffL - 1)
+#else
 #define INT64_MIN       (-0x7fffffffffffffffLL - 1)
+#endif
 
 #define INT8_MAX        0x7f
 #define INT16_MAX       0x7fff
 #define INT32_MAX       0x7fffffff
+#ifdef __x86_64__
+#define INT64_MAX       0x7fffffffffffffffL
+#else
 #define INT64_MAX       0x7fffffffffffffffLL
+#endif
 
 #define UINT8_MAX       0xff
 #define UINT16_MAX      0xffff
 #define UINT32_MAX      0xffffffffU
+#ifdef __x86_64__
+#define UINT64_MAX      0xffffffffffffffffUL
+#else
 #define UINT64_MAX      0xffffffffffffffffULL
+#endif
 
 /* 7.18.2.2 Limits of minimum-width integer types */
 #define INT_LEAST8_MIN      INT8_MIN

+ 9 - 9
download_prebuilt.sh

@@ -33,21 +33,21 @@
 
 top_dir=`dirname $0`
 out_dir=$top_dir
-optlib_name=optimized_libs-1.8.100.37641.tar
-ae_file_name=prebuilt-ae-1.8.100.37641.tar
-server_url_path=https://download.01.org/intel-sgx/linux-1.8/
+optlib_name=optimized_libs-1.9.100.38927.tar
+ae_file_name=prebuilt-ae-1.9.100.38927.tar
+server_url_path=https://download.01.org/intel-sgx/linux-1.9/
 server_optlib_url=$server_url_path/$optlib_name
 server_ae_url=$server_url_path/$ae_file_name
-optlib_md5=d873e20155fceb870c2e14771cc2258a
-ae_md5=96b496bbc083397f41de624c0eda66ba
+optlib_sha256=239cae39f87934d56c4eb919a4702c6ac82c19957b9a8d56c02b10eb4e27f573
+ae_sha256=c2f86a1e8483b91c5517c99d196599492f3106d4b2f9f7523fd9eaf59b9ed37b
 rm -rf $out_dir/$optlib_name
 wget $server_optlib_url -P $out_dir 
 if [ $? -ne 0 ]; then
     echo "Fail to download file $server_optlib_url"
     exit -1
 fi
-md5sum $out_dir/$optlib_name > check_sum.txt
-grep $optlib_md5 check_sum.txt
+sha256sum $out_dir/$optlib_name > check_sum.txt
+grep $optlib_sha256 check_sum.txt
 if [ $? -ne 0 ]; then 
     echo "File $server_optlib_url checksum failure"
     exit -1
@@ -58,8 +58,8 @@ if [ $? -ne 0 ]; then
     echo "Fail to download file $server_ae_url"
     exit -1
 fi
-md5sum $out_dir/$ae_file_name > check_sum.txt
-grep $ae_md5 check_sum.txt
+sha256sum $out_dir/$ae_file_name > check_sum.txt
+grep $ae_sha256 check_sum.txt
 if [ $? -ne 0 ]; then
     echo "File $server_ae_url checksum failure"
     exit -1

+ 1 - 1
external/crypto_px/Makefile

@@ -43,7 +43,7 @@ INC := -I./include \
        -I./sources/ippcp/src
 
 SRCS := $(wildcard ./sources/ippcp/src/*.c)
-OBJS := $(SRCS:.c=.o)
+OBJS := $(sort $(SRCS:.c=.o))
 
 libcrypto_px.a: $(OBJS)
 	ar crv $@ $^

+ 3 - 3
external/epid-sdk-3.0.0/LICENSE.txt

@@ -203,9 +203,9 @@
 
 =======================================================================
 
-EPID SDK Subcomponents:
+Intel(R) Enhanced Privacy ID (Intel(R) EPID) SDK Subcomponents:
 
-The EPID SDK contains subcomponents with separate copyright notices
+The Intel(R) EPID SDK contains subcomponents with separate copyright notices
 and license terms. Your use of the source code for these subcomponents
 is subject to the terms and conditions of the following licenses.
 
@@ -214,7 +214,7 @@ is subject to the terms and conditions of the following licenses.
 The BSD 3-Clause License
 -----------------------------------------------------------------------
 
-The EPID SDK bundles portions of the following under the BSD 3-Clause
+The Intel(R) EPID SDK bundles portions of the following under the BSD 3-Clause
 License:
 
  - Google Test (https://github.com/google/googletest)

+ 5 - 4
external/epid-sdk-3.0.0/NOTICE.txt

@@ -1,4 +1,4 @@
-Intel(R) EPID SDK
+Intel(R) Enhanced Privacy ID (Intel(R) EPID) SDK
 Copyright 2016 Intel Corporation
 
 ==========
@@ -15,8 +15,9 @@ their respective licenses.
 ----------
 
 The source code used for math primitives in the Intel(R) EPID SDK is a
-subset of the Intel(R) IPP Cryptography library (v9.0.3) written in
-C. For higher performance, you can use the commercial version of the
-IPP Cryptography libraries, which are available at
+subset of the Intel(R) Integrated Performance Primitives (Intel(R) IPP)
+Cryptography library (v9.0.3) written in C. 
+For higher performance, you can use the commercial version of the 
+Intel(R) IPP Cryptography libraries, which are available at 
 https://software.intel.com/articles/download-ipp-cryptography-libraries.
 

+ 0 - 104
external/epid-sdk-3.0.0/doc/html/1_81_2file__parser_8h.html

@@ -1,104 +0,0 @@
-<!-- HTML header for doxygen 1.8.10-->
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
-<meta http-equiv="X-UA-Compatible" content="IE=9"/>
-<meta name="generator" content="Doxygen 1.8.11"/>
-<title>Intel&reg; Enhanced Privacy ID SDK: epid/common/1.1/file_parser.h File Reference</title>
-<link href="tabs.css" rel="stylesheet" type="text/css"/>
-<script type="text/javascript" src="jquery.js"></script>
-<script type="text/javascript" src="dynsections.js"></script>
-<link href="navtree.css" rel="stylesheet" type="text/css"/>
-<script type="text/javascript" src="resize.js"></script>
-<script type="text/javascript" src="navtreedata.js"></script>
-<script type="text/javascript" src="navtree.js"></script>
-<script type="text/javascript">
-  $(document).ready(initResizable);
-  $(window).load(resizeHeight);
-</script>
-<link href="doxygen.css" rel="stylesheet" type="text/css" />
-<link href="epidstyle.css" rel="stylesheet" type="text/css"/>
-</head>
-<body>
-<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
-<div id="titlearea">
-<table cellspacing="0" cellpadding="0">
- <tbody>
- <tr style="height: 56px;">
-  <td id="projectalign" style="padding-left: 0.5em;">
-   <div id="projectname"><a 
-                            onclick="storeLink('index.html')"
-                            id="projectlink" 
-                            class="index.html" 
-                            href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">3.0.0</span>
-</div>
-  </td>
- </tr>
- </tbody>
-</table>
-</div>
-<!-- end header part -->
-<!-- Generated by Doxygen 1.8.11 -->
-</div><!-- top -->
-<div id="side-nav" class="ui-resizable side-nav-resizable">
-  <div id="nav-tree">
-    <div id="nav-tree-contents">
-      <div id="nav-sync" class="sync"></div>
-    </div>
-  </div>
-  <div id="splitbar" style="-moz-user-select:none;" 
-       class="ui-resizable-handle">
-  </div>
-</div>
-<script type="text/javascript">
-$(document).ready(function(){initNavTree('1_81_2file__parser_8h.html','');});
-</script>
-<div id="doc-content">
-<div class="header">
-  <div class="summary">
-<a href="#func-members">Functions</a>  </div>
-  <div class="headertitle">
-<div class="title">file_parser.h File Reference</div>  </div>
-</div><!--header-->
-<div class="contents">
-
-<p>Epid 1.1 issuer material parsing utilities.  
-<a href="#details">More...</a></p>
-<div class="textblock"><code>#include &lt;stddef.h&gt;</code><br />
-<code>#include &quot;<a class="el" href="1_81_2types_8h.html">epid/common/1.1/types.h</a>&quot;</code><br />
-<code>#include &quot;<a class="el" href="errors_8h.html">epid/common/errors.h</a>&quot;</code><br />
-<code>#include &quot;<a class="el" href="file__parser_8h.html">epid/common/file_parser.h</a>&quot;</code><br />
-</div><table class="memberdecls">
-<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
-Functions</h2></td></tr>
-<tr class="memitem:ga1f92d1cb6bd7d9815711fde515b40a4c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid11_file_parser_module.html#ga1f92d1cb6bd7d9815711fde515b40a4c">Epid11ParseGroupPubKeyFile</a> (void const *buf, size_t len, <a class="el" href="struct_epid_ca_certificate.html">EpidCaCertificate</a> const *cert, <a class="el" href="struct_epid11_group_pub_key.html">Epid11GroupPubKey</a> *pubkey)</td></tr>
-<tr class="memdesc:ga1f92d1cb6bd7d9815711fde515b40a4c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Extracts group public key from buffer in issuer binary format.  <a href="group___epid11_file_parser_module.html#ga1f92d1cb6bd7d9815711fde515b40a4c">More...</a><br /></td></tr>
-<tr class="separator:ga1f92d1cb6bd7d9815711fde515b40a4c"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:gae682077d315c39ed298ef198fd738546"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid11_file_parser_module.html#gae682077d315c39ed298ef198fd738546">Epid11ParsePrivRlFile</a> (void const *buf, size_t len, <a class="el" href="struct_epid_ca_certificate.html">EpidCaCertificate</a> const *cert, <a class="el" href="struct_epid11_priv_rl.html">Epid11PrivRl</a> *rl, size_t *rl_len)</td></tr>
-<tr class="memdesc:gae682077d315c39ed298ef198fd738546"><td class="mdescLeft">&#160;</td><td class="mdescRight">Extracts private key revocation list from buffer in issuer binary format.  <a href="group___epid11_file_parser_module.html#gae682077d315c39ed298ef198fd738546">More...</a><br /></td></tr>
-<tr class="separator:gae682077d315c39ed298ef198fd738546"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:gac3f6daaa5333627d4efe5438c1fe8868"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid11_file_parser_module.html#gac3f6daaa5333627d4efe5438c1fe8868">Epid11ParseSigRlFile</a> (void const *buf, size_t len, <a class="el" href="struct_epid_ca_certificate.html">EpidCaCertificate</a> const *cert, <a class="el" href="struct_epid11_sig_rl.html">Epid11SigRl</a> *rl, size_t *rl_len)</td></tr>
-<tr class="memdesc:gac3f6daaa5333627d4efe5438c1fe8868"><td class="mdescLeft">&#160;</td><td class="mdescRight">Extracts signature revocation list from buffer in issuer binary format.  <a href="group___epid11_file_parser_module.html#gac3f6daaa5333627d4efe5438c1fe8868">More...</a><br /></td></tr>
-<tr class="separator:gac3f6daaa5333627d4efe5438c1fe8868"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:gae28a844eb68828480b2a76fcb7d252a3"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid11_file_parser_module.html#gae28a844eb68828480b2a76fcb7d252a3">Epid11ParseGroupRlFile</a> (void const *buf, size_t len, <a class="el" href="struct_epid_ca_certificate.html">EpidCaCertificate</a> const *cert, <a class="el" href="struct_epid11_group_rl.html">Epid11GroupRl</a> *rl, size_t *rl_len)</td></tr>
-<tr class="memdesc:gae28a844eb68828480b2a76fcb7d252a3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Extracts group revocation list from buffer in issuer binary format.  <a href="group___epid11_file_parser_module.html#gae28a844eb68828480b2a76fcb7d252a3">More...</a><br /></td></tr>
-<tr class="separator:gae28a844eb68828480b2a76fcb7d252a3"><td class="memSeparator" colspan="2">&#160;</td></tr>
-</table>
-<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
-<div class="textblock"><p>Epid 1.1 issuer material parsing utilities. </p>
-</div></div><!-- contents -->
-</div><!-- doc-content -->
-<!-- HTML footer for doxygen 1.8.10-->
-<!-- start footer part -->
-<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
-  <ul>
-    <li class="navelem"><a class="el" href="dir_12b90d9c027aaf878a834df729679a56.html">epid</a></li><li class="navelem"><a class="el" href="dir_f6bef457d5f671b6e774bfccc16651f6.html">common</a></li><li class="navelem"><a class="el" href="dir_a32be19bc88f3d7aac6b7249da379f26.html">1.1</a></li><li class="navelem"><a class="el" href="1_81_2file__parser_8h.html">file_parser.h</a></li>
-    <li class="footer">
-      &copy; 2016 Intel Corporation
-    </li>
-  </ul>
-</div>
-</body>
-</html>

+ 0 - 151
external/epid-sdk-3.0.0/doc/html/1_81_2types_8h.html

@@ -1,151 +0,0 @@
-<!-- HTML header for doxygen 1.8.10-->
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
-<meta http-equiv="X-UA-Compatible" content="IE=9"/>
-<meta name="generator" content="Doxygen 1.8.11"/>
-<title>Intel&reg; Enhanced Privacy ID SDK: epid/common/1.1/types.h File Reference</title>
-<link href="tabs.css" rel="stylesheet" type="text/css"/>
-<script type="text/javascript" src="jquery.js"></script>
-<script type="text/javascript" src="dynsections.js"></script>
-<link href="navtree.css" rel="stylesheet" type="text/css"/>
-<script type="text/javascript" src="resize.js"></script>
-<script type="text/javascript" src="navtreedata.js"></script>
-<script type="text/javascript" src="navtree.js"></script>
-<script type="text/javascript">
-  $(document).ready(initResizable);
-  $(window).load(resizeHeight);
-</script>
-<link href="doxygen.css" rel="stylesheet" type="text/css" />
-<link href="epidstyle.css" rel="stylesheet" type="text/css"/>
-</head>
-<body>
-<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
-<div id="titlearea">
-<table cellspacing="0" cellpadding="0">
- <tbody>
- <tr style="height: 56px;">
-  <td id="projectalign" style="padding-left: 0.5em;">
-   <div id="projectname"><a 
-                            onclick="storeLink('index.html')"
-                            id="projectlink" 
-                            class="index.html" 
-                            href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">3.0.0</span>
-</div>
-  </td>
- </tr>
- </tbody>
-</table>
-</div>
-<!-- end header part -->
-<!-- Generated by Doxygen 1.8.11 -->
-</div><!-- top -->
-<div id="side-nav" class="ui-resizable side-nav-resizable">
-  <div id="nav-tree">
-    <div id="nav-tree-contents">
-      <div id="nav-sync" class="sync"></div>
-    </div>
-  </div>
-  <div id="splitbar" style="-moz-user-select:none;" 
-       class="ui-resizable-handle">
-  </div>
-</div>
-<script type="text/javascript">
-$(document).ready(function(){initNavTree('1_81_2types_8h.html','');});
-</script>
-<div id="doc-content">
-<div class="header">
-  <div class="summary">
-<a href="#nested-classes">Data Structures</a> &#124;
-<a href="#typedef-members">Typedefs</a>  </div>
-  <div class="headertitle">
-<div class="title">types.h File Reference</div>  </div>
-</div><!--header-->
-<div class="contents">
-
-<p>SDK data types for Intel(R) EPID 1.1.  
-<a href="#details">More...</a></p>
-<div class="textblock"><code>#include &lt;limits.h&gt;</code><br />
-<code>#include &quot;<a class="el" href="types_8h.html">epid/common/types.h</a>&quot;</code><br />
-</div><table class="memberdecls">
-<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
-Data Structures</h2></td></tr>
-<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_oct_str80.html">OctStr80</a></td></tr>
-<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">80 bit octet string  <a href="struct_oct_str80.html#details">More...</a><br /></td></tr>
-<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_oct_str600.html">OctStr600</a></td></tr>
-<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">600 bit octet string  <a href="struct_oct_str600.html#details">More...</a><br /></td></tr>
-<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_oct_str768.html">OctStr768</a></td></tr>
-<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">768 bit octet string  <a href="struct_oct_str768.html#details">More...</a><br /></td></tr>
-<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_fq3_elem_str.html">Fq3ElemStr</a></td></tr>
-<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Serialized Fq3 element.  <a href="struct_fq3_elem_str.html#details">More...</a><br /></td></tr>
-<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_epid11_g2_elem_str.html">Epid11G2ElemStr</a></td></tr>
-<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Serialized Intel(R) EPID 1.1 G2 element.  <a href="struct_epid11_g2_elem_str.html#details">More...</a><br /></td></tr>
-<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_epid11_gt_elem_str.html">Epid11GtElemStr</a></td></tr>
-<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Serialized Intel(R) EPID 1.1 GT element.  <a href="struct_epid11_gt_elem_str.html#details">More...</a><br /></td></tr>
-<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_epid11_params.html">Epid11Params</a></td></tr>
-<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Intel(R) EPID 1.1 Parameters.  <a href="struct_epid11_params.html#details">More...</a><br /></td></tr>
-<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_epid11_group_pub_key.html">Epid11GroupPubKey</a></td></tr>
-<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Intel(R) EPID 1.1 group public key.  <a href="struct_epid11_group_pub_key.html#details">More...</a><br /></td></tr>
-<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_epid11_basic_signature.html">Epid11BasicSignature</a></td></tr>
-<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Intel(R) EPID 1.1 basic signature.  <a href="struct_epid11_basic_signature.html#details">More...</a><br /></td></tr>
-<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_epid11_nr_proof.html">Epid11NrProof</a></td></tr>
-<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Intel(R) EPID 1.1 non-revoked Proof.  <a href="struct_epid11_nr_proof.html#details">More...</a><br /></td></tr>
-<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_epid11_signature.html">Epid11Signature</a></td></tr>
-<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Intel(R) EPID 1.1 Signature.  <a href="struct_epid11_signature.html#details">More...</a><br /></td></tr>
-<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_epid11_priv_rl.html">Epid11PrivRl</a></td></tr>
-<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Intel(R) EPID 1.1 private-key based revocation list.  <a href="struct_epid11_priv_rl.html#details">More...</a><br /></td></tr>
-<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_epid11_sig_rl_entry.html">Epid11SigRlEntry</a></td></tr>
-<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Intel(R) EPID 1.1 entry in SigRL (B,K)  <a href="struct_epid11_sig_rl_entry.html#details">More...</a><br /></td></tr>
-<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_epid11_sig_rl.html">Epid11SigRl</a></td></tr>
-<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Intel(R) EPID 1.1 signature based revocation list.  <a href="struct_epid11_sig_rl.html#details">More...</a><br /></td></tr>
-<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_epid11_group_rl.html">Epid11GroupRl</a></td></tr>
-<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Intel(R) EPID 1.1 group revocation list.  <a href="struct_epid11_group_rl.html#details">More...</a><br /></td></tr>
-<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
-</table><table class="memberdecls">
-<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
-Typedefs</h2></td></tr>
-<tr class="memitem:gadff9c05d5b7751024152b40dda545545"><td class="memItemLeft" align="right" valign="top">
-typedef <a class="el" href="struct_g1_elem_str.html">G1ElemStr</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid11_types.html#gadff9c05d5b7751024152b40dda545545">Epid11G1ElemStr</a></td></tr>
-<tr class="memdesc:gadff9c05d5b7751024152b40dda545545"><td class="mdescLeft">&#160;</td><td class="mdescRight">Serialized Intel(R) EPID 1.1 G1 element. <br /></td></tr>
-<tr class="separator:gadff9c05d5b7751024152b40dda545545"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:gaf1f4f1d6f001895abe548cfb33611c23"><td class="memItemLeft" align="right" valign="top">
-typedef <a class="el" href="struct_g1_elem_str.html">G1ElemStr</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid11_types.html#gaf1f4f1d6f001895abe548cfb33611c23">Epid11G3ElemStr</a></td></tr>
-<tr class="memdesc:gaf1f4f1d6f001895abe548cfb33611c23"><td class="mdescLeft">&#160;</td><td class="mdescRight">Serialized Intel(R) EPID 1.1 G3 element. <br /></td></tr>
-<tr class="separator:gaf1f4f1d6f001895abe548cfb33611c23"><td class="memSeparator" colspan="2">&#160;</td></tr>
-<tr class="memitem:ga7293cec8f937d6f5da42084403f978f1"><td class="memItemLeft" align="right" valign="top">
-typedef <a class="el" href="struct_oct_str32.html">OctStr32</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid11_types.html#ga7293cec8f937d6f5da42084403f978f1">Epid11GroupId</a></td></tr>
-<tr class="memdesc:ga7293cec8f937d6f5da42084403f978f1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Intel(R) EPID 1.1 group ID. <br /></td></tr>
-<tr class="separator:ga7293cec8f937d6f5da42084403f978f1"><td class="memSeparator" colspan="2">&#160;</td></tr>
-</table>
-<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
-<div class="textblock"><p>SDK data types for Intel(R) EPID 1.1. </p>
-</div></div><!-- contents -->
-</div><!-- doc-content -->
-<!-- HTML footer for doxygen 1.8.10-->
-<!-- start footer part -->
-<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
-  <ul>
-    <li class="navelem"><a class="el" href="dir_12b90d9c027aaf878a834df729679a56.html">epid</a></li><li class="navelem"><a class="el" href="dir_f6bef457d5f671b6e774bfccc16651f6.html">common</a></li><li class="navelem"><a class="el" href="dir_a32be19bc88f3d7aac6b7249da379f26.html">1.1</a></li><li class="navelem"><a class="el" href="1_81_2types_8h.html">types.h</a></li>
-    <li class="footer">
-      &copy; 2016 Intel Corporation
-    </li>
-  </ul>
-</div>
-</body>
-</html>

+ 0 - 93
external/epid-sdk-3.0.0/doc/html/Basenames.html

@@ -1,93 +0,0 @@
-<!-- HTML header for doxygen 1.8.10-->
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
-<meta http-equiv="X-UA-Compatible" content="IE=9"/>
-<meta name="generator" content="Doxygen 1.8.11"/>
-<title>Intel&reg; Enhanced Privacy ID SDK: In-Depth Explanation of Basenames</title>
-<link href="tabs.css" rel="stylesheet" type="text/css"/>
-<script type="text/javascript" src="jquery.js"></script>
-<script type="text/javascript" src="dynsections.js"></script>
-<link href="navtree.css" rel="stylesheet" type="text/css"/>
-<script type="text/javascript" src="resize.js"></script>
-<script type="text/javascript" src="navtreedata.js"></script>
-<script type="text/javascript" src="navtree.js"></script>
-<script type="text/javascript">
-  $(document).ready(initResizable);
-  $(window).load(resizeHeight);
-</script>
-<link href="doxygen.css" rel="stylesheet" type="text/css" />
-<link href="epidstyle.css" rel="stylesheet" type="text/css"/>
-</head>
-<body>
-<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
-<div id="titlearea">
-<table cellspacing="0" cellpadding="0">
- <tbody>
- <tr style="height: 56px;">
-  <td id="projectalign" style="padding-left: 0.5em;">
-   <div id="projectname"><a 
-                            onclick="storeLink('index.html')"
-                            id="projectlink" 
-                            class="index.html" 
-                            href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">3.0.0</span>
-</div>
-  </td>
- </tr>
- </tbody>
-</table>
-</div>
-<!-- end header part -->
-<!-- Generated by Doxygen 1.8.11 -->
-</div><!-- top -->
-<div id="side-nav" class="ui-resizable side-nav-resizable">
-  <div id="nav-tree">
-    <div id="nav-tree-contents">
-      <div id="nav-sync" class="sync"></div>
-    </div>
-  </div>
-  <div id="splitbar" style="-moz-user-select:none;" 
-       class="ui-resizable-handle">
-  </div>
-</div>
-<script type="text/javascript">
-$(document).ready(function(){initNavTree('Basenames.html','');});
-</script>
-<div id="doc-content">
-<div class="header">
-  <div class="headertitle">
-<div class="title">In-Depth Explanation of Basenames </div>  </div>
-</div><!--header-->
-<div class="contents">
-<div class="textblock"><p>This in-depth explanation covers the use of basenames in the Intel&reg; EPID scheme. It provides detail on name based signatures, random base signatures and how and when they are used.</p>
-<p><br />
-</p>
-<h1><a class="anchor" id="random_base"></a>
-Random Base Signatures</h1>
-<p>By default, members sign using a random basename that is not shared with the verifier. This signing method is also referred to as signing using random base. Signing using random base provides the strongest privacy properties for the signer. If a member signs using random base, the signature generated by the member is anonymous.</p>
-<p>When the signer and verifier agree to use random base, the basename is chosen at random for each signature. Two signatures using a random base cannot be linked to the same signer.</p>
-<h1><a class="anchor" id="name_based"></a>
-Name Based Signatures</h1>
-<p>A name based signature is a type of signature that gives the verifier the ability to link Intel&reg; EPID signatures from the same member, reducing the member's privacy. When using name based signatures, the signer and verifier agree on an explicit basename.</p>
-<p>The verifier can ask the member to sign a message with a basename that the verifier chooses. If the member agrees to use a name based signature, then all the signatures created by the member using the same basename are linkable by the verifier, reducing the member's privacy.</p>
-<p>Reasons why a verifier might require members to use a basename when signing include the following:</p>
-<ul>
-<li><b>Profiling for Advertising</b> Widget-Mart wants to show targeted advertising to privacy-conscious customers. Widget-Mart requests that all customers use a specific basename so that Widget-Mart can build an individualized profile for each anonymous user, while Intel&reg; EPID technology ensures that the retailer does not have the ability to aggregate that information with other retailers to build a more extensive profile of the consumer.</li>
-<li><b>Voting</b> A voting machine is designed so that each anonymous authorized voter can only vote once per race. A basename per office being contested allows the verifier to confirm that the voter has not already voted for that office, without revealing their identity or correlating their voting patterns across multiple races.</li>
-</ul>
-<dl class="section warning"><dt>Warning</dt><dd>The use of a name-based signature creates a platform unique pseudonymous identifier. Because it reduces the member's privacy, the user should be notified when it is used and should have control over its use. </dd></dl>
-</div></div><!-- contents -->
-</div><!-- doc-content -->
-<!-- HTML footer for doxygen 1.8.10-->
-<!-- start footer part -->
-<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
-  <ul>
-    <li class="footer">
-      &copy; 2016 Intel Corporation
-    </li>
-  </ul>
-</div>
-</body>
-</html>

+ 0 - 128
external/epid-sdk-3.0.0/doc/html/BuildToolsInstallation.html

@@ -1,128 +0,0 @@
-<!-- HTML header for doxygen 1.8.10-->
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
-<meta http-equiv="X-UA-Compatible" content="IE=9"/>
-<meta name="generator" content="Doxygen 1.8.11"/>
-<title>Intel&reg; Enhanced Privacy ID SDK: Guide to Installing Build Tools</title>
-<link href="tabs.css" rel="stylesheet" type="text/css"/>
-<script type="text/javascript" src="jquery.js"></script>
-<script type="text/javascript" src="dynsections.js"></script>
-<link href="navtree.css" rel="stylesheet" type="text/css"/>
-<script type="text/javascript" src="resize.js"></script>
-<script type="text/javascript" src="navtreedata.js"></script>
-<script type="text/javascript" src="navtree.js"></script>
-<script type="text/javascript">
-  $(document).ready(initResizable);
-  $(window).load(resizeHeight);
-</script>
-<link href="doxygen.css" rel="stylesheet" type="text/css" />
-<link href="epidstyle.css" rel="stylesheet" type="text/css"/>
-</head>
-<body>
-<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
-<div id="titlearea">
-<table cellspacing="0" cellpadding="0">
- <tbody>
- <tr style="height: 56px;">
-  <td id="projectalign" style="padding-left: 0.5em;">
-   <div id="projectname"><a 
-                            onclick="storeLink('index.html')"
-                            id="projectlink" 
-                            class="index.html" 
-                            href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">3.0.0</span>
-</div>
-  </td>
- </tr>
- </tbody>
-</table>
-</div>
-<!-- end header part -->
-<!-- Generated by Doxygen 1.8.11 -->
-</div><!-- top -->
-<div id="side-nav" class="ui-resizable side-nav-resizable">
-  <div id="nav-tree">
-    <div id="nav-tree-contents">
-      <div id="nav-sync" class="sync"></div>
-    </div>
-  </div>
-  <div id="splitbar" style="-moz-user-select:none;" 
-       class="ui-resizable-handle">
-  </div>
-</div>
-<script type="text/javascript">
-$(document).ready(function(){initNavTree('BuildToolsInstallation.html','');});
-</script>
-<div id="doc-content">
-<div class="header">
-  <div class="headertitle">
-<div class="title">Guide to Installing Build Tools </div>  </div>
-</div><!--header-->
-<div class="contents">
-<div class="toc"><h3>Table of Contents</h3>
-<ul><li class="level1"><a href="#build_tools_windows_python">Installing Python</a></li>
-<li class="level1"><a href="#build_tools_windows_scons">Installing SCons</a></li>
-<li class="level1"><a href="#build_tools_windows_parts">Installing Parts</a></li>
-</ul>
-</div>
-<div class="textblock"><p>Building SDK code out of the box requires a number of tools. This section explains how to install the following tools:</p>
-<table class="doxtable">
-<tr>
-<th>Prerequisite </th><th>Download Link  </th></tr>
-<tr>
-<td><a href="https://www.python.org/downloads">Python</a> </td><td><a href="https://www.python.org/downloads/release/python-2712/">python 2.7.12 installers</a> </td></tr>
-<tr>
-<td><a href="http://www.scons.org">SCons</a> </td><td><a href="http://prdownloads.sourceforge.net/scons/scons-2.4.1.zip">scons-2.4.1.zip</a> </td></tr>
-<tr>
-<td><a href="https://bitbucket.org/sconsparts/parts/downloads">Parts</a> </td><td><a href="https://bitbucket.org/sconsparts/parts/downloads/parts-0.11.0.zip">parts-0.11.0.zip</a> </td></tr>
-</table>
-<p><br />
- </p>
-<h1><a class="anchor" id="build_tools_windows_python"></a>
-Installing Python</h1>
-<ol type="1">
-<li>Download and install Python according to the installation procedure for your platform.</li>
-<li>Make sure that the Python directory and the Python scripts directory are in the path.</li>
-</ol>
-<p>To verify that Python installed correctly, run: </p><pre class="fragment">    &gt; python --version
-</pre><p><br />
- </p>
-<h1><a class="anchor" id="build_tools_windows_scons"></a>
-Installing SCons</h1>
-<p>After Python is installed, install SCons.</p>
-<ol type="1">
-<li>Download and extract the files from the SCons archive.</li>
-<li>To install SCons, go to the directory with the extracted files and run: <pre class="fragment"> &gt; python setup.py install
-</pre></li>
-</ol>
-<dl class="section note"><dt>Note</dt><dd>You may need administrative privileges to execute this command.</dd></dl>
-<p><br />
- To verify that SCons installed correctly, run: </p><pre class="fragment">    &gt; scons --version
-</pre><p><br />
- </p>
-<h1><a class="anchor" id="build_tools_windows_parts"></a>
-Installing Parts</h1>
-<p>After SCons is installed, install Parts.</p>
-<ol type="1">
-<li>Download and extract the files from the Parts archive.</li>
-<li>To install Parts, go to the directory with the extracted files and run: <pre class="fragment"> &gt; python setup.py install
-</pre></li>
-</ol>
-<dl class="section note"><dt>Note</dt><dd>You may need administrative privileges to execute this command.</dd></dl>
-<p><br />
-</p>
-</div></div><!-- contents -->
-</div><!-- doc-content -->
-<!-- HTML footer for doxygen 1.8.10-->
-<!-- start footer part -->
-<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
-  <ul>
-    <li class="footer">
-      &copy; 2016 Intel Corporation
-    </li>
-  </ul>
-</div>
-</body>
-</html>

+ 0 - 179
external/epid-sdk-3.0.0/doc/html/BuildingSdk.html

@@ -1,179 +0,0 @@
-<!-- HTML header for doxygen 1.8.10-->
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
-<meta http-equiv="X-UA-Compatible" content="IE=9"/>
-<meta name="generator" content="Doxygen 1.8.11"/>
-<title>Intel&reg; Enhanced Privacy ID SDK: Building from Source</title>
-<link href="tabs.css" rel="stylesheet" type="text/css"/>
-<script type="text/javascript" src="jquery.js"></script>
-<script type="text/javascript" src="dynsections.js"></script>
-<link href="navtree.css" rel="stylesheet" type="text/css"/>
-<script type="text/javascript" src="resize.js"></script>
-<script type="text/javascript" src="navtreedata.js"></script>
-<script type="text/javascript" src="navtree.js"></script>
-<script type="text/javascript">
-  $(document).ready(initResizable);
-  $(window).load(resizeHeight);
-</script>
-<link href="doxygen.css" rel="stylesheet" type="text/css" />
-<link href="epidstyle.css" rel="stylesheet" type="text/css"/>
-</head>
-<body>
-<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
-<div id="titlearea">
-<table cellspacing="0" cellpadding="0">
- <tbody>
- <tr style="height: 56px;">
-  <td id="projectalign" style="padding-left: 0.5em;">
-   <div id="projectname"><a 
-                            onclick="storeLink('index.html')"
-                            id="projectlink" 
-                            class="index.html" 
-                            href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">3.0.0</span>
-</div>
-  </td>
- </tr>
- </tbody>
-</table>
-</div>
-<!-- end header part -->
-<!-- Generated by Doxygen 1.8.11 -->
-</div><!-- top -->
-<div id="side-nav" class="ui-resizable side-nav-resizable">
-  <div id="nav-tree">
-    <div id="nav-tree-contents">
-      <div id="nav-sync" class="sync"></div>
-    </div>
-  </div>
-  <div id="splitbar" style="-moz-user-select:none;" 
-       class="ui-resizable-handle">
-  </div>
-</div>
-<script type="text/javascript">
-$(document).ready(function(){initNavTree('BuildingSdk.html','');});
-</script>
-<div id="doc-content">
-<div class="header">
-  <div class="headertitle">
-<div class="title">Building from Source </div>  </div>
-</div><!--header-->
-<div class="contents">
-<div class="toc"><h3>Table of Contents</h3>
-<ul><li class="level1"><a href="#BuildingSdk_Prerequisites">Prerequisites</a></li>
-<li class="level1"><a href="#BuildingSdk_Building_SCons">Building SDK with SCons</a></li>
-<li class="level1"><a href="#BuildingSdk_Building_Makefile">Alternate Makefile/Autoconf Based Build Approach</a></li>
-<li class="level1"><a href="#BuildingSdk_CommercialIpp">Improving Performance with Commercial IPP</a></li>
-<li class="level1"><a href="#BuildingSdk_Examples">Example Programs</a></li>
-<li class="level1"><a href="#BuildingSdk_PortingBuildSystem">Building with Other Build Systems</a></li>
-</ul>
-</div>
-<div class="textblock"><p>To use the SDK in a project, the code from the SDK must be included in that project. The easiest way to do this is to link to static libraries. The SDK comes with build scripts to build static libraries for common environments.</p>
-<h1><a class="anchor" id="BuildingSdk_Prerequisites"></a>
-Prerequisites</h1>
-<p>Building SDK code out of the box requires a number of tools. This section lists the tools used to build the SDK.</p>
-<p>For more information on how to install these tools, refer to <a class="el" href="BuildToolsInstallation.html">Guide to Installing Build Tools</a>.</p>
-<table class="doxtable">
-<tr>
-<th>Prerequisite </th><th>Notes  </th></tr>
-<tr>
-<td>A C/C++ compiler </td><td>Core code in C. Unit tests need C++11 support. </td></tr>
-<tr>
-<td><a href="http://www.python.org">Python</a> </td><td>Validated with v2.7.10 </td></tr>
-<tr>
-<td><a href="http://www.scons.org">SCons</a> </td><td>Validated with v2.4.1 </td></tr>
-<tr>
-<td><a href="https://bitbucket.org/sconsparts/parts">Parts</a> </td><td>0.10.9.2 or later </td></tr>
-</table>
-<h1><a class="anchor" id="BuildingSdk_Building_SCons"></a>
-Building SDK with SCons</h1>
-<p>To use the SDK, you need to build it to generate libraries compatible with your build environment.</p>
-<p>To build based on the default SConstruct file in the root directory of the SDK, invoke scons with no arguments. </p><pre class="fragment">cd &lt;path/to/sdk-root&gt;
-scons
-</pre><p>By default, this performs a 64 bit release build.</p>
-<p>Potentially useful command line options:</p>
-<table class="doxtable">
-<tr>
-<th>Option </th><th>Action  </th></tr>
-<tr>
-<td><code>--cfg=debug</code> </td><td>Build in debug mode </td></tr>
-<tr>
-<td><code>--cfg=release</code> </td><td>Build in release mode </td></tr>
-<tr>
-<td><code>--target=x86</code> </td><td>Target x86 </td></tr>
-<tr>
-<td><code>--target=x86_64</code> </td><td>Target x86_64 </td></tr>
-<tr>
-<td><code>--tc=cl</code> </td><td>Use MSVC to compile (Microsoft&reg;* C/C++ Optimizing Compiler) </td></tr>
-<tr>
-<td><code>--tc=gcc</code> </td><td>Use GCC to compile (GNU* Compiler Collection) </td></tr>
-<tr>
-<td><code>--tc=icl,mstools</code> </td><td>Use Intel&reg; C++ compiler </td></tr>
-<tr>
-<td><code>build::</code> </td><td>Build the SDK (does not build unit tests) </td></tr>
-<tr>
-<td><code>utest::</code> </td><td>Build unit tests </td></tr>
-<tr>
-<td><code>run_utest::</code> </td><td>Run unit tests (builds tests if needed) </td></tr>
-<tr>
-<td><code>-c</code> </td><td>Clean the build </td></tr>
-</table>
-<p>Built components appear in the <code>_install</code> directory of the SDK root.</p>
-<h1><a class="anchor" id="BuildingSdk_Building_Makefile"></a>
-Alternate Makefile/Autoconf Based Build Approach</h1>
-<p>You can build with the <code>make</code> command on platforms that support Make/Autoconf.</p>
-<p>In the root directory of the SDK, run: </p><pre class="fragment">./configure
-make all
-make check
-make install
-</pre><p><code>./configure</code> sets up the default settings:</p>
-<ul>
-<li>The default compilers are GCC/G++. You can specify compilers via the CC and CXX variables. For example, <code>./configure CC=/opt/intel/bin/icc CXX=/opt/intel/bin/icpc</code></li>
-<li>The default installation directory is <code>./_install</code>. You can specify the installation directory by using <code>./configure --prefix=/usr/local/epid_install</code></li>
-<li>To change OS bit version, use CFLAGS parameter <code>-m32</code> and <code>-m64</code>. For example, <code>./configure CFLAGS=-m32</code></li>
-</ul>
-<p><code>make check</code> is optional. It builds and runs the unit tests.</p>
-<p>Alternatively, you can use <code>make build</code> as a shortcut to replace <code>make all</code>, <code>make check</code>, and <code>make install</code>.</p>
-<p>To clean the build, run <code>make clean</code>.</p>
-<p>To remove the install directory, run <code>make uninstall</code>.</p>
-<h1><a class="anchor" id="BuildingSdk_CommercialIpp"></a>
-Improving Performance with Commercial IPP</h1>
-<p>For higher performance, you can use the commercial version of Cryptography for Intel&reg; Integrated Performance Primitives, available at <a href="https://software.intel.com/articles/download-ipp-cryptography-libraries">https://software.intel.com/articles/download-ipp-cryptography-libraries</a>.</p>
-<dl class="section note"><dt>Note</dt><dd>The SDK has been validated with v9.0.3 of the cryptography library.</dd></dl>
-<p>To build the SDK using a commercial Intel&reg; IPP installation, the <code>IPPROOT</code> environment variable must be properly configured to point to the IPP installation directory, as described in Setting Environment Variables* in the <a href="https://software.intel.com/sites/default/files/managed/a7/15/ipp_userguide_0.pdf">Intel&reg; IPP User's Guide</a> (PDF link).</p>
-<p>Once the environment is configured, you can build using commercial IPP by specifying <code>--use-commercial-ipp</code> as a command line option.</p>
-<h1><a class="anchor" id="BuildingSdk_Examples"></a>
-Example Programs</h1>
-<p>The SDK includes several examples that show you different aspects of how the Intel&reg; EPID scheme works. In the SDK build, these examples are located in <code>_install/epid-sdk/example</code>.</p>
-<table class="doxtable">
-<tr>
-<th>Name </th><th>Description  </th></tr>
-<tr>
-<td><code>signmsg</code> </td><td>Create Intel&reg; EPID signature of message </td></tr>
-<tr>
-<td><code>verifysig</code> </td><td>Verify signature is from a group member in good standing </td></tr>
-</table>
-<h1><a class="anchor" id="BuildingSdk_PortingBuildSystem"></a>
-Building with Other Build Systems</h1>
-<p>It is relatively straightforward to port the SDK to your build system of choice. The following dependency diagram shows the relationship between components and the sources used to build them.</p>
-<div class="image">
-<img src="basicdoc.png" alt="basicdoc.png"/>
-</div>
-<p><br />
-</p>
-<p>Other names and brands may be claimed as the property of others. </p>
-</div></div><!-- contents -->
-</div><!-- doc-content -->
-<!-- HTML footer for doxygen 1.8.10-->
-<!-- start footer part -->
-<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
-  <ul>
-    <li class="footer">
-      &copy; 2016 Intel Corporation
-    </li>
-  </ul>
-</div>
-</body>
-</html>

+ 0 - 134
external/epid-sdk-3.0.0/doc/html/ChangeLog.html

@@ -1,134 +0,0 @@
-<!-- HTML header for doxygen 1.8.10-->
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
-<meta http-equiv="X-UA-Compatible" content="IE=9"/>
-<meta name="generator" content="Doxygen 1.8.11"/>
-<title>Intel&reg; Enhanced Privacy ID SDK: What&#39;s New</title>
-<link href="tabs.css" rel="stylesheet" type="text/css"/>
-<script type="text/javascript" src="jquery.js"></script>
-<script type="text/javascript" src="dynsections.js"></script>
-<link href="navtree.css" rel="stylesheet" type="text/css"/>
-<script type="text/javascript" src="resize.js"></script>
-<script type="text/javascript" src="navtreedata.js"></script>
-<script type="text/javascript" src="navtree.js"></script>
-<script type="text/javascript">
-  $(document).ready(initResizable);
-  $(window).load(resizeHeight);
-</script>
-<link href="doxygen.css" rel="stylesheet" type="text/css" />
-<link href="epidstyle.css" rel="stylesheet" type="text/css"/>
-</head>
-<body>
-<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
-<div id="titlearea">
-<table cellspacing="0" cellpadding="0">
- <tbody>
- <tr style="height: 56px;">
-  <td id="projectalign" style="padding-left: 0.5em;">
-   <div id="projectname"><a 
-                            onclick="storeLink('index.html')"
-                            id="projectlink" 
-                            class="index.html" 
-                            href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">3.0.0</span>
-</div>
-  </td>
- </tr>
- </tbody>
-</table>
-</div>
-<!-- end header part -->
-<!-- Generated by Doxygen 1.8.11 -->
-</div><!-- top -->
-<div id="side-nav" class="ui-resizable side-nav-resizable">
-  <div id="nav-tree">
-    <div id="nav-tree-contents">
-      <div id="nav-sync" class="sync"></div>
-    </div>
-  </div>
-  <div id="splitbar" style="-moz-user-select:none;" 
-       class="ui-resizable-handle">
-  </div>
-</div>
-<script type="text/javascript">
-$(document).ready(function(){initNavTree('ChangeLog.html','');});
-</script>
-<div id="doc-content">
-<div class="header">
-  <div class="headertitle">
-<div class="title">What's New </div>  </div>
-</div><!--header-->
-<div class="contents">
-<div class="textblock"><h2>[3.0.0]</h2>
-<h3>New in This Release</h3>
-<ul>
-<li>Support for verification of EPID 1.1 members.</li>
-<li>Make-based build system support.</li>
-<li>Sample material includes compressed keys.</li>
-<li>Enhanced documentation, including step-by-step walkthroughs of example applications.</li>
-<li>Validated on additional IoT platforms.<ul>
-<li>Ostro Linux</li>
-<li>Snappy Ubuntu Core</li>
-</ul>
-</li>
-</ul>
-<h3>Changes</h3>
-<ul>
-<li>A new verifier API has been added to set the basename to be used for verification. Verifier APIs that used to accept basenames now use the basename set via EpidVerifierSetBasename.</li>
-<li>The verifier pre-computation structure has been changed to include the group ID to allow detection of errors that result from providing a pre-computation blob from a different group to EpidVerifierCreate.</li>
-</ul>
-<h3>Fixes</h3>
-<ul>
-<li>The kEpidxxxRevoked enums have been renamed to be consistent with other result return values.</li>
-</ul>
-<h3>Known Issues</h3>
-<ul>
-<li>SHA-512/256 hash algorithm is not supported.</li>
-</ul>
-<h2>[2.0.0] - 2016-07-20</h2>
-<h3>New in This Release</h3>
-<ul>
-<li>Signed binary issuer material support.<ul>
-<li>Binary issuer material validation APIs.</li>
-<li>Updated sample issuer material.</li>
-<li>Updated samples that parse signed binary issuer material.</li>
-</ul>
-</li>
-<li>Compressed member private key support.</li>
-<li>Validated on additional IoT platforms.<ul>
-<li>Windows 10 IoT Core</li>
-<li>WindRiver IDP</li>
-</ul>
-</li>
-</ul>
-<h3>Changes</h3>
-<ul>
-<li>The default hash algorithm has changed. It is now SHA-512.</li>
-<li>Functions that returned <code>EpidNullPtrErr</code> now return <code>EpidBadArgErr</code> instead.</li>
-</ul>
-<h3>Fixes</h3>
-<ul>
-<li>Updated build flags to work around GCC 4.8.5 defect.</li>
-</ul>
-<h2>[1.0.0] - 2016-03-03</h2>
-<h3>New in This Release</h3>
-<ul>
-<li>Basic sign and verify functionality</li>
-<li>Dynamic join support for member</li>
-<li>Apache 2.0 License </li>
-</ul>
-</div></div><!-- contents -->
-</div><!-- doc-content -->
-<!-- HTML footer for doxygen 1.8.10-->
-<!-- start footer part -->
-<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
-  <ul>
-    <li class="footer">
-      &copy; 2016 Intel Corporation
-    </li>
-  </ul>
-</div>
-</body>
-</html>

+ 0 - 231
external/epid-sdk-3.0.0/doc/html/ChoosingiKGF.html

@@ -1,231 +0,0 @@
-<!-- HTML header for doxygen 1.8.10-->
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
-<meta http-equiv="X-UA-Compatible" content="IE=9"/>
-<meta name="generator" content="Doxygen 1.8.11"/>
-<title>Intel&reg; Enhanced Privacy ID SDK: If You Choose iKGF as Your Issuer</title>
-<link href="tabs.css" rel="stylesheet" type="text/css"/>
-<script type="text/javascript" src="jquery.js"></script>
-<script type="text/javascript" src="dynsections.js"></script>
-<link href="navtree.css" rel="stylesheet" type="text/css"/>
-<script type="text/javascript" src="resize.js"></script>
-<script type="text/javascript" src="navtreedata.js"></script>
-<script type="text/javascript" src="navtree.js"></script>
-<script type="text/javascript">
-  $(document).ready(initResizable);
-  $(window).load(resizeHeight);
-</script>
-<link href="doxygen.css" rel="stylesheet" type="text/css" />
-<link href="epidstyle.css" rel="stylesheet" type="text/css"/>
-</head>
-<body>
-<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
-<div id="titlearea">
-<table cellspacing="0" cellpadding="0">
- <tbody>
- <tr style="height: 56px;">
-  <td id="projectalign" style="padding-left: 0.5em;">
-   <div id="projectname"><a 
-                            onclick="storeLink('index.html')"
-                            id="projectlink" 
-                            class="index.html" 
-                            href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">3.0.0</span>
-</div>
-  </td>
- </tr>
- </tbody>
-</table>
-</div>
-<!-- end header part -->
-<!-- Generated by Doxygen 1.8.11 -->
-</div><!-- top -->
-<div id="side-nav" class="ui-resizable side-nav-resizable">
-  <div id="nav-tree">
-    <div id="nav-tree-contents">
-      <div id="nav-sync" class="sync"></div>
-    </div>
-  </div>
-  <div id="splitbar" style="-moz-user-select:none;" 
-       class="ui-resizable-handle">
-  </div>
-</div>
-<script type="text/javascript">
-$(document).ready(function(){initNavTree('ChoosingiKGF.html','');});
-</script>
-<div id="doc-content">
-<div class="header">
-  <div class="headertitle">
-<div class="title">If You Choose iKGF as Your Issuer </div>  </div>
-</div><!--header-->
-<div class="contents">
-<div class="toc"><h3>Table of Contents</h3>
-<ul><li class="level1"><a href="#RevocationTools">Tools for Creating Revocation Requests</a><ul><li class="level2"><a href="#RevocationTools_revokegrp">Requesting Group Revocation</a></li>
-<li class="level2"><a href="#RevocationTools_revokekey">Requesting Private Key Revocation</a></li>
-<li class="level2"><a href="#RevocationTools_revokesig">Requesting Signature Revocation</a></li>
-</ul>
-</li>
-<li class="level1"><a href="#ExtractionTools">Tools for Extracting Keys from iKGF Files</a><ul><li class="level2"><a href="#ExtractionTools_extractgrps">Extracting Group Public Keys</a></li>
-<li class="level2"><a href="#ExtractionTools_extractkeys">Extracting Member Private Keys</a></li>
-</ul>
-</li>
-</ul>
-</div>
-<div class="textblock"><p>To use the Intel&reg; EPID APIs, you need to use the following items that are created by the issuer:</p>
-<ul>
-<li>Group public key, which corresponds to the issuing private key kept by the issuer</li>
-<li>Member private keys</li>
-<li>Signature based revocation list (SigRL)</li>
-<li>Private key based revocation list (PrivRL)</li>
-<li>Group based revocation list (GroupRL)</li>
-</ul>
-<p>If you want to use the Intel Key Generation Facility (iKGF) as the issuer, contact <a href="#" onclick="location.href='mai'+'lto:'+'inf'+'o@'+'dig'+'it'+'al-'+'cp'+'.co'+'m'; return false;">info@<span style="display: none;">.nosp@m.</span>digi<span style="display: none;">.nosp@m.</span>tal-c<span style="display: none;">.nosp@m.</span>p.co<span style="display: none;">.nosp@m.</span>m</a> to get started.</p>
-<p>If you choose to use iKGF as the issuer, you can take advantage of tools included in the SDK that are designed to make it easier for you to interact with iKGF by creating requests to update revocation lists and by extracting member private keys and group public keys from iKGF files.</p>
-<h1><a class="anchor" id="RevocationTools"></a>
-Tools for Creating Revocation Requests</h1>
-<p>The Intel&reg; EPID SDK includes tools to help you request additions to revocation lists managed by iKGF if you are using iKGF as the issuer.</p>
-<p>These tools are designed to create a revocation request in the format required by iKGF. In order to update a revocation list, the requests generated by these tools must be submitted to the issuer.</p>
-<p>To access the tools, go to <code>_install/epid-sdk/tools</code> in the SDK directory.</p>
-<p>You need to build the SDK before you can use these tools. For more information, refer to <a class="el" href="BuildingSdk.html">Building from Source</a>.</p>
-<p>The following tools are available:</p>
-<table class="doxtable">
-<tr>
-<th>Tool </th><th>Purpose  </th></tr>
-<tr>
-<td><code>revokegrp</code> </td><td>Create group revocation request </td></tr>
-<tr>
-<td><code>revokekey</code> </td><td>Create member private key revocation request </td></tr>
-<tr>
-<td><code>revokesig</code> </td><td>Create signature revocation request </td></tr>
-</table>
-<h2><a class="anchor" id="RevocationTools_revokegrp"></a>
-Requesting Group Revocation</h2>
-<p>The <code>revokegrp</code> tool adds a group to the revocation request file. </p><pre class="fragment">Usage: revokegrp [OPTION]...
-Revoke Intel(R) EPID group
-
-Options:
-  --gpubkey=FILE
-      load group public key from FILE (default: pubkey.bin)
-
-  --capubkey=FILE
-      load IoT Issuing CA public key from FILE
-
-  --reason=NUM
-      revocation reason (default: 0)
-
-  --req=FILE
-      append group revocation request to FILE (default: grprlreq.dat)
-
-  -h, --help
-      display this help and exit
-
-  -v, --verbose
-      print status messages to stdout
-</pre><h2><a class="anchor" id="RevocationTools_revokekey"></a>
-Requesting Private Key Revocation</h2>
-<p>The <code>revokekey</code> tool adds a member private key to the revocation request file. </p><pre class="fragment">Usage: revokekey [OPTION]
-Revoke Intel(R) EPID private key
-
-Options:
-    --mprivkey=FILE
-        load private key to revoke from FILE (default: mprivkey.dat)
-
-    --req=FILE
-        append private key revocation request to FILE (default: privreq.dat)
-
-    -h, --help
-        display this help and exit
-
-    -v,--verbose
-        print status messages to stdout
-
-The following options are only needed for compressed keys:
-
-    --gpubkey=FILE
-        load group public key from FILE (default: pubkey.bin)
-
-    --capubkey=FILE
-        load IoT Issuing CA public key from FILE
-</pre><h2><a class="anchor" id="RevocationTools_revokesig"></a>
-Requesting Signature Revocation</h2>
-<p>The <code>revokesig</code> tool creates a request to add a signature to the revocation request file.</p>
-<p><code>revokesig</code> only accepts valid signatures for addition to the revocation request. </p><pre class="fragment">Usage: revokesig [OPTION]...
-Revoke Intel(R) EPID signature
-
-Options:
-  --sig=FILE
-      load signature to revoke from FILE (default: sig.dat)
-
-  --msg=MESSAGE
-      MESSAGE used to generate signature to revoke
-
-  --msgfile=FILE
-      FILE containing message used to generate signature to revoke
-
-  --gpubkey=FILE
-      load group public key from FILE (default: pubkey.bin)
-
-  --capubkey=FILE
-      load IoT Issuing CA public key from FILE
-
-  --req=FILE
-      append signature revocation request to FILE (default: sigrlreq.dat)
-
-  -h, --help
-      display this help and exit
-
-  -v, --verbose
-      print status messages to stdout
-</pre><h1><a class="anchor" id="ExtractionTools"></a>
-Tools for Extracting Keys from iKGF Files</h1>
-<p>The Intel&reg; EPID SDK includes tools to help you extract individual keys from files provided by the Intel Key Generation Facility (iKGF) if you are using iKGF as the issuer.</p>
-<p>To access the tools, go to <code>_install/epid-sdk/tools</code> in the SDK directory.</p>
-<p>You need to build the SDK before you can use these tools. For more information, refer to <a class="el" href="BuildingSdk.html">Building from Source</a>.</p>
-<p>The following tools are available:</p>
-<table class="doxtable">
-<tr>
-<th>Tool </th><th>Purpose  </th></tr>
-<tr>
-<td><code>extractgrps</code> </td><td>Extracts group public keys </td></tr>
-<tr>
-<td><code>extractkeys</code> </td><td>Extracts member private keys </td></tr>
-</table>
-<h2><a class="anchor" id="ExtractionTools_extractgrps"></a>
-Extracting Group Public Keys</h2>
-<p>The <code>extractgrps</code> tool extracts group public keys from the input file to the current directory. </p><pre class="fragment">Usage: extractgrps [OPTION]... [FILE] [NUM]
-Extract the first NUM group certs from FILE to current directory
-
-Options:
-  -h, --help
-      display this help and exit
-
-  -v, --verbose
-      print status messages to stdout
-</pre><h2><a class="anchor" id="ExtractionTools_extractkeys"></a>
-Extracting Member Private Keys</h2>
-<p>The <code>extractkeys</code> tool extracts member private keys from the input file to the current directory. </p><pre class="fragment">Usage: extractkeys [OPTION]... [FILE] [NUM]
-Extract the first NUM private keys from FILE to current directory.
-
-Options:
-  -c, --compressed
-      extract compressed keys
-
-  -h, --help
-      display this help and exit
-
-  -v, --verbose
-      print status messages to stdout</pre> </div></div><!-- contents -->
-</div><!-- doc-content -->
-<!-- HTML footer for doxygen 1.8.10-->
-<!-- start footer part -->
-<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
-  <ul>
-    <li class="footer">
-      &copy; 2016 Intel Corporation
-    </li>
-  </ul>
-</div>
-</body>
-</html>

+ 0 - 173
external/epid-sdk-3.0.0/doc/html/EpidOverview.html

@@ -1,173 +0,0 @@
-<!-- HTML header for doxygen 1.8.10-->
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
-<meta http-equiv="X-UA-Compatible" content="IE=9"/>
-<meta name="generator" content="Doxygen 1.8.11"/>
-<title>Intel&reg; Enhanced Privacy ID SDK: Introduction to the Intel&reg; EPID Scheme</title>
-<link href="tabs.css" rel="stylesheet" type="text/css"/>
-<script type="text/javascript" src="jquery.js"></script>
-<script type="text/javascript" src="dynsections.js"></script>
-<link href="navtree.css" rel="stylesheet" type="text/css"/>
-<script type="text/javascript" src="resize.js"></script>
-<script type="text/javascript" src="navtreedata.js"></script>
-<script type="text/javascript" src="navtree.js"></script>
-<script type="text/javascript">
-  $(document).ready(initResizable);
-  $(window).load(resizeHeight);
-</script>
-<link href="doxygen.css" rel="stylesheet" type="text/css" />
-<link href="epidstyle.css" rel="stylesheet" type="text/css"/>
-</head>
-<body>
-<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
-<div id="titlearea">
-<table cellspacing="0" cellpadding="0">
- <tbody>
- <tr style="height: 56px;">
-  <td id="projectalign" style="padding-left: 0.5em;">
-   <div id="projectname"><a 
-                            onclick="storeLink('index.html')"
-                            id="projectlink" 
-                            class="index.html" 
-                            href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">3.0.0</span>
-</div>
-  </td>
- </tr>
- </tbody>
-</table>
-</div>
-<!-- end header part -->
-<!-- Generated by Doxygen 1.8.11 -->
-</div><!-- top -->
-<div id="side-nav" class="ui-resizable side-nav-resizable">
-  <div id="nav-tree">
-    <div id="nav-tree-contents">
-      <div id="nav-sync" class="sync"></div>
-    </div>
-  </div>
-  <div id="splitbar" style="-moz-user-select:none;" 
-       class="ui-resizable-handle">
-  </div>
-</div>
-<script type="text/javascript">
-$(document).ready(function(){initNavTree('EpidOverview.html','');});
-</script>
-<div id="doc-content">
-<div class="header">
-  <div class="headertitle">
-<div class="title">Introduction to the Intel&reg; EPID Scheme </div>  </div>
-</div><!--header-->
-<div class="contents">
-<div class="toc"><h3>Table of Contents</h3>
-<ul><li class="level1"><a href="#EpidOverview_Roles">Roles</a><ul><li class="level2"><a href="#EpidOverview_Issuers">Issuers</a></li>
-<li class="level2"><a href="#EpidOverview_Members">Members</a></li>
-<li class="level2"><a href="#EpidOverview_Verifiers">Verifiers</a></li>
-</ul>
-</li>
-<li class="level1"><a href="#EpidOverview_Groups">Groups</a></li>
-<li class="level1"><a href="#EpidOverview_Keys">Keys</a><ul><li class="level2"><a href="#EpidOverview_Group_public_key">Group Public Key</a></li>
-<li class="level2"><a href="#EpidOverview_Issuing_private_key">Issuing Private Key</a></li>
-<li class="level2"><a href="#EpidOverview_Member_private_key">Member Private Key</a></li>
-</ul>
-</li>
-<li class="level1"><a href="#EpidOverview_Entity_interaction">Member and Verifier Interaction</a></li>
-</ul>
-</div>
-<div class="textblock"><p>Intel&reg; EPID is a cryptographic protocol which enables the remote authentication of a trusted platform whilst preserving the user's privacy.</p>
-<h1><a class="anchor" id="EpidOverview_Roles"></a>
-Roles</h1>
-<p>In the Intel&reg; EPID scheme, there are three roles: issuers, members, and verifiers.</p>
-<p>The entities in these roles interact with each other in such a way that a member can prove to a verifier that it is a trusted member of a group without disclosing the identity of the member. Groups are created and managed by the issuer.</p>
-<div class="image">
-<img src="epid_diagram_high_level_use_case.png" alt="epid_diagram_high_level_use_case.png"/>
-</div>
-<h2><a class="anchor" id="EpidOverview_Issuers"></a>
-Issuers</h2>
-<p>The issuer is responsible for managing group membership. Issuer functionality is not included in the SDK.</p>
-<p>The issuer manages groups by doing the following:</p>
-<ul>
-<li>Creates groups by generating one issuing private key and one group certificate for each group. The group certificate contains the group public key.</li>
-<li>Creates group members by generating unique Intel&reg; EPID member private keys through bulk provisioning. Member private keys are created from the issuing private key for the group.</li>
-<li>Manages requests from prospective members to join existing groups by using the join protocol.</li>
-<li>Creates and maintains signature based revocation lists and private key based revocation lists. These lists of members no longer in good standing allow members to be dropped from a group.</li>
-<li>Creates and maintains group revocation lists.</li>
-<li>Makes group public keys and revocation lists available to verifiers.</li>
-</ul>
-<div class="image">
-<img src="epid_diagram_issuer_high_level.png" alt="epid_diagram_issuer_high_level.png"/>
-</div>
-<h2><a class="anchor" id="EpidOverview_Members"></a>
-Members</h2>
-<p>The member is the entity that attempts to anonymously prove its group membership to the verifier.</p>
-<ul>
-<li>Members are authorized by the issuer as part of a group.</li>
-<li>Each group member has a unique Intel&reg; EPID private key, which corresponds to the group.</li>
-<li>The member uses its member private key to sign a message to prove group membership to the verifier without revealing the identity of the member.</li>
-</ul>
-<div class="image">
-<img src="epid_diagram_member_high_level.png" alt="epid_diagram_member_high_level.png"/>
-</div>
-<h2><a class="anchor" id="EpidOverview_Verifiers"></a>
-Verifiers</h2>
-<p>The verifier checks an Intel(R) EPID signature to establish whether it was signed by an entity or device that is a member in good standing.</p>
-<p>The verifier acts on behalf of a party that needs to know it is communicating with a trusted device. Verifiers obtain group certificates and revocation lists from issuers and negotiate details of signature protocol with members.</p>
-<p>A verifier can do the following:</p>
-<ul>
-<li>Confirm a member is in fact a member of a given group in good standing.</li>
-<li>Obtain group certificates and revocation lists from issuers.</li>
-<li>Negotiate details of signature protocol with members.</li>
-<li>Manage a private list of revoked members, also called the verifier blacklist.</li>
-</ul>
-<div class="image">
-<img src="epid_diagram_verifier_high_level.png" alt="epid_diagram_verifier_high_level.png"/>
-</div>
-<h1><a class="anchor" id="EpidOverview_Groups"></a>
-Groups</h1>
-<p>An Intel&reg; EPID group represents a set of trusted entities called members. Issuers create groups and manage group membership. For each group, the issuer creates a group public key simultaneously with the corresponding issuing private key. The issuer uses the issuing private key to create unique member private keys for each group member, and makes the group public key available to verifiers.</p>
-<p>All groups have the following:</p>
-<ul>
-<li>Group public key, which corresponds to the issuing private key kept by the issuer</li>
-<li>Signature based revocation list</li>
-<li>Private key based revocation list</li>
-<li>Member private keys, generated from the issuing private key</li>
-</ul>
-<p>If a signature based revocation list or private key based revocation list does not exist, it is assumed to be empty.</p>
-<h1><a class="anchor" id="EpidOverview_Keys"></a>
-Keys</h1>
-<p>The Intel&reg; EPID scheme works with three types of keys: the group public key, the issuing private key, and the member private key. A group public key corresponds to the unique member private keys that are part of the group. Member private keys are generated from the issuing private key.</p>
-<p>Additionally, in the Intel&reg; EPID scheme, a private key can be revoked given a signature created by that key, even if the key itself is still unknown. Group membership can be revoked and entire groups can be revoked. For more information on revocation, refer to <a class="el" href="Revocation.html">In-Depth Explanation of Revocation</a>.</p>
-<h2><a class="anchor" id="EpidOverview_Group_public_key"></a>
-Group Public Key</h2>
-<p>The group public key is the key used by the verifier to confirm that a member belongs to a group in good standing. Each member private key in a group is associated with the group's public key.</p>
-<p>When a group is created, the group public key and the issuing private key are simultaneously generated by the issuer. The verifier obtains the group public key from the issuer.</p>
-<h2><a class="anchor" id="EpidOverview_Issuing_private_key"></a>
-Issuing Private Key</h2>
-<p>The issuing private key is the key used by the issuer to generate unique private keys for each member of a given group. For every group public key, there is a corresponding issuing private key. The issuing private key remains with the issuer and is kept private.</p>
-<h2><a class="anchor" id="EpidOverview_Member_private_key"></a>
-Member Private Key</h2>
-<p>The member private key is the key used by the member to digitally sign a message when attempting to prove to the verifier that the member belongs to the group and is in good standing.</p>
-<p>Unique member private keys are generated by the issuer for each member of a given group. The same group public key corresponds to each member private key in the group.</p>
-<h1><a class="anchor" id="EpidOverview_Entity_interaction"></a>
-Member and Verifier Interaction</h1>
-<p>Each Intel&reg; EPID member uses its Intel&reg; EPID private key to digitally sign a message. The resulting signature is called an Intel&reg; EPID signature.</p>
-<p>The Intel&reg; EPID verifier uses the group public key to verify the correctness of an Intel&reg; EPID signature, i.e., to verify that the signature was indeed created by a member with a valid Intel&reg; EPID private key.</p>
-<p>However, the Intel&reg; EPID signature does not convey any information about which unique private key was used to create the signature.</p>
-<div class="image">
-<img src="epid_diagram_high_level_interaction.png" alt="epid_diagram_high_level_interaction.png"/>
-</div>
- </div></div><!-- contents -->
-</div><!-- doc-content -->
-<!-- HTML footer for doxygen 1.8.10-->
-<!-- start footer part -->
-<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
-  <ul>
-    <li class="footer">
-      &copy; 2016 Intel Corporation
-    </li>
-  </ul>
-</div>
-</body>
-</html>

+ 0 - 85
external/epid-sdk-3.0.0/doc/html/Examples.html

@@ -1,85 +0,0 @@
-<!-- HTML header for doxygen 1.8.10-->
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
-<meta http-equiv="X-UA-Compatible" content="IE=9"/>
-<meta name="generator" content="Doxygen 1.8.11"/>
-<title>Intel&reg; Enhanced Privacy ID SDK: Walkthroughs of Examples Showing API Usage</title>
-<link href="tabs.css" rel="stylesheet" type="text/css"/>
-<script type="text/javascript" src="jquery.js"></script>
-<script type="text/javascript" src="dynsections.js"></script>
-<link href="navtree.css" rel="stylesheet" type="text/css"/>
-<script type="text/javascript" src="resize.js"></script>
-<script type="text/javascript" src="navtreedata.js"></script>
-<script type="text/javascript" src="navtree.js"></script>
-<script type="text/javascript">
-  $(document).ready(initResizable);
-  $(window).load(resizeHeight);
-</script>
-<link href="doxygen.css" rel="stylesheet" type="text/css" />
-<link href="epidstyle.css" rel="stylesheet" type="text/css"/>
-</head>
-<body>
-<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
-<div id="titlearea">
-<table cellspacing="0" cellpadding="0">
- <tbody>
- <tr style="height: 56px;">
-  <td id="projectalign" style="padding-left: 0.5em;">
-   <div id="projectname"><a 
-                            onclick="storeLink('index.html')"
-                            id="projectlink" 
-                            class="index.html" 
-                            href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">3.0.0</span>
-</div>
-  </td>
- </tr>
- </tbody>
-</table>
-</div>
-<!-- end header part -->
-<!-- Generated by Doxygen 1.8.11 -->
-</div><!-- top -->
-<div id="side-nav" class="ui-resizable side-nav-resizable">
-  <div id="nav-tree">
-    <div id="nav-tree-contents">
-      <div id="nav-sync" class="sync"></div>
-    </div>
-  </div>
-  <div id="splitbar" style="-moz-user-select:none;" 
-       class="ui-resizable-handle">
-  </div>
-</div>
-<script type="text/javascript">
-$(document).ready(function(){initNavTree('Examples.html','');});
-</script>
-<div id="doc-content">
-<div class="header">
-  <div class="headertitle">
-<div class="title">Walkthroughs of Examples Showing API Usage </div>  </div>
-</div><!--header-->
-<div class="contents">
-<div class="textblock"><p>Several example applications are included that demonstrate how to use the SDK APIs.</p>
-<table class="doxtable">
-<tr>
-<th>Example Application </th><th>Concept Demonstrated  </th></tr>
-<tr>
-<td><code>signmsg</code> </td><td><a class="el" href="SignmsgWalkthru.html">Generating an Intel&reg; EPID Signature</a> </td></tr>
-<tr>
-<td><code>verifysig</code> </td><td><a class="el" href="VerifysigWalkthru.html">Verifying an Intel&reg; EPID Signature</a> </td></tr>
-</table>
-</div></div><!-- contents -->
-</div><!-- doc-content -->
-<!-- HTML footer for doxygen 1.8.10-->
-<!-- start footer part -->
-<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
-  <ul>
-    <li class="footer">
-      &copy; 2016 Intel Corporation
-    </li>
-  </ul>
-</div>
-</body>
-</html>

+ 0 - 5
external/epid-sdk-3.0.0/doc/html/Examples.js

@@ -1,5 +0,0 @@
-var Examples =
-[
-    [ "Generating an Intel® EPID Signature", "SignmsgWalkthru.html", null ],
-    [ "Verifying an Intel® EPID Signature", "VerifysigWalkthru.html", null ]
-];

+ 0 - 174
external/epid-sdk-3.0.0/doc/html/Glossary.html

@@ -1,174 +0,0 @@
-<!-- HTML header for doxygen 1.8.10-->
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
-<meta http-equiv="X-UA-Compatible" content="IE=9"/>
-<meta name="generator" content="Doxygen 1.8.11"/>
-<title>Intel&reg; Enhanced Privacy ID SDK: Glossary</title>
-<link href="tabs.css" rel="stylesheet" type="text/css"/>
-<script type="text/javascript" src="jquery.js"></script>
-<script type="text/javascript" src="dynsections.js"></script>
-<link href="navtree.css" rel="stylesheet" type="text/css"/>
-<script type="text/javascript" src="resize.js"></script>
-<script type="text/javascript" src="navtreedata.js"></script>
-<script type="text/javascript" src="navtree.js"></script>
-<script type="text/javascript">
-  $(document).ready(initResizable);
-  $(window).load(resizeHeight);
-</script>
-<link href="doxygen.css" rel="stylesheet" type="text/css" />
-<link href="epidstyle.css" rel="stylesheet" type="text/css"/>
-</head>
-<body>
-<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
-<div id="titlearea">
-<table cellspacing="0" cellpadding="0">
- <tbody>
- <tr style="height: 56px;">
-  <td id="projectalign" style="padding-left: 0.5em;">
-   <div id="projectname"><a 
-                            onclick="storeLink('index.html')"
-                            id="projectlink" 
-                            class="index.html" 
-                            href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">3.0.0</span>
-</div>
-  </td>
- </tr>
- </tbody>
-</table>
-</div>
-<!-- end header part -->
-<!-- Generated by Doxygen 1.8.11 -->
-</div><!-- top -->
-<div id="side-nav" class="ui-resizable side-nav-resizable">
-  <div id="nav-tree">
-    <div id="nav-tree-contents">
-      <div id="nav-sync" class="sync"></div>
-    </div>
-  </div>
-  <div id="splitbar" style="-moz-user-select:none;" 
-       class="ui-resizable-handle">
-  </div>
-</div>
-<script type="text/javascript">
-$(document).ready(function(){initNavTree('Glossary.html','');});
-</script>
-<div id="doc-content">
-<div class="header">
-  <div class="headertitle">
-<div class="title">Glossary </div>  </div>
-</div><!--header-->
-<div class="contents">
-<div class="toc"><h3>Table of Contents</h3>
-<ul><li class="level1"><a href="#Issuing_CA">CA public key</a></li>
-<li class="level1"><a href="#Glossary_Daa">DAA</a></li>
-<li class="level1"><a href="#Glossary_EllipticCurve">Elliptic curve</a></li>
-<li class="level1"><a href="#Glossary_EllipticCurvePoint">Elliptic curve point</a></li>
-<li class="level1"><a href="#Glossary_Group">Group</a></li>
-<li class="level1"><a href="#Glossary_Group_certificate">Group certificate</a></li>
-<li class="level1"><a href="#Glossary_GroupPublicKey">Group public key</a></li>
-<li class="level1"><a href="#Glossary_Epid">Intel&reg; EPID</a></li>
-<li class="level1"><a href="#Glossary_EpidSignature">Intel&reg; EPID signature</a></li>
-<li class="level1"><a href="#Glossary_Issuer">Issuer</a></li>
-<li class="level1"><a href="#Glossary_IssuingPrivateKey">Issuing private key</a></li>
-<li class="level1"><a href="#Glossary_Member">Member</a></li>
-<li class="level1"><a href="#Glossary_NameBasedSignature">Name-based signature</a></li>
-<li class="level1"><a href="#Glossary_MemberPrivateKey">Member private key</a></li>
-<li class="level1"><a href="#Glossary_NonRevokedProof">Non-revoked proof</a></li>
-<li class="level1"><a href="#Glossary_Pairing">Pairing</a></li>
-<li class="level1"><a href="#Glossary_Revocation">Revocation, revocation lists</a></li>
-<li class="level1"><a href="#Glossary_Verifier">Verifier</a></li>
-</ul>
-</div>
-<div class="textblock"><h1><a class="anchor" id="Issuing_CA"></a>
-CA public key</h1>
-<p>The CA (Certificate Authority) public key contains the ECDSA public key of the issuing CA. The verifier uses this key to authenticate that information provided by the issuer is genuine.</p>
-<h1><a class="anchor" id="Glossary_Daa"></a>
-DAA</h1>
-<p>Direct Anonymous Attestation (DAA) is a digital signature algorithm that supports anonymity by providing a group public verification key associated with many unique private signing keys. Intel&reg; EPID enhances DAA by enabling a private key to be revoked given a signature created by that key, even if the key itself is still unknown.</p>
-<h1><a class="anchor" id="Glossary_EllipticCurve"></a>
-Elliptic curve</h1>
-<p>In elliptic curve cryptography, an elliptic curve is an algebraic structure used to create a function whose output is easy to compute, but whose input is difficult to compute given the output. Elliptic curve cryptography requires smaller keys compared to non-elliptic curve cryptography (based on Galois fields) to provide equivalent security.</p>
-<h1><a class="anchor" id="Glossary_EllipticCurvePoint"></a>
-Elliptic curve point</h1>
-<p>An elliptic curve point is a point along an elliptic curve. The security of elliptic curve cryptography depends on the ability to compute a point multiplication and the inability to compute the multiplicand given the original and product points.</p>
-<h1><a class="anchor" id="Glossary_Group"></a>
-Group</h1>
-<p>An Intel&reg; EPID group represents a set of trusted entities called members.</p>
-<p>Issuers create groups and manage group membership. For each group, the issuer creates a group public key simultaneously with the corresponding issuing private key. The issuer uses the issuing private key to create unique member private keys for each group member, and makes the group public key available to verifiers.</p>
-<p>All groups have the following:</p>
-<ul>
-<li>Group public key, which corresponds to the issuing private key kept by the issuer</li>
-<li>Signature based revocation list</li>
-<li>Private key based revocation list</li>
-<li>Member private keys, generated from the issuing private key</li>
-</ul>
-<p>If a signature based revocation list or private key based revocation list does not exist, it is assumed to be empty.</p>
-<h1><a class="anchor" id="Glossary_Group_certificate"></a>
-Group certificate</h1>
-<p>The group certificate contains the group public key. The group certificate is created by the issuer and obtained by the verifier. When the issuer creates groups, it generates one issuing private key and one group certificate for each group.</p>
-<h1><a class="anchor" id="Glossary_GroupPublicKey"></a>
-Group public key</h1>
-<p>The group public key is the key used by the verifier to confirm that a member belongs to a group in good standing. Each member private key in a group is associated with the group's public key.</p>
-<p>When a group is created, the group public key and the issuing private key are simultaneously generated by the issuer. The verifier obtains the group public key from the issuer.</p>
-<h1><a class="anchor" id="Glossary_Epid"></a>
-Intel® EPID</h1>
-<p>Enhanced Privacy ID (Intel&reg; EPID) is a cryptographic protocol for attestation of a trusted platform while preserving the user's privacy. Intel&reg; EPID can be used as a foundational building block for a multitude of security solutions.</p>
-<h1><a class="anchor" id="Glossary_EpidSignature"></a>
-Intel® EPID signature</h1>
-<p>An Intel&reg; EPID signature is a type of digital signature that preserves anonymity of the signer, while still proving the signer is a member of a trusted group.</p>
-<h1><a class="anchor" id="Glossary_Issuer"></a>
-Issuer</h1>
-<p>The issuer is the entity in the Intel&reg; EPID scheme that is responsible for managing group membership. Issuer APIs are not included in the SDK. An example of an issuer is the Intel Key Generation Facility. For sample issuer material, refer to <a class="el" href="IssuerMaterial.html">Sample Issuer Material</a>. For tools that can help you if you choose to use iKGF as your issuer, refer to <a class="el" href="ChoosingiKGF.html">If You Choose iKGF as Your Issuer</a>.</p>
-<p>The issuer manages groups by doing the following:</p>
-<ul>
-<li>Creates groups by generating one issuing private key and one group certificate for each group. The group certificate contains the group public key.</li>
-<li>Creates group members by generating unique Intel&reg; EPID member private keys through bulk provisioning. Member private keys are created from the issuing private key for the group.</li>
-<li>Manages requests from prospective members to join existing groups by using the join protocol.</li>
-<li>Creates and maintains signature based revocation lists and private key based revocation lists. These lists of members no longer in good standing allow members to be dropped from a group.</li>
-<li>Creates and maintains group revocation lists.</li>
-<li>Makes group public keys and revocation lists available to verifiers.</li>
-</ul>
-<h1><a class="anchor" id="Glossary_IssuingPrivateKey"></a>
-Issuing private key</h1>
-<p>The issuing private key is the key used by the issuer to generate unique private keys for each member of a given group. For every group public key, there is a corresponding issuing private key. The issuing private key remains with the issuer and is kept private.</p>
-<h1><a class="anchor" id="Glossary_Member"></a>
-Member</h1>
-<p>The member is the entity that attempts to prove its group membership to the verifier. Members are authorized by the issuer as part of a group and each group member has a unique Intel&reg; EPID private key. The member uses its member private key to sign a message to prove group membership without revealing its identity. An example of a member is a PC with an embedded Intel&reg; EPID member private key.</p>
-<h1><a class="anchor" id="Glossary_NameBasedSignature"></a>
-Name-based signature</h1>
-<p>A name-based signature is a type of signature that gives the verifier the ability to link Intel&reg; EPID signatures from the same member, reducing the member's privacy.</p>
-<p>A name-based signature is created using the additional parameter of a basename. If a basename is not specified, a random number is chosen as the basename. If the member uses the same basename, the verifier can mathematically link signatures generated by the member, showing that the signatures are from the same member.</p>
-<h1><a class="anchor" id="Glossary_MemberPrivateKey"></a>
-Member private key</h1>
-<p>The member private key is the key used by the member to digitally sign a message when attempting to prove to the verifier that the member belongs to the group and is in good standing.</p>
-<p>Unique member private keys are generated by the issuer for each member of a given group. The same group public key corresponds to each member private key in the group.</p>
-<h1><a class="anchor" id="Glossary_NonRevokedProof"></a>
-Non-revoked proof</h1>
-<p>A non-revoked proof is part of an Intel&reg; EPID signature that proves that the member is not a specific revoked entity in the signature based revocation list. The member provides the signature with a number of non-revoked proofs, one per revocation list entry, to prove to the verifier that the member does not correspond to any entry in the revocation list.</p>
-<h1><a class="anchor" id="Glossary_Pairing"></a>
-Pairing</h1>
-<p>Pairing is a mathematical operation that maps two elliptic curve groups to a third multiplicative group.</p>
-<h1><a class="anchor" id="Glossary_Revocation"></a>
-Revocation, revocation lists</h1>
-<p>Revocation lists are data structures used by the verifier to identify members that are no longer approved members of the group.</p>
-<p>The verifier obtains the member private key based revocation list (PrivRL), signature based revocation list (SigRL), and group based revocation list (GroupRL) from the issuer. The verifier can also maintain its own verifier blacklist (VerifierRL). Verifier blacklist revocation only works with name based signatures.</p>
-<h1><a class="anchor" id="Glossary_Verifier"></a>
-Verifier</h1>
-<p>The verifier is the entity that checks an Intel&reg; EPID signature to establish whether it was signed by an entity or device that is a member in good standing.</p>
-<p>The verifier acts on behalf of a party that needs to know it is communicating with a trusted device. Verifiers obtain group certificates and revocation lists from issuers and negotiate details of signature protocol with members. </p>
-</div></div><!-- contents -->
-</div><!-- doc-content -->
-<!-- HTML footer for doxygen 1.8.10-->
-<!-- start footer part -->
-<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
-  <ul>
-    <li class="footer">
-      &copy; 2016 Intel Corporation
-    </li>
-  </ul>
-</div>
-</body>
-</html>

File diff suppressed because it is too large
+ 0 - 91
external/epid-sdk-3.0.0/doc/html/ImplementationNotes.html


+ 0 - 293
external/epid-sdk-3.0.0/doc/html/IssuerMaterial.html

@@ -1,293 +0,0 @@
-<!-- HTML header for doxygen 1.8.10-->
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
-<meta http-equiv="X-UA-Compatible" content="IE=9"/>
-<meta name="generator" content="Doxygen 1.8.11"/>
-<title>Intel&reg; Enhanced Privacy ID SDK: Sample Issuer Material</title>
-<link href="tabs.css" rel="stylesheet" type="text/css"/>
-<script type="text/javascript" src="jquery.js"></script>
-<script type="text/javascript" src="dynsections.js"></script>
-<link href="navtree.css" rel="stylesheet" type="text/css"/>
-<script type="text/javascript" src="resize.js"></script>
-<script type="text/javascript" src="navtreedata.js"></script>
-<script type="text/javascript" src="navtree.js"></script>
-<script type="text/javascript">
-  $(document).ready(initResizable);
-  $(window).load(resizeHeight);
-</script>
-<link href="doxygen.css" rel="stylesheet" type="text/css" />
-<link href="epidstyle.css" rel="stylesheet" type="text/css"/>
-</head>
-<body>
-<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
-<div id="titlearea">
-<table cellspacing="0" cellpadding="0">
- <tbody>
- <tr style="height: 56px;">
-  <td id="projectalign" style="padding-left: 0.5em;">
-   <div id="projectname"><a 
-                            onclick="storeLink('index.html')"
-                            id="projectlink" 
-                            class="index.html" 
-                            href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">3.0.0</span>
-</div>
-  </td>
- </tr>
- </tbody>
-</table>
-</div>
-<!-- end header part -->
-<!-- Generated by Doxygen 1.8.11 -->
-</div><!-- top -->
-<div id="side-nav" class="ui-resizable side-nav-resizable">
-  <div id="nav-tree">
-    <div id="nav-tree-contents">
-      <div id="nav-sync" class="sync"></div>
-    </div>
-  </div>
-  <div id="splitbar" style="-moz-user-select:none;" 
-       class="ui-resizable-handle">
-  </div>
-</div>
-<script type="text/javascript">
-$(document).ready(function(){initNavTree('IssuerMaterial.html','');});
-</script>
-<div id="doc-content">
-<div class="header">
-  <div class="headertitle">
-<div class="title">Sample Issuer Material </div>  </div>
-</div><!--header-->
-<div class="contents">
-<div class="toc"><h3>Table of Contents</h3>
-<ul><li class="level1"><a href="#IssuerMaterial_Groups">Sample Groups</a><ul><li class="level2"><a href="#IssuerMaterial_Groups_groupa">Sample Group A</a></li>
-<li class="level2"><a href="#IssuerMaterial_Groups_groupb">Sample Group B</a></li>
-</ul>
-</li>
-<li class="level1"><a href="#IssuerMaterial_GroupRls">Group Based Revocation Lists</a></li>
-<li class="level1"><a href="#IssuerMaterial_CmpGroups">Compressed Member Private Key</a><ul><li class="level2"><a href="#IssuerMaterial_CmpGroups_groupa">Compressed Sample Group A</a></li>
-<li class="level2"><a href="#IssuerMaterial_CmpGroups_groupb">Compressed Sample Group B</a></li>
-</ul>
-</li>
-<li class="level1"><a href="#IssuerMaterial_CmpGroupRls">Compressed Group Based Revocation Lists</a></li>
-</ul>
-</div>
-<div class="textblock"><p>The Intel&reg; EPID SDK does not include issuer APIs. That means you cannot generate the following items for validation:</p>
-<ul>
-<li>Group public key, which corresponds to the issuing private key kept by the issuer</li>
-<li>Member private keys</li>
-<li>Signature based revocation list (SigRL)</li>
-<li>Private key based revocation list (PrivRL)</li>
-<li>Group based revocation list (GroupRL)</li>
-</ul>
-<p>For validation purposes, you can use pre-generated sample data. This sample issuer material includes sample groups and revocation lists.</p>
-<p>Sample compressed key material is not included in the package.</p>
-<h1><a class="anchor" id="IssuerMaterial_Groups"></a>
-Sample Groups</h1>
-<h2><a class="anchor" id="IssuerMaterial_Groups_groupa"></a>
-Sample Group A</h2>
-<p>Group A (<code>groupa</code>) contains eight group members and sample revocation lists:</p>
-<p><br />
-</p>
-<h3>Members in Group A</h3>
-<table class="doxtable">
-<tr>
-<th>Group Member </th><th>Revocation Status  </th></tr>
-<tr>
-<td>groupa/member0 </td><td>Non-revoked </td></tr>
-<tr>
-<td>groupa/member1 </td><td>Non-revoked </td></tr>
-<tr>
-<td>groupa/privrevokedmember0 </td><td>Revoked in PrivRL </td></tr>
-<tr>
-<td>groupa/privrevokedmember1 </td><td>Revoked in PrivRL </td></tr>
-<tr>
-<td>groupa/privrevokedmember2 </td><td>Revoked in PrivRL </td></tr>
-<tr>
-<td>groupa/sigrevokedmember0 </td><td>Revoked in SigRL </td></tr>
-<tr>
-<td>groupa/sigrevokedmember1 </td><td>Revoked in SigRL </td></tr>
-<tr>
-<td>groupa/sigrevokedmember2 </td><td>Revoked in SigRL </td></tr>
-</table>
-<p><br />
-</p>
-<h3>Revocation Lists for Group A</h3>
-<table class="doxtable">
-<tr>
-<th>Description </th><th>Directory Location </th><th>Revoked Members  </th></tr>
-<tr>
-<td>Private key based revocation list </td><td><code>groupa/privrl.bin</code> </td><td>privrevokedmember0, <br />
- privrevokedmember1, <br />
- privrevokedmember2 </td></tr>
-<tr>
-<td>Signature based revocation list </td><td><code>groupa/sigrl.bin</code> </td><td>sigrevokedmember0, <br />
- sigrevokedmember1, <br />
- sigrevokedmember2 </td></tr>
-<tr>
-<td>Empty private key based revocation list </td><td><code>groupa/privrl_empty.bin</code> </td><td>None </td></tr>
-<tr>
-<td>Empty signature based revocation list </td><td><code>groupa/sigrl_empty.bin</code> </td><td>None </td></tr>
-</table>
-<p><br />
-</p>
-<h2><a class="anchor" id="IssuerMaterial_Groups_groupb"></a>
-Sample Group B</h2>
-<p>Group B (<code>groupb</code>) contains four group members and sample revocation lists:</p>
-<p><br />
-</p>
-<h3>Members in Group B</h3>
-<table class="doxtable">
-<tr>
-<th>Group Member </th><th>Revocation Status  </th></tr>
-<tr>
-<td>groupb/member0 </td><td>Non-revoked </td></tr>
-<tr>
-<td>groupb/member1 </td><td>Non-revoked </td></tr>
-<tr>
-<td>groupb/privrevokedmember0 </td><td>Revoked in PrivRL </td></tr>
-<tr>
-<td>groupb/sigrevokedmember0 </td><td>Revoked in SigRL </td></tr>
-</table>
-<p><br />
-</p>
-<h3>Revocation Lists for Group B</h3>
-<table class="doxtable">
-<tr>
-<th>Description </th><th>Directory Location </th><th>Revoked Members  </th></tr>
-<tr>
-<td>Private key based revocation list </td><td><code>groupb/privrl.bin</code> </td><td>privrevokedmember0 </td></tr>
-<tr>
-<td>Signature based revocation list </td><td><code>groupb/sigrl.bin</code> </td><td>sigrevokedmember0 </td></tr>
-<tr>
-<td>Empty private key based revocation list </td><td><code>groupb/privrl_empty.bin</code> </td><td>None </td></tr>
-<tr>
-<td>Empty signature based revocation list </td><td><code>groupb/sigrl_empty.bin</code> </td><td>None </td></tr>
-</table>
-<h1><a class="anchor" id="IssuerMaterial_GroupRls"></a>
-Group Based Revocation Lists</h1>
-<p>If an entire group is no longer valid, the issuer can revoke it using the group based revocation list. Two sample group based revocation lists are provided with the SDK.</p>
-<p><br />
-</p>
-<h3>Sample GrpRLs</h3>
-<table class="doxtable">
-<tr>
-<th>Group Based Revocation List </th><th>Description  </th></tr>
-<tr>
-<td><code>grprl_empty.bin</code> </td><td>No entries </td></tr>
-<tr>
-<td><code>grprl.bin</code> </td><td>One entry in which <code>groupb</code> is revoked </td></tr>
-</table>
-<h1><a class="anchor" id="IssuerMaterial_CmpGroups"></a>
-Compressed Member Private Key</h1>
-<p>Sample Groups</p>
-<p>Intel&reg; EPID SDK supports use of compressed member private keys. The groups described here use compressed compressed member private keys but structuarlly corospond to groups described above.</p>
-<h2><a class="anchor" id="IssuerMaterial_CmpGroups_groupa"></a>
-Compressed Sample Group A</h2>
-<p>Group A (<code>groupa</code>) contains eight group members and sample revocation lists:</p>
-<p><br />
-</p>
-<h3>Members in Group A</h3>
-<table class="doxtable">
-<tr>
-<th>Group Member </th><th>Revocation Status  </th></tr>
-<tr>
-<td>groupa/member0 </td><td>Non-revoked </td></tr>
-<tr>
-<td>groupa/member1 </td><td>Non-revoked </td></tr>
-<tr>
-<td>groupa/privrevokedmember0 </td><td>Revoked in PrivRL </td></tr>
-<tr>
-<td>groupa/privrevokedmember1 </td><td>Revoked in PrivRL </td></tr>
-<tr>
-<td>groupa/privrevokedmember2 </td><td>Revoked in PrivRL </td></tr>
-<tr>
-<td>groupa/sigrevokedmember0 </td><td>Revoked in SigRL </td></tr>
-<tr>
-<td>groupa/sigrevokedmember1 </td><td>Revoked in SigRL </td></tr>
-<tr>
-<td>groupa/sigrevokedmember2 </td><td>Revoked in SigRL </td></tr>
-</table>
-<p><br />
-</p>
-<h3>Revocation Lists for Group A</h3>
-<table class="doxtable">
-<tr>
-<th>Description </th><th>Directory Location </th><th>Revoked Members  </th></tr>
-<tr>
-<td>Private key based revocation list </td><td><code>groupa/privrl.bin</code> </td><td>privrevokedmember0, <br />
- privrevokedmember1, <br />
- privrevokedmember2 </td></tr>
-<tr>
-<td>Signature based revocation list </td><td><code>groupa/sigrl.bin</code> </td><td>sigrevokedmember0, <br />
- sigrevokedmember1, <br />
- sigrevokedmember2 </td></tr>
-<tr>
-<td>Empty private key based revocation list </td><td><code>groupa/privrl_empty.bin</code> </td><td>None </td></tr>
-<tr>
-<td>Empty signature based revocation list </td><td><code>groupa/sigrl_empty.bin</code> </td><td>None </td></tr>
-</table>
-<p><br />
-</p>
-<h2><a class="anchor" id="IssuerMaterial_CmpGroups_groupb"></a>
-Compressed Sample Group B</h2>
-<p>Group B (<code>groupb</code>) contains four group members and sample revocation lists:</p>
-<p><br />
-</p>
-<h3>Members in Group B</h3>
-<table class="doxtable">
-<tr>
-<th>Group Member </th><th>Revocation Status  </th></tr>
-<tr>
-<td>groupb/member0 </td><td>Non-revoked </td></tr>
-<tr>
-<td>groupb/member1 </td><td>Non-revoked </td></tr>
-<tr>
-<td>groupb/privrevokedmember0 </td><td>Revoked in PrivRL </td></tr>
-<tr>
-<td>groupb/sigrevokedmember0 </td><td>Revoked in SigRL </td></tr>
-</table>
-<p><br />
-</p>
-<h3>Revocation Lists for Group B</h3>
-<table class="doxtable">
-<tr>
-<th>Description </th><th>Directory Location </th><th>Revoked Members  </th></tr>
-<tr>
-<td>Private key based revocation list </td><td><code>groupb/privrl.bin</code> </td><td>privrevokedmember0 </td></tr>
-<tr>
-<td>Signature based revocation list </td><td><code>groupb/sigrl.bin</code> </td><td>sigrevokedmember0 </td></tr>
-<tr>
-<td>Empty private key based revocation list </td><td><code>groupb/privrl_empty.bin</code> </td><td>None </td></tr>
-<tr>
-<td>Empty signature based revocation list </td><td><code>groupb/sigrl_empty.bin</code> </td><td>None </td></tr>
-</table>
-<h1><a class="anchor" id="IssuerMaterial_CmpGroupRls"></a>
-Compressed Group Based Revocation Lists</h1>
-<p>If an entire group is no longer valid, the issuer can revoke it using the group based revocation list. Two sample group based revocation lists are provided with the SDK.</p>
-<p><br />
-</p>
-<h3>Sample GrpRLs</h3>
-<table class="doxtable">
-<tr>
-<th>Group Based Revocation List </th><th>Description  </th></tr>
-<tr>
-<td><code>grprl_empty.bin</code> </td><td>No entries </td></tr>
-<tr>
-<td><code>grprl.bin</code> </td><td>One entry in which <code>groupb</code> is revoked </td></tr>
-</table>
-</div></div><!-- contents -->
-</div><!-- doc-content -->
-<!-- HTML footer for doxygen 1.8.10-->
-<!-- start footer part -->
-<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
-  <ul>
-    <li class="footer">
-      &copy; 2016 Intel Corporation
-    </li>
-  </ul>
-</div>
-</body>
-</html>

+ 0 - 84
external/epid-sdk-3.0.0/doc/html/LegalInformation.html

@@ -1,84 +0,0 @@
-<!-- HTML header for doxygen 1.8.10-->
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
-<meta http-equiv="X-UA-Compatible" content="IE=9"/>
-<meta name="generator" content="Doxygen 1.8.11"/>
-<title>Intel&reg; Enhanced Privacy ID SDK: Legal Information</title>
-<link href="tabs.css" rel="stylesheet" type="text/css"/>
-<script type="text/javascript" src="jquery.js"></script>
-<script type="text/javascript" src="dynsections.js"></script>
-<link href="navtree.css" rel="stylesheet" type="text/css"/>
-<script type="text/javascript" src="resize.js"></script>
-<script type="text/javascript" src="navtreedata.js"></script>
-<script type="text/javascript" src="navtree.js"></script>
-<script type="text/javascript">
-  $(document).ready(initResizable);
-  $(window).load(resizeHeight);
-</script>
-<link href="doxygen.css" rel="stylesheet" type="text/css" />
-<link href="epidstyle.css" rel="stylesheet" type="text/css"/>
-</head>
-<body>
-<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
-<div id="titlearea">
-<table cellspacing="0" cellpadding="0">
- <tbody>
- <tr style="height: 56px;">
-  <td id="projectalign" style="padding-left: 0.5em;">
-   <div id="projectname"><a 
-                            onclick="storeLink('index.html')"
-                            id="projectlink" 
-                            class="index.html" 
-                            href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">3.0.0</span>
-</div>
-  </td>
- </tr>
- </tbody>
-</table>
-</div>
-<!-- end header part -->
-<!-- Generated by Doxygen 1.8.11 -->
-</div><!-- top -->
-<div id="side-nav" class="ui-resizable side-nav-resizable">
-  <div id="nav-tree">
-    <div id="nav-tree-contents">
-      <div id="nav-sync" class="sync"></div>
-    </div>
-  </div>
-  <div id="splitbar" style="-moz-user-select:none;" 
-       class="ui-resizable-handle">
-  </div>
-</div>
-<script type="text/javascript">
-$(document).ready(function(){initNavTree('LegalInformation.html','');});
-</script>
-<div id="doc-content">
-<div class="header">
-  <div class="headertitle">
-<div class="title">Legal Information </div>  </div>
-</div><!--header-->
-<div class="contents">
-<div class="textblock"><p>INFORMATION IN THIS DOCUMENT IS PROVIDED IN CONNECTION WITH INTEL&reg; PRODUCTS. NO LICENSE, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, TO ANY INTELLECTUAL PROPERTY RIGHTS IS GRANTED BY THIS DOCUMENT. EXCEPT AS PROVIDED IN INTEL'S TERMS AND CONDITIONS OF SALE FOR SUCH PRODUCTS, INTEL ASSUMES NO LIABILITY WHATSOEVER, AND INTEL DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY, RELATING TO SALE AND/OR USE OF INTEL PRODUCTS INCLUDING LIABILITY OR WARRANTIES RELATING TO FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT.</p>
-<p>UNLESS OTHERWISE AGREED IN WRITING BY INTEL, THE INTEL PRODUCTS ARE NOT DESIGNED NOR INTENDED FOR ANY APPLICATION IN WHICH THE FAILURE OF THE INTEL PRODUCT COULD CREATE A SITUATION WHERE PERSONAL INJURY OR DEATH MAY OCCUR.</p>
-<p>Intel may make changes to specifications and product descriptions at any time, without notice. Designers must not rely on the absence or characteristics of any features or instructions marked "reserved" or "undefined." Intel reserves these for future definition and shall have no responsibility whatsoever for conflicts or incompatibilities arising from future changes to them. The information here is subject to change without notice. Do not finalize a design with this information.</p>
-<p>The products described in this document may contain design defects or errors known as errata which may cause the product to deviate from published specifications. Current characterized errata are available on request.</p>
-<p>Contact your local Intel sales office or your distributor to obtain the latest specifications and before placing your product order.</p>
-<p>Copies of documents which have an order number and are referenced in this document, or other Intel literature, may be obtained by calling 1-800-548-4725, or by visiting Intel's web site <a href="http://www.intel.com">http://www.intel.com</a>.</p>
-<p>Intel and the Intel logo are trademarks of Intel Corporation in the U.S. and other countries.</p>
-<p>*Other names and brands may be claimed as the property of others. </p>
-</div></div><!-- contents -->
-</div><!-- doc-content -->
-<!-- HTML footer for doxygen 1.8.10-->
-<!-- start footer part -->
-<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
-  <ul>
-    <li class="footer">
-      &copy; 2016 Intel Corporation
-    </li>
-  </ul>
-</div>
-</body>
-</html>

+ 0 - 142
external/epid-sdk-3.0.0/doc/html/Revocation.html

@@ -1,142 +0,0 @@
-<!-- HTML header for doxygen 1.8.10-->
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
-<meta http-equiv="X-UA-Compatible" content="IE=9"/>
-<meta name="generator" content="Doxygen 1.8.11"/>
-<title>Intel&reg; Enhanced Privacy ID SDK: In-Depth Explanation of Revocation</title>
-<link href="tabs.css" rel="stylesheet" type="text/css"/>
-<script type="text/javascript" src="jquery.js"></script>
-<script type="text/javascript" src="dynsections.js"></script>
-<link href="navtree.css" rel="stylesheet" type="text/css"/>
-<script type="text/javascript" src="resize.js"></script>
-<script type="text/javascript" src="navtreedata.js"></script>
-<script type="text/javascript" src="navtree.js"></script>
-<script type="text/javascript">
-  $(document).ready(initResizable);
-  $(window).load(resizeHeight);
-</script>
-<link href="doxygen.css" rel="stylesheet" type="text/css" />
-<link href="epidstyle.css" rel="stylesheet" type="text/css"/>
-</head>
-<body>
-<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
-<div id="titlearea">
-<table cellspacing="0" cellpadding="0">
- <tbody>
- <tr style="height: 56px;">
-  <td id="projectalign" style="padding-left: 0.5em;">
-   <div id="projectname"><a 
-                            onclick="storeLink('index.html')"
-                            id="projectlink" 
-                            class="index.html" 
-                            href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">3.0.0</span>
-</div>
-  </td>
- </tr>
- </tbody>
-</table>
-</div>
-<!-- end header part -->
-<!-- Generated by Doxygen 1.8.11 -->
-</div><!-- top -->
-<div id="side-nav" class="ui-resizable side-nav-resizable">
-  <div id="nav-tree">
-    <div id="nav-tree-contents">
-      <div id="nav-sync" class="sync"></div>
-    </div>
-  </div>
-  <div id="splitbar" style="-moz-user-select:none;" 
-       class="ui-resizable-handle">
-  </div>
-</div>
-<script type="text/javascript">
-$(document).ready(function(){initNavTree('Revocation.html','');});
-</script>
-<div id="doc-content">
-<div class="header">
-  <div class="headertitle">
-<div class="title">In-Depth Explanation of Revocation </div>  </div>
-</div><!--header-->
-<div class="contents">
-<div class="textblock"><p>This in-depth explanation covers the available options to revoke members in the Intel&reg; EPID scheme. It also provides details on how and why each type of revocation is used.</p>
-<p><br />
-</p>
-<h1><a class="anchor" id="revocation_hierarchy"></a>
-Revocation Hierarchy</h1>
-<p>The verifier only checks the revocation lists if the message was signed with a member private key that corresponds with the correct group public key.</p>
-<p>After concluding that the signer is a member of a group, the verifier proceeds to check for group based revocation, then member private key based revocation, then signature based revocation, then verifier blacklist revocation.</p>
-<p>If the group is revoked, the verifier stops and reports it.</p>
-<p>If the member private key is revoked, the verifier does not check the signature based revocation list.</p>
-<h1><a class="anchor" id="revocation_versions"></a>
-Revocation List Versions</h1>
-<p>The verifier should periodically download the revocation lists (GroupRL, PrivRL, and SigRL) from the issuer and should use the latest revocation list during signature verification. The verifier should make sure that it gets the newest version of the revocation list during the update by checking RLver, the revocation list version number.</p>
-<h1><a class="anchor" id="group_revocation"></a>
-Group Based Revocation</h1>
-<p>The group based revocation list, also called the GroupRL, has a list of revoked groups.</p>
-<p>The issuer revokes the entire Intel&reg; EPID group by revoking the group public key. This results in the revocation of all members of a group.</p>
-<h2><a class="anchor" id="group_revocation_reasons"></a>
-Reasons the Issuer Might Revoke a Group</h2>
-<p>Group revocation is expected to be a rare event and would only happen under limited criteria.</p>
-<p>Reasons to revoke a group might include:</p>
-<ul>
-<li>A manufacturing defect causes the devices in the group to malfunction.</li>
-<li>A subscriber terminates or violates the service agreement.</li>
-<li>The Intel&reg; EPID issuing private key is exposed.</li>
-<li>A critical vulnerability in a member implementation is identified.</li>
-<li>Performance problems arise due to the expensive calculation of non-revoked proofs in signature based revocation, and a replacement group needs to be provisioned.</li>
-</ul>
-<h1><a class="anchor" id="private_key_revocation"></a>
-Private Key Based Revocation</h1>
-<p>Private key based revocation is used to revoke a compromised member. For example, the issuer can revoke a member if the member private key is exposed. When a compromised member private key is identified, it needs to be communicated to the issuer so that the issuer can revoke the member private key.</p>
-<p>The issuer manages and publishes the member private key revocation list, also called the PrivRL, which contains member private keys that can no longer be used.</p>
-<h2><a class="anchor" id="private_key_revocation_reasons"></a>
-Reasons the Issuer Might Revoke a Member Private Key</h2>
-<p>Depending on the use case, these member private keys could belong to members whose identity was compromised. For example, if a member private key is exposed online, allowing group members to be impersonated, then the compromised member private key is known, and the issuer revokes the member private key.</p>
-<h1><a class="anchor" id="signature_revocation"></a>
-Signature Based Revocation</h1>
-<p>In signature based revocation, the issuer revokes a member based on the signature generated by the member. This revocation method is used when a member becomes subject to revocation criteria, but the issuer does not know the member's member private key.</p>
-<p>The issuer manages and publishes the signature based revocation list, also called SigRL.</p>
-<p>Entries in the SigRL cause signing to take longer for all members of the group. Therefore, when an issuer receives a signature revocation request, it first checks the signature against all entries in the private key based revocation list. If the signature was generated by a revoked private key, then it is not placed in the SigRL.</p>
-<p>For the same reason, if the issuer were requested to revoke a private key, and the current SigRL had entries that corresponded to that private key, then the issuer would remove those entries from the SigRL.</p>
-<h2><a class="anchor" id="revoked_proofs"></a>
-Signing with Non-Revoked Proofs</h2>
-<p>The verifier and the member both use the SigRL managed by the issuer (the method of obtaining the SigRL is outside the scope of the SDK). The member sends the verifier an Intel&reg; EPID signature that includes a number of non-revoked proofs that correspond to each revoked member in the SigRL.</p>
-<p>In other words, the member mathematically proves that it is not any of the members who created the entries on the SigRL. One proof of non-revocation is generated by the member per entry in the SigRL. A single proof indicates the member in question cannot be the one who generated that signature in the SigRL.</p>
-<p>For privacy, Intel&reg; EPID signatures that are generated by the same member are unlinkable by default. This means that the verifier cannot recognize if two Intel&reg; EPID signatures are from the same device. Therefore, multiple Intel&reg; EPID signatures on the SigRL could be from the same member.</p>
-<h2><a class="anchor" id="signature_revocation_reasons"></a>
-Reasons the Issuer Might Revoke an Intel® EPID Signature</h2>
-<p>Reasons for revoking a signature might include the following:</p>
-<ul>
-<li>A member's signature is connected to an aspect of its behavior that indicates that the member is compromised.</li>
-<li>A member repeatedly generates a constant signature for the same message. Per the Intel&reg; EPID algorithm, multiple signatures generated for the same challenge must be different.</li>
-</ul>
-<h1><a class="anchor" id="verifier_blacklist"></a>
-Verifier Blacklist Revocation</h1>
-<p>Verifier blacklist revocation is similar to signature based revocation in that it can be used to revoke a member using only a signature from a compromised member. Unlike the procedure for the signature based revocation list, members do not have to create non-revoked proofs for each entry on the verifier blacklist. Instead, the verifier relies on the member to use a basename when creating the signature (in other words, to use a name based signature) in order to determine if the same member created any of the signatures on the verifier blacklist.</p>
-<p>For the verifier to determine that a member created an entry on the verifier blacklist, the member and verifier must use the same basename. The mechanism that allows them to agree on a basename is outside the scope of the SDK.</p>
-<p>For more information on basenames, refer to <a class="el" href="Basenames.html#name_based">Name Based Signatures</a>.</p>
-<p>The verifier adds a signature to a blacklist when the verifier does not want to trust the signer, but the verifier does not have enough reason to send a request to the issuer to revoke the member's signature.</p>
-<p>When the verifier tracks a member using a basename, and decides the member is not trustworthy, the verifier can add the member's signature to the verifier blacklist.</p>
-<h2><a class="anchor" id="verifier_blacklist_reasons"></a>
-Reasons the Verifier Might Revoke an Intel® EPID Signature</h2>
-<p>Reasons a verifier might revoke a member based on its tracked signatures include the following:</p>
-<ul>
-<li>A service provider receives a complaint about a customer. In this case, even though the verifier no longer trusts that customer to use the service, the verifier does not have a case to petition the issuer to revoke the member.</li>
-<li>A service provider detects suspicious behavior that might indicate illegal activity or another violation of the service provider's policy. </li>
-</ul>
-</div></div><!-- contents -->
-</div><!-- doc-content -->
-<!-- HTML footer for doxygen 1.8.10-->
-<!-- start footer part -->
-<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
-  <ul>
-    <li class="footer">
-      &copy; 2016 Intel Corporation
-    </li>
-  </ul>
-</div>
-</body>
-</html>

+ 0 - 203
external/epid-sdk-3.0.0/doc/html/SdkOverview.html

@@ -1,203 +0,0 @@
-<!-- HTML header for doxygen 1.8.10-->
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
-<meta http-equiv="X-UA-Compatible" content="IE=9"/>
-<meta name="generator" content="Doxygen 1.8.11"/>
-<title>Intel&reg; Enhanced Privacy ID SDK: What&#39;s Included in the SDK</title>
-<link href="tabs.css" rel="stylesheet" type="text/css"/>
-<script type="text/javascript" src="jquery.js"></script>
-<script type="text/javascript" src="dynsections.js"></script>
-<link href="navtree.css" rel="stylesheet" type="text/css"/>
-<script type="text/javascript" src="resize.js"></script>
-<script type="text/javascript" src="navtreedata.js"></script>
-<script type="text/javascript" src="navtree.js"></script>
-<script type="text/javascript">
-  $(document).ready(initResizable);
-  $(window).load(resizeHeight);
-</script>
-<link href="doxygen.css" rel="stylesheet" type="text/css" />
-<link href="epidstyle.css" rel="stylesheet" type="text/css"/>
-</head>
-<body>
-<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
-<div id="titlearea">
-<table cellspacing="0" cellpadding="0">
- <tbody>
- <tr style="height: 56px;">
-  <td id="projectalign" style="padding-left: 0.5em;">
-   <div id="projectname"><a 
-                            onclick="storeLink('index.html')"
-                            id="projectlink" 
-                            class="index.html" 
-                            href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">3.0.0</span>
-</div>
-  </td>
- </tr>
- </tbody>
-</table>
-</div>
-<!-- end header part -->
-<!-- Generated by Doxygen 1.8.11 -->
-</div><!-- top -->
-<div id="side-nav" class="ui-resizable side-nav-resizable">
-  <div id="nav-tree">
-    <div id="nav-tree-contents">
-      <div id="nav-sync" class="sync"></div>
-    </div>
-  </div>
-  <div id="splitbar" style="-moz-user-select:none;" 
-       class="ui-resizable-handle">
-  </div>
-</div>
-<script type="text/javascript">
-$(document).ready(function(){initNavTree('SdkOverview.html','');});
-</script>
-<div id="doc-content">
-<div class="header">
-  <div class="headertitle">
-<div class="title">What's Included in the SDK </div>  </div>
-</div><!--header-->
-<div class="contents">
-<div class="toc"><h3>Table of Contents</h3>
-<ul><li class="level1"><a href="#SdkOverview_Components">SDK Components</a></li>
-<li class="level1"><a href="#SdkOverview_Files">Filesystem Layout</a><ul><li class="level2"><a href="#SdkOverview_Files_SourceLayout">Source Layout</a></li>
-<li class="level2"><a href="#SdkOverview_Files_InstallLayout">Install Layout</a></li>
-</ul>
-</li>
-</ul>
-</div>
-<div class="textblock"><h1><a class="anchor" id="SdkOverview_Components"></a>
-SDK Components</h1>
-<p>The SDK is divided into logical components to separate responsibilities and create interfaces that you can re-implement using custom tools such as hardware accelerators.</p>
-<div class="image">
-<img src="sdk_block_diagram.png" alt="sdk_block_diagram.png"/>
-</div>
-<p><br />
- The Intel&reg; EPID SDK is divided into the following components:</p>
-<p>Components in the SDK Core implement the features of Intel&reg; EPID.</p>
-<table class="doxtable">
-<tr>
-<th>Component </th><th>Description  </th></tr>
-<tr>
-<td>member </td><td>Library containing APIs needed to implement a member </td></tr>
-<tr>
-<td>verifier </td><td>Library containing APIs needed to implement a verifier </td></tr>
-<tr>
-<td>common </td><td>Library containing common types and functions </td></tr>
-<tr>
-<td>math </td><td>Math primitives used by member and verifier </td></tr>
-<tr>
-<td>IPP </td><td>A C-only non-optimized subset of Intel&reg; IPP </td></tr>
-</table>
-<p><a class="el" href="Examples.html">Examples</a> show how to use the SDK APIs in working code.</p>
-<table class="doxtable">
-<tr>
-<th>Component </th><th>Description  </th></tr>
-<tr>
-<td>signmsg </td><td>A sample program showing how to sign messages </td></tr>
-<tr>
-<td>verfifysig </td><td>A sample program showing how to verify signatures </td></tr>
-<tr>
-<td>util </td><td>Common utilities used by samples </td></tr>
-<tr>
-<td>Sample Issuer Material </td><td>Sample keys and revocation lists </td></tr>
-</table>
-<p>Tools implement utility code to interact with Intel&reg; EPID related services such as <a class="el" href="ChoosingiKGF.html">the Intel&reg; Key Generation</a>Facility (iKGF)".</p>
-<table class="doxtable">
-<tr>
-<th>Component </th><th>Description  </th></tr>
-<tr>
-<td>extractgrps </td><td>A tool to extract groups from a bulk group file </td></tr>
-<tr>
-<td>extractkeys </td><td>A tool to extract member keys from a bulk key file </td></tr>
-<tr>
-<td>revokegrp </td><td>A tool to create a revocation request for a group </td></tr>
-<tr>
-<td>revokekey </td><td>A tool to create a revocation request for a member key </td></tr>
-<tr>
-<td>revokesig </td><td>A tool to create a revocation request from a signature </td></tr>
-</table>
-<p>The SDK comes with a number of other components that support building and validating the code.</p>
-<table class="doxtable">
-<tr>
-<th>Component </th><th>Description  </th></tr>
-<tr>
-<td>gtest </td><td>gtest unit test framework </td></tr>
-<tr>
-<td>Build Scripts </td><td>Scripts to configure and build the SDK </td></tr>
-</table>
-<p>Math primitives are implemented in the <em>math</em> sub-component of <em>common</em>. The reference math primitive implementation is based on a non-optimized Vanilla C subset of the Intel&reg; Performance Primitives. <em>Math</em> is designed so that you can replace its implementation to call custom hardware IP blocks or optimized libraries.</p>
-<h2>Intel&reg; EPID 1.1 Compatibility</h2>
-<p>In addition to the default Intel&reg; EPID 2.0 APIs, the <em>verifier</em> component also includes APIs that allow verification of Intel&reg; EPID 1.1 signatures.</p>
-<p>Billions of existing devices, including most Intel platforms manufactured since 2008, create signatures that need Intel&reg; EPID 1.1 verification.</p>
-<p>For details on verifying Intel&reg; EPID 1.1 signatures see <a href="group___epid11_verifier_module.html#details"><b>EPID 1.1 support</b></a> in the API Reference.</p>
-<h1><a class="anchor" id="SdkOverview_Files"></a>
-Filesystem Layout</h1>
-<p>The Intel&reg; EPID SDK has two filesystem layouts: the Source Layout and the Install Layout.</p>
-<p>The Source Layout is what you find when you download the SDK and extract it to disk. This layout contains all of the files that you need to build the libraries, samples, tests, and data generated by the SDK.</p>
-<p>The Install Layout is the layout of files under the <code>_install</code> folder after you build the SDK.</p>
-<h2><a class="anchor" id="SdkOverview_Files_SourceLayout"></a>
-Source Layout</h2>
-<p>The Source Layout is used by the build scripts in the Intel&reg; EPID SDK to find components and files needed to create libraries and executables. </p><pre class="fragment">epid-sdk/
-|__ LICENSE.txt             Distribution license
-|__ NOTICE.txt              Legal notices
-|__ README.md               Readme
-|__ CHANGELOG.md            Change log
-|__ SConstruct              Main build configuration
-|
-|__ doc/
-|   |__ html/               HTML format documentation
-|   |__ index.html          Entry point for HTML format documentation
-|
-|__ epid/
-|   |__ common/             Source for Common
-|   |__ common-testhelper/  Source for unit test helper common helpers
-|   |__ member/             Source for Member
-|   |__ verifier/           Source for Verifier
-|
-|__ example/
-|   |__ data/               Binary data used for testing and tutorials
-|   |__ compressed_data/    Compressed Member Key Binary data used for testing and tutorials
-|   |__ signmsg/            Source for message signing example
-|   |__ util/               Common utilities for examples
-|   |__ verifysig/          Source for signature validation signing example
-|
-|__ ext/
-|   |__ gtest/             Third party gtest library
-|   |__ ipp/               IPP library
-|
-|__ parts-site/            Parts platform config scripts
-|
-|__ tools/
-    |__ extractgrps/       Tool to extract groups
-    |__ extractkeys/       Tool to extract keys
-    |__ revokegrp/         Tool to create group revocation request
-    |__ revokekey/         Tool to create a member key revocation request
-    |__ revokesig/         Tool to create a signature based revocation
-                           request
-</pre><h2><a class="anchor" id="SdkOverview_Files_InstallLayout"></a>
-Install Layout</h2>
-<p>The Install Layout contains the data developers need to develop and build their applications using the Intel&reg; EPID SDK. Once built, the Install Layout has no dependency on the Source Layout, allowing developers to build the SDK once and reuse the built files in other locations or on other computers. </p><pre class="fragment">_install/
-|__ epid-sdk/
-    |__ include/            C include header files for the SDK
-    |__ lib/
-    |   |__ &lt;platform&gt;      Target specific static libraries for the SDK
-    |
-    |__example/             Sample applications and data
-    |__test/                Unit test executables (if unit tests built)
-    |__tools/               Tools</pre> </div></div><!-- contents -->
-</div><!-- doc-content -->
-<!-- HTML footer for doxygen 1.8.10-->
-<!-- start footer part -->
-<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
-  <ul>
-    <li class="footer">
-      &copy; 2016 Intel Corporation
-    </li>
-  </ul>
-</div>
-</body>
-</html>

+ 0 - 239
external/epid-sdk-3.0.0/doc/html/SignVerifyTutorial.html

@@ -1,239 +0,0 @@
-<!-- HTML header for doxygen 1.8.10-->
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
-<meta http-equiv="X-UA-Compatible" content="IE=9"/>
-<meta name="generator" content="Doxygen 1.8.11"/>
-<title>Intel&reg; Enhanced Privacy ID SDK: Signing and Verification Tutorial</title>
-<link href="tabs.css" rel="stylesheet" type="text/css"/>
-<script type="text/javascript" src="jquery.js"></script>
-<script type="text/javascript" src="dynsections.js"></script>
-<link href="navtree.css" rel="stylesheet" type="text/css"/>
-<script type="text/javascript" src="resize.js"></script>
-<script type="text/javascript" src="navtreedata.js"></script>
-<script type="text/javascript" src="navtree.js"></script>
-<script type="text/javascript">
-  $(document).ready(initResizable);
-  $(window).load(resizeHeight);
-</script>
-<link href="doxygen.css" rel="stylesheet" type="text/css" />
-<link href="epidstyle.css" rel="stylesheet" type="text/css"/>
-</head>
-<body>
-<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
-<div id="titlearea">
-<table cellspacing="0" cellpadding="0">
- <tbody>
- <tr style="height: 56px;">
-  <td id="projectalign" style="padding-left: 0.5em;">
-   <div id="projectname"><a 
-                            onclick="storeLink('index.html')"
-                            id="projectlink" 
-                            class="index.html" 
-                            href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">3.0.0</span>
-</div>
-  </td>
- </tr>
- </tbody>
-</table>
-</div>
-<!-- end header part -->
-<!-- Generated by Doxygen 1.8.11 -->
-</div><!-- top -->
-<div id="side-nav" class="ui-resizable side-nav-resizable">
-  <div id="nav-tree">
-    <div id="nav-tree-contents">
-      <div id="nav-sync" class="sync"></div>
-    </div>
-  </div>
-  <div id="splitbar" style="-moz-user-select:none;" 
-       class="ui-resizable-handle">
-  </div>
-</div>
-<script type="text/javascript">
-$(document).ready(function(){initNavTree('SignVerifyTutorial.html','');});
-</script>
-<div id="doc-content">
-<div class="header">
-  <div class="headertitle">
-<div class="title">Signing and Verification Tutorial </div>  </div>
-</div><!--header-->
-<div class="contents">
-<div class="toc"><h3>Table of Contents</h3>
-<ul><li class="level1"><a href="#SignVerifyTutorial_Signmmsg">Creating an Intel&reg; EPID Signature of a Given Message</a></li>
-<li class="level1"><a href="#SignVerifyTutorial_Verifysig">Verifying an Intel&reg; EPID Signature</a></li>
-<li class="level1"><a href="#SignVerifyTutorial_Basename">Linking Intel&reg; EPID Signatures from the Same Member</a></li>
-<li class="level1"><a href="#SignVerifyTutorial_VerificationFailures">Expected Failures</a></li>
-<li class="level1"><a href="#SignVerifyTutorial_Revocation_Group">Revocation</a><ul><li class="level2"><a href="#SignVerifyTutorial_GroupRevocation">Detecting Revoked Group from Group Revocation List</a></li>
-<li class="level2"><a href="#SignVerifyTutorial_KeyRevocation">Detecting Revoked Member from Private Key Based Revocation List</a></li>
-<li class="level2"><a href="#SignVerifyTutorial_SigRevocation">Detecting Revoked Member from Signature Based Revocation List</a></li>
-</ul>
-</li>
-</ul>
-</div>
-<div class="textblock"><p>The Intel&reg; EPID SDK provides example tools to show you how to use the Intel&reg; EPID SDK APIs. These examples are called <em>signmsg</em> and <em>verifysig</em>.</p>
-<p>You can build these examples using the instructions in <a class="el" href="BuildingSdk.html">Building from Source</a>. The tutorial assumes <code>_install/epid-sdk/example</code> is the current directory.</p>
-<p>All command lines in this tutorial use posix command line conventions; for other systems, adjust accordingly.</p>
-<p>For the code used in this tutorial, refer to <a class="el" href="Examples.html">Walkthroughs of Examples Showing API Usage</a>.</p>
-<dl class="section note"><dt>Note</dt><dd>The data for running this tutorial is pre-generated. Once the samples are built, the data is in the <code>_install/epid-sdk/example/data</code> directory. See <a class="el" href="IssuerMaterial.html">Sample Issuer Material</a>.</dd></dl>
-<h1><a class="anchor" id="SignVerifyTutorial_Signmmsg"></a>
-Creating an Intel® EPID Signature of a Given Message</h1>
-<p>The example application <em>signmsg</em> shows you how to create an Intel&reg; EPID signature of a given message. </p><pre class="fragment">$ ./signmsg -h
-Usage: signmsg [OPTION]...
-Create Intel(R) EPID signature of message
-
-Options:
-  --sig=FILE
-      write signature to FILE (default: sig.dat)
-
-  --msg=MESSAGE
-      MESSAGE to sign
-
-  --bsn=BASENAME
-      BASENAME to sign with (default: random)
-
-  --sigrl=FILE
-      load signature based revocation list from FILE
-
-  --gpubkey=FILE
-      load group public key from FILE (default: pubkey.bin)
-
-  --mprivkey=FILE
-      load member private key from FILE (default: mprivkey.dat)
-
-  --mprecmpi=FILE
-      load pre-computed member data from FILE
-
-  --mprecmpo=FILE
-      write pre-computed member data to FILE
-
-  --capubkey=FILE
-      load IoT Issuing CA public key from FILE (default: cacert.bin)
-
-  --hashalg={SHA-256 | SHA-384 | SHA-512}
-      use specified hash algorithm (default: SHA-512)
-
-  -h, --help
-      display this help and exit
-
-  -v, --verbose
-      print status messages to stdout
-</pre><p>To sign a message, a group member in good standing uses the following command: </p><pre class="fragment">$ ./signmsg --msg="test0"
-</pre><p>The above command signs a message "test0". <em>signmsg</em> uses default options for the group public key, member private key, hash algorithm and IoT Issuing CA public key. All other parameters that are not given are ignored. The command produces a signature file: <code>sig.dat</code></p>
-<h1><a class="anchor" id="SignVerifyTutorial_Verifysig"></a>
-Verifying an Intel® EPID Signature</h1>
-<p>The example application <em>verifysig</em> shows you how to verify that a given Intel&reg; EPID signature is produced by a member in good standing. </p><pre class="fragment">$ ./verifysig -h
-Usage: verifysig [OPTION]...
-Verify signature was created by group member in good standing
-
-Options:
-  --sig=FILE
-      load signature from FILE (default: sig.dat)
-
-  --msg=MESSAGE
-      MESSAGE that was signed (default: empty)
-
-  --bsn=BASENAME
-      BASENAME used in signature (default: random)
-
-  --privrl=FILE
-      load private key revocation list from FILE
-
-  --sigrl=FILE
-      load signature based revocation list from FILE
-
-  --grprl=FILE
-      load group revocation list from FILE
-       (default: grprl.bin)
-
-  --verifierrl=FILE
-      load verifier revocation list from FILE
-
-  --gpubkey=FILE
-      load group public key from FILE (default: pubkey.bin)
-
-  --vprecmpi=FILE
-      load pre-computed verifier data from FILE
-
-  --vprecmpo=FILE
-      write pre-computed verifier data to FILE
-
-  --capubkey=FILE
-      load IoT Issuing CA public key from FILE
-   (default: cacert.bin)
-
-  --hashalg={SHA-256 | SHA-384 | SHA-512}
-      use specified hash algorithm for 2.0 groups (default: SHA-512)
-
-  -h, --help
-  display this help and exit
-
-  -v, --verbose
-      print status messages to stdout
-</pre><p>To verify that a signature is from a member in good standing, the verifier uses the following command: </p><pre class="fragment">$ ./verifysig --msg="test0"
-signature verified successfully
-</pre><p>This verifies that the default signature file <code>sig.dat</code> is generated for the message "test0" by a member in good standing. <em>verifysig</em> uses default inputs for group public key, hash algorithm and IoT Issuing CA public key. All other parameters are ignored. The output <code>verifysig: signature verified successfully</code> denotes that the verification is successful.</p>
-<h1><a class="anchor" id="SignVerifyTutorial_Basename"></a>
-Linking Intel® EPID Signatures from the Same Member</h1>
-<p>A name based signature is created using the additional parameter of a basename. If the member uses the same basename, the verifier can mathematically link signatures generated by the member, showing that the signatures are from the same member.</p>
-<p>To validate a signature with a basename, you need to use the same basename for signing and verification. The mechanism for ensuring that the member and verifier use the same basename is outside the scope of the SDK.</p>
-<p>If a basename is not provided, then the member uses a random basename and the signature generated by the member is anonymous.</p>
-<p>For more general information on why you might want to use a basename, refer to <a class="el" href="Basenames.html#name_based">Name Based Signatures</a>.</p>
-<dl class="section warning"><dt>Warning</dt><dd>The use of a name-based signature creates a platform unique pseudonymous identifier. Because it reduces the member's privacy, the user should be notified when it is used and should have control over its use.</dd></dl>
-<p>To sign message "test0" with a basename "base0": </p><pre class="fragment">$ ./signmsg --msg="test0" --bsn="base0"
-</pre><p>To verify the signature: </p><pre class="fragment">$ ./verifysig --msg="test0" --bsn="base0"
-verifysig: signature verified successfully
-</pre><p>To validate a signature, you need to use the same message for signing and verification. The mechanism for ensuring that the member and verifier use the same message is outside the scope of the SDK.</p>
-<p>Member and verifier must also use the same hash algorithm and basename, if applicable.</p>
-<h1><a class="anchor" id="SignVerifyTutorial_VerificationFailures"></a>
-Expected Failures</h1>
-<p>The signature verification process fails if there is a parameter mismatch between sign and verify operations. Here are some examples.</p>
-<p>Verification fails if there is a mismatch in the message: </p><pre class="fragment">$ ./signmsg --msg="test0"
-$ ./verifysig --msg="test1"
-verifysig: signature verification failed: invalid signature
-</pre><p>Verification fails if there is a mismatch in the basename: </p><pre class="fragment">$ ./signmsg --msg="test0" --bsn="base0"
-$ ./verifysig --msg="test0" --bsn="base1"
-verifysig: signature verification failed: invalid signature
-</pre><p>The Intel&reg; EPID SDK supports the following hash algorithms: SHA-256, SHA-384, SHA-512. The selected hash algorithm must be the same for both sign and verify. Mismatch in hash algorithm results in verification failure: </p><pre class="fragment">$ ./signmsg --msg="test0" --hashalg=SHA-256
-$ ./verifysig --msg="test0" --hashalg=SHA-384
-verifysig: signature verification failed: invalid signature
-</pre><h1><a class="anchor" id="SignVerifyTutorial_Revocation_Group"></a>
-Revocation</h1>
-<p>Revocation lists are data structures used by the verifier to identify members that are no longer approved members of the group.</p>
-<p>The verifier obtains the member private key based revocation list (PrivRL), signature based revocation list (SigRL), and group based revocation list (GroupRL) from the issuer. The verifier can also maintain its own verifier blacklist (VerifierRL).</p>
-<h2><a class="anchor" id="SignVerifyTutorial_GroupRevocation"></a>
-Detecting Revoked Group from Group Revocation List</h2>
-<p>Verification of a signature fails if it is generated by a member of a group that is revoked in the group revocation list.</p>
-<p>For example, </p><pre class="fragment">$ ./signmsg --msg="test0" --gpubkey=data/groupb/pubkey.bin --mprivkey=data/groupb/member0/mprivkey.dat
-$ ./verifysig --msg="test0" --grprl=data/grprl.bin --gpubkey=data/groupb/pubkey.bin
-verifysig: signature verification failed: signature revoked in GroupRl
-</pre><p>The verification fails because <b>groupb</b> is revoked and is an entry in the group revocation list (<code>grprl.bin</code>).</p>
-<h2><a class="anchor" id="SignVerifyTutorial_KeyRevocation"></a>
-Detecting Revoked Member from Private Key Based Revocation List</h2>
-<p>Verification of a signature fails if it is generated by a member whose private key is revoked in a private-key based revocation list.</p>
-<p>For example, </p><pre class="fragment">$ ./signmsg --msg=test0 --gpubkey=data/groupa/pubkey.bin --mprivkey=data/groupa/privrevokedmember0/mprivkey.dat
-$ ./verifysig --msg=test0 --privrl=data/groupa/privrl.bin --gpubkey=data/groupa/pubkey.bin
-verifysig: signature verification failed: signature revoked in PrivRl
-</pre><p>The verification fails because the private key of <b>privrevokedmember0</b> is revoked and is an entry in the private key based revocation list of <b>groupa</b> (<code>privrl.bin</code>).</p>
-<h2><a class="anchor" id="SignVerifyTutorial_SigRevocation"></a>
-Detecting Revoked Member from Signature Based Revocation List</h2>
-<p>Verification of a signature fails if it is generated by a member whose signature is revoked in a signature based revocation list. </p><pre class="fragment">$ ./signmsg --msg="test1" --sigrl=data/groupa/sigrl.bin --gpubkey=data/groupa/pubkey.bin --mprivkey=data/groupa/sigrevokedmember0/mprivkey.dat
-signmsg: signature revoked in SigRL
-$ ./verifysig --msg="test1" --sigrl=data/groupa/sigrl.bin --gpubkey=data/groupa/pubkey.bin
-verifysig: signature verification failed: signature revoked in SigRl
-</pre><p>The message "test1" is signed by <em>signmsg</em> with a warning <code>signmsg: signature revoked in SigRL</code>. This means that the signature of <b>sigrevokedmember0</b> is revoked in the signature based revocation list. The verification fails because the signature was generated by <b>sigrevokedmember0</b>, which is revoked and is an entry in the signature based revocation list of <b>groupa</b> (<code>sigrl.bin</code>). </p>
-</div></div><!-- contents -->
-</div><!-- doc-content -->
-<!-- HTML footer for doxygen 1.8.10-->
-<!-- start footer part -->
-<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
-  <ul>
-    <li class="footer">
-      &copy; 2016 Intel Corporation
-    </li>
-  </ul>
-</div>
-</body>
-</html>

File diff suppressed because it is too large
+ 0 - 67
external/epid-sdk-3.0.0/doc/html/SignmsgWalkthru.html


File diff suppressed because it is too large
+ 0 - 78
external/epid-sdk-3.0.0/doc/html/VerifysigWalkthru.html


+ 0 - 136
external/epid-sdk-3.0.0/doc/html/annotated.html

@@ -1,136 +0,0 @@
-<!-- HTML header for doxygen 1.8.10-->
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
-<meta http-equiv="X-UA-Compatible" content="IE=9"/>
-<meta name="generator" content="Doxygen 1.8.11"/>
-<title>Intel&reg; Enhanced Privacy ID SDK: Data Structures</title>
-<link href="tabs.css" rel="stylesheet" type="text/css"/>
-<script type="text/javascript" src="jquery.js"></script>
-<script type="text/javascript" src="dynsections.js"></script>
-<link href="navtree.css" rel="stylesheet" type="text/css"/>
-<script type="text/javascript" src="resize.js"></script>
-<script type="text/javascript" src="navtreedata.js"></script>
-<script type="text/javascript" src="navtree.js"></script>
-<script type="text/javascript">
-  $(document).ready(initResizable);
-  $(window).load(resizeHeight);
-</script>
-<link href="doxygen.css" rel="stylesheet" type="text/css" />
-<link href="epidstyle.css" rel="stylesheet" type="text/css"/>
-</head>
-<body>
-<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
-<div id="titlearea">
-<table cellspacing="0" cellpadding="0">
- <tbody>
- <tr style="height: 56px;">
-  <td id="projectalign" style="padding-left: 0.5em;">
-   <div id="projectname"><a 
-                            onclick="storeLink('index.html')"
-                            id="projectlink" 
-                            class="index.html" 
-                            href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">3.0.0</span>
-</div>
-  </td>
- </tr>
- </tbody>
-</table>
-</div>
-<!-- end header part -->
-<!-- Generated by Doxygen 1.8.11 -->
-</div><!-- top -->
-<div id="side-nav" class="ui-resizable side-nav-resizable">
-  <div id="nav-tree">
-    <div id="nav-tree-contents">
-      <div id="nav-sync" class="sync"></div>
-    </div>
-  </div>
-  <div id="splitbar" style="-moz-user-select:none;" 
-       class="ui-resizable-handle">
-  </div>
-</div>
-<script type="text/javascript">
-$(document).ready(function(){initNavTree('annotated.html','');});
-</script>
-<div id="doc-content">
-<div class="header">
-  <div class="headertitle">
-<div class="title">Data Structures</div>  </div>
-</div><!--header-->
-<div class="contents">
-<div class="textblock">Here are the data structures with brief descriptions:</div><div class="directory">
-<table class="directory">
-<tr id="row_0_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_basic_signature.html" target="_self">BasicSignature</a></td><td class="desc">Intel(R) EPID 2.0 basic signature </td></tr>
-<tr id="row_1_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_big_num_str.html" target="_self">BigNumStr</a></td><td class="desc">Serialized BigNum </td></tr>
-<tr id="row_2_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_compressed_priv_key.html" target="_self">CompressedPrivKey</a></td><td class="desc">Compressed private key </td></tr>
-<tr id="row_3_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_ecdsa_private_key.html" target="_self">EcdsaPrivateKey</a></td><td class="desc">ECDSA Private Key </td></tr>
-<tr id="row_4_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_ecdsa_public_key.html" target="_self">EcdsaPublicKey</a></td><td class="desc">ECDSA Public Key </td></tr>
-<tr id="row_5_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_ecdsa_signature.html" target="_self">EcdsaSignature</a></td><td class="desc">ECDSA Signature using NIST 256-bit curve secp256r1 </td></tr>
-<tr id="row_6_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_epid11_basic_signature.html" target="_self">Epid11BasicSignature</a></td><td class="desc">Intel(R) EPID 1.1 basic signature </td></tr>
-<tr id="row_7_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_epid11_g2_elem_str.html" target="_self">Epid11G2ElemStr</a></td><td class="desc">Serialized Intel(R) EPID 1.1 G2 element </td></tr>
-<tr id="row_8_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_epid11_group_pub_key.html" target="_self">Epid11GroupPubKey</a></td><td class="desc">Intel(R) EPID 1.1 group public key </td></tr>
-<tr id="row_9_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_epid11_group_rl.html" target="_self">Epid11GroupRl</a></td><td class="desc">Intel(R) EPID 1.1 group revocation list </td></tr>
-<tr id="row_10_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_epid11_gt_elem_str.html" target="_self">Epid11GtElemStr</a></td><td class="desc">Serialized Intel(R) EPID 1.1 GT element </td></tr>
-<tr id="row_11_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_epid11_nr_proof.html" target="_self">Epid11NrProof</a></td><td class="desc">Intel(R) EPID 1.1 non-revoked Proof </td></tr>
-<tr id="row_12_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_epid11_params.html" target="_self">Epid11Params</a></td><td class="desc">Intel(R) EPID 1.1 Parameters </td></tr>
-<tr id="row_13_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_epid11_priv_rl.html" target="_self">Epid11PrivRl</a></td><td class="desc">Intel(R) EPID 1.1 private-key based revocation list </td></tr>
-<tr id="row_14_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_epid11_signature.html" target="_self">Epid11Signature</a></td><td class="desc">Intel(R) EPID 1.1 Signature </td></tr>
-<tr id="row_15_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_epid11_sig_rl.html" target="_self">Epid11SigRl</a></td><td class="desc">Intel(R) EPID 1.1 signature based revocation list </td></tr>
-<tr id="row_16_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_epid11_sig_rl_entry.html" target="_self">Epid11SigRlEntry</a></td><td class="desc">Intel(R) EPID 1.1 entry in SigRL (B,K) </td></tr>
-<tr id="row_17_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_epid11_verifier_precomp.html" target="_self">Epid11VerifierPrecomp</a></td><td class="desc">Intel(R) EPID 1.1 Pre-computed verifier settings </td></tr>
-<tr id="row_18_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_epid2_params.html" target="_self">Epid2Params</a></td><td class="desc">Intel(R) EPID 2.0 Parameters </td></tr>
-<tr id="row_19_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_epid_ca_certificate.html" target="_self">EpidCaCertificate</a></td><td class="desc">IoT CA Certificate binary format </td></tr>
-<tr id="row_20_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_epid_file_header.html" target="_self">EpidFileHeader</a></td><td class="desc">Intel(R) EPID binary file header </td></tr>
-<tr id="row_21_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_epid_signature.html" target="_self">EpidSignature</a></td><td class="desc">Intel(R) EPID 2.0 Signature </td></tr>
-<tr id="row_22_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_fp_elem_str.html" target="_self">FpElemStr</a></td><td class="desc">Number in [0, p-1] </td></tr>
-<tr id="row_23_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_fq12_elem_str.html" target="_self">Fq12ElemStr</a></td><td class="desc">Serialized Fq2^3^2 element </td></tr>
-<tr id="row_24_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_fq2_elem_str.html" target="_self">Fq2ElemStr</a></td><td class="desc">Serialized Fq2 element </td></tr>
-<tr id="row_25_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_fq3_elem_str.html" target="_self">Fq3ElemStr</a></td><td class="desc">Serialized Fq3 element </td></tr>
-<tr id="row_26_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_fq6_elem_str.html" target="_self">Fq6ElemStr</a></td><td class="desc">Serialized Fq2^3 element </td></tr>
-<tr id="row_27_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_fq_elem_str.html" target="_self">FqElemStr</a></td><td class="desc">Number in [0, q-1] </td></tr>
-<tr id="row_28_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_g1_elem_str.html" target="_self">G1ElemStr</a></td><td class="desc">Serialized G1 element </td></tr>
-<tr id="row_29_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_g2_elem_str.html" target="_self">G2ElemStr</a></td><td class="desc">Serialized G2 element </td></tr>
-<tr id="row_30_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_group_pub_key.html" target="_self">GroupPubKey</a></td><td class="desc">Intel(R) EPID 2.0 group public key </td></tr>
-<tr id="row_31_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_group_rl.html" target="_self">GroupRl</a></td><td class="desc">Group revocation list </td></tr>
-<tr id="row_32_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_gt_elem_str.html" target="_self">GtElemStr</a></td><td class="desc">Serialized GT element </td></tr>
-<tr id="row_33_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_i_priv_key.html" target="_self">IPrivKey</a></td><td class="desc">Intel(R) EPID 2.0 issuing private key </td></tr>
-<tr id="row_34_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_join_request.html" target="_self">JoinRequest</a></td><td class="desc">Join request </td></tr>
-<tr id="row_35_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_member_precomp.html" target="_self">MemberPrecomp</a></td><td class="desc">Pre-computed member settings </td></tr>
-<tr id="row_36_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_membership_credential.html" target="_self">MembershipCredential</a></td><td class="desc">Membership credential </td></tr>
-<tr id="row_37_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_nr_proof.html" target="_self">NrProof</a></td><td class="desc">Non-revoked Proof </td></tr>
-<tr id="row_38_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_oct_str128.html" target="_self">OctStr128</a></td><td class="desc">128 bit octet string </td></tr>
-<tr id="row_39_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_oct_str16.html" target="_self">OctStr16</a></td><td class="desc">16 bit octet string </td></tr>
-<tr id="row_40_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_oct_str256.html" target="_self">OctStr256</a></td><td class="desc">256 bit octet string </td></tr>
-<tr id="row_41_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_oct_str32.html" target="_self">OctStr32</a></td><td class="desc">32 bit octet string </td></tr>
-<tr id="row_42_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_oct_str512.html" target="_self">OctStr512</a></td><td class="desc">512 bit octet string </td></tr>
-<tr id="row_43_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_oct_str600.html" target="_self">OctStr600</a></td><td class="desc">600 bit octet string </td></tr>
-<tr id="row_44_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_oct_str64.html" target="_self">OctStr64</a></td><td class="desc">64 bit octet string </td></tr>
-<tr id="row_45_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_oct_str768.html" target="_self">OctStr768</a></td><td class="desc">768 bit octet string </td></tr>
-<tr id="row_46_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_oct_str8.html" target="_self">OctStr8</a></td><td class="desc">8 bit octet string </td></tr>
-<tr id="row_47_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_oct_str80.html" target="_self">OctStr80</a></td><td class="desc">80 bit octet string </td></tr>
-<tr id="row_48_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_pre_computed_signature.html" target="_self">PreComputedSignature</a></td><td class="desc">Pre-computed signature </td></tr>
-<tr id="row_49_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_priv_key.html" target="_self">PrivKey</a></td><td class="desc">Intel(R) EPID 2.0 private key </td></tr>
-<tr id="row_50_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_priv_rl.html" target="_self">PrivRl</a></td><td class="desc">Private-key based revocation list </td></tr>
-<tr id="row_51_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_sha256_digest.html" target="_self">Sha256Digest</a></td><td class="desc">SHA256 digest </td></tr>
-<tr id="row_52_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_sig_rl.html" target="_self">SigRl</a></td><td class="desc">Signature based revocation list </td></tr>
-<tr id="row_53_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_sig_rl_entry.html" target="_self">SigRlEntry</a></td><td class="desc">Entry in SigRL (B,K) </td></tr>
-<tr id="row_54_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_verifier_precomp.html" target="_self">VerifierPrecomp</a></td><td class="desc">Pre-computed verifier settings </td></tr>
-<tr id="row_55_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_verifier_rl.html" target="_self">VerifierRl</a></td><td class="desc"></td></tr>
-</table>
-</div><!-- directory -->
-</div><!-- contents -->
-</div><!-- doc-content -->
-<!-- HTML footer for doxygen 1.8.10-->
-<!-- start footer part -->
-<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
-  <ul>
-    <li class="footer">
-      &copy; 2016 Intel Corporation
-    </li>
-  </ul>
-</div>
-</body>
-</html>

BIN
external/epid-sdk-3.0.0/doc/html/arrowdown.png


BIN
external/epid-sdk-3.0.0/doc/html/arrowright.png


+ 0 - 82
external/epid-sdk-3.0.0/doc/html/basenames_8dox.html

@@ -1,82 +0,0 @@
-<!-- HTML header for doxygen 1.8.10-->
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
-<meta http-equiv="X-UA-Compatible" content="IE=9"/>
-<meta name="generator" content="Doxygen 1.8.11"/>
-<title>Intel&reg; Enhanced Privacy ID SDK: doc/docsrc/basenames.dox File Reference</title>
-<link href="tabs.css" rel="stylesheet" type="text/css"/>
-<script type="text/javascript" src="jquery.js"></script>
-<script type="text/javascript" src="dynsections.js"></script>
-<link href="navtree.css" rel="stylesheet" type="text/css"/>
-<script type="text/javascript" src="resize.js"></script>
-<script type="text/javascript" src="navtreedata.js"></script>
-<script type="text/javascript" src="navtree.js"></script>
-<script type="text/javascript">
-  $(document).ready(initResizable);
-  $(window).load(resizeHeight);
-</script>
-<link href="doxygen.css" rel="stylesheet" type="text/css" />
-<link href="epidstyle.css" rel="stylesheet" type="text/css"/>
-</head>
-<body>
-<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
-<div id="titlearea">
-<table cellspacing="0" cellpadding="0">
- <tbody>
- <tr style="height: 56px;">
-  <td id="projectalign" style="padding-left: 0.5em;">
-   <div id="projectname"><a 
-                            onclick="storeLink('index.html')"
-                            id="projectlink" 
-                            class="index.html" 
-                            href="index.html">Intel&reg; Enhanced Privacy ID SDK</a>
-&#160;<span id="projectnumber">3.0.0</span>
-</div>
-  </td>
- </tr>
- </tbody>
-</table>
-</div>
-<!-- end header part -->
-<!-- Generated by Doxygen 1.8.11 -->
-</div><!-- top -->
-<div id="side-nav" class="ui-resizable side-nav-resizable">
-  <div id="nav-tree">
-    <div id="nav-tree-contents">
-      <div id="nav-sync" class="sync"></div>
-    </div>
-  </div>
-  <div id="splitbar" style="-moz-user-select:none;" 
-       class="ui-resizable-handle">
-  </div>
-</div>
-<script type="text/javascript">
-$(document).ready(function(){initNavTree('basenames_8dox.html','');});
-</script>
-<div id="doc-content">
-<div class="header">
-  <div class="headertitle">
-<div class="title">doc/docsrc/basenames.dox File Reference</div>  </div>
-</div><!--header-->
-<div class="contents">
-
-<p>This file is used by Doxygen to generate documentation.  
-<a href="#details">More...</a></p>
-<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
-<div class="textblock"><p>This file is used by Doxygen to generate documentation. </p>
-</div></div><!-- contents -->
-</div><!-- doc-content -->
-<!-- HTML footer for doxygen 1.8.10-->
-<!-- start footer part -->
-<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
-  <ul>
-    <li class="navelem"><a class="el" href="basenames_8dox.html">basenames.dox</a></li>
-    <li class="footer">
-      &copy; 2016 Intel Corporation
-    </li>
-  </ul>
-</div>
-</body>
-</html>

Some files were not shown because too many files changed in this diff