Browse Source

Linux 2.0 Open Source Gold release

Signed-off-by: Li, Xun <xun.li@intel.com>
Li, Xun 7 years ago
parent
commit
159f60223e
100 changed files with 3983 additions and 7212 deletions
  1. 13 13
      Linux_SGXEclipsePlugin/build_config/buildUpdateSite.xml
  2. 9 9
      Linux_SGXEclipsePlugin/build_config/customTargets.xml
  3. 18 18
      Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/.classpath
  4. 39 39
      Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/.project
  5. 1 1
      Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/META-INF/MANIFEST.MF
  6. 19 19
      Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/build.properties
  7. 470 470
      Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Stylesheets/intel_css_styles.css
  8. 24 24
      Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/plugin.xml
  9. 73 73
      Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/src/com/intel/sgx/userguide/Activator.java
  10. 24 24
      Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/build.properties
  11. 75 75
      Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/Activator.java
  12. 46 46
      Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/CConfigurationDataProvider2.java
  13. 70 70
      Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/SdkPathVariableProvider.java
  14. 38 38
      Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/build/SGXSDKCommandLauncher.java
  15. 126 126
      Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/dialogs/AddEnclaveFileDialog.java
  16. 109 109
      Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/dialogs/AddTrustedStaticLibFileDialog.java
  17. 72 72
      Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/dialogs/TwoStepSignStep1Dialog1.java
  18. 89 89
      Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/dialogs/TwoStepSignStep1Dialog2.java
  19. 105 105
      Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/dialogs/TwoStepSignStep1Dialog3.java
  20. 92 92
      Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/dialogs/TwoStepSignStep2Dialog.java
  21. 202 202
      Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/discovery/SGXSDKDiscoveredPathInfo.java
  22. 310 310
      Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/discovery/SGXSDKDiscoveryUpdater.java
  23. 213 213
      Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/handlers/AddEnclave.java
  24. 193 193
      Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/handlers/AddTrustedStaticLib.java
  25. 169 169
      Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/handlers/RemoveEnclave.java
  26. 38 38
      Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/handlers/SGXSDKWizardHandler.java
  27. 74 74
      Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/handlers/TwoStepSignStep1.java
  28. 39 39
      Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/handlers/TwoStepSignStep2.java
  29. 83 83
      Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/SGXtemplates/ctemplate.xml
  30. 109 109
      Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/SGXtemplates/cxxstaticlibtemplate.xml
  31. 44 44
      Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/SGXtemplates/cxxtemplate.xml
  32. 9 9
      Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/resources/Basename.config.xml
  33. 23 23
      Linux_SGXEclipsePlugin/build_directory/sites/site.xml
  34. 22 22
      Linux_SGXEclipsePlugin/readme.txt
  35. 17 21
      README.md
  36. 1 1
      SampleCode/Cxx11SGXDemo/Enclave/Enclave.edl
  37. 3 3
      SampleCode/Cxx11SGXDemo/Enclave/TrustedLibrary/Libcxx.cpp
  38. 3 5
      SampleCode/Cxx11SGXDemo/README.txt
  39. 3 5
      SampleCode/LocalAttestation/README.txt
  40. 1 1
      SampleCode/PowerTransition/Makefile
  41. 3 5
      SampleCode/PowerTransition/README.txt
  42. 3 5
      SampleCode/RemoteAttestation/README.txt
  43. 1 1
      SampleCode/SampleEnclave/App/App.cpp
  44. 1 1
      SampleCode/SampleEnclave/App/TrustedLibrary/Libc.cpp
  45. 1 1
      SampleCode/SampleEnclave/Enclave/TrustedLibrary/Libc.edl
  46. 28 0
      SampleCode/SampleEnclave/Enclave/config.01.xml
  47. 25 0
      SampleCode/SampleEnclave/Enclave/config.02.xml
  48. 27 0
      SampleCode/SampleEnclave/Enclave/config.03.xml
  49. 23 0
      SampleCode/SampleEnclave/Enclave/config.04.xml
  50. 40 5
      SampleCode/SampleEnclave/README.txt
  51. 4 4
      SampleCode/SealedData/DRM_enclave/DRM_enclave.cpp
  52. 3 5
      SampleCode/SealedData/README.txt
  53. 13 17
      buildenv.mk
  54. 5 0
      common/inc/internal/arch.h
  55. 52 0
      common/inc/internal/crypto_wrapper.h
  56. 9 0
      common/inc/internal/enclave_creator.h
  57. 12 2
      common/inc/internal/global_data.h
  58. 1 0
      common/inc/internal/global_init.h
  59. 1 0
      common/inc/internal/inst.h
  60. 3 0
      common/inc/internal/linux/linux-regs.h
  61. 35 13
      common/inc/internal/metadata.h
  62. 20 3
      common/inc/internal/rts.h
  63. 6 4
      common/inc/internal/rts_cmd.h
  64. 15 0
      common/inc/internal/se_lock.hpp
  65. 18 5
      common/inc/internal/se_page_attr.h
  66. 58 0
      common/inc/internal/se_tcrypto_common.h
  67. 8 1
      common/inc/internal/se_thread.h
  68. 1 1
      common/inc/internal/se_version.h
  69. 63 0
      common/inc/internal/sgx_ecc256_internal.h
  70. 3 2
      common/inc/internal/thread_data.h
  71. 16 1
      common/inc/internal/trts_inst.h
  72. 2 2
      common/inc/internal/util.h
  73. 1 4
      common/inc/internal/xsave.h
  74. 29 34
      common/inc/sgx_capable.h
  75. 1 0
      common/inc/sgx_error.h
  76. 20 31
      common/inc/sgx_tcrypto.h
  77. 1 1
      common/inc/sgx_tstdc.edl
  78. 1 1
      common/inc/stdc++/new
  79. 83 0
      common/inc/tlibc/mbusafecrt.h
  80. 1 0
      common/inc/tlibc/stdlib.h
  81. 71 0
      common/src/crypto_cmac_128.cpp
  82. 79 0
      common/src/crypto_evp_digest.cpp
  83. 111 0
      common/src/linux/xsave_gnu.S
  84. 11 0
      common/src/se_thread.c
  85. 4 4
      download_prebuilt.sh
  86. 1 1
      external/DALSdk/JHI/linux/jhi.h
  87. 1 1
      external/DALSdk/JHI/linux/typedefs.h
  88. 0 195
      external/crypto_px/include/ippbase.h
  89. 0 395
      external/crypto_px/include/ippcore.h
  90. 0 327
      external/crypto_px/include/ippcp.h
  91. 0 211
      external/crypto_px/include/ippcpdefs.h
  92. 0 129
      external/crypto_px/include/ippdefs.h
  93. 0 1104
      external/crypto_px/include/ipptypes.h
  94. 0 41
      external/crypto_px/include/ippversion.h
  95. 0 264
      external/crypto_px/sources/include/cpudef.h
  96. 0 56
      external/crypto_px/sources/include/ippver.gen
  97. 0 46
      external/crypto_px/sources/include/ippver.h
  98. 0 120
      external/crypto_px/sources/include/ippverstr.gen
  99. 0 944
      external/crypto_px/sources/include/owndefs.h
  100. 0 149
      external/crypto_px/sources/ippcp/src/owncp.h

+ 13 - 13
Linux_SGXEclipsePlugin/build_config/buildUpdateSite.xml

@@ -1,13 +1,13 @@
-<project name="update site">
-  <!-- ========================================================================= -->
-  <!-- Extracts feature zip for update site                                      -->
-  <!-- expected properties:                                                      -->
-  <!--    id - feature id to extract                                             -->
-  <!--    buildDirectory - base directgory where build takes place               -->
-  <!--    buildLabel - build id label                                            -->
-  <!--    updateSiteRoot - where to extract feature zip                          -->
-  <!-- ========================================================================= -->
-  <target name="extractFeature">
-    <unzip src="${buildDirectory}/${buildLabel}/${id}-${buildId}.zip" dest="${updateSiteRoot}"/>
-  </target>
-</project>
+<project name="update site">
+  <!-- ========================================================================= -->
+  <!-- Extracts feature zip for update site                                      -->
+  <!-- expected properties:                                                      -->
+  <!--    id - feature id to extract                                             -->
+  <!--    buildDirectory - base directgory where build takes place               -->
+  <!--    buildLabel - build id label                                            -->
+  <!--    updateSiteRoot - where to extract feature zip                          -->
+  <!-- ========================================================================= -->
+  <target name="extractFeature">
+    <unzip src="${buildDirectory}/${buildLabel}/${id}-${buildId}.zip" dest="${updateSiteRoot}"/>
+  </target>
+</project>

+ 9 - 9
Linux_SGXEclipsePlugin/build_config/customTargets.xml

@@ -192,17 +192,17 @@
   <!-- Steps to do to generate the update site                               -->
   <!-- ===================================================================== -->
   <target name="generateUpdateSite">
-    <echo message="Copying update site source ${updateSiteSource} to destination ${updateSiteDestination}"/>
-    <copy file="${updateSiteSource}/site.xml" overwrite="true" todir="${updateSiteDestination}"/>
-    <!-- replace qualifier version references with build label -->
+    <echo message="Copying update site source ${updateSiteSource} to destination ${updateSiteDestination}"/>
+    <copy file="${updateSiteSource}/site.xml" overwrite="true" todir="${updateSiteDestination}"/>
+    <!-- replace qualifier version references with build label -->
    
     <replace file="${updateSiteDestination}/site.xml" token="qualifier" value="${forceContextQualifier}"/>
-  
-    <!-- now extract each features zip to update site -->
-    <antcall target="allElements">
-      <param name="genericTargets" value="${builder}/buildUpdateSite.xml"/>
-      <param name="target" value="extractFeature" />
-    </antcall>
+  
+    <!-- now extract each features zip to update site -->
+    <antcall target="allElements">
+      <param name="genericTargets" value="${builder}/buildUpdateSite.xml"/>
+      <param name="target" value="extractFeature" />
+    </antcall>
   </target>
 
 </project>

+ 18 - 18
Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/.classpath

@@ -1,18 +1,18 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--                                                                       -->
-<!-- Copyright (c) 2016 Intel Corporation.				   -->
-<!-- 									   -->
-<!-- All rights reserved. This program and the accompanying materials	   -->
-<!-- are made available under the terms of the Eclipse Public License v1.0 -->
-<!-- which accompanies this distribution, and is available at		   -->
-<!-- http://www.eclipse.org/legal/epl-v10.html				   -->
-<!-- 									   -->
-<!-- Contributors:							   -->
-<!--     Intel Corporation - initial implementation and documentation	   -->
-<!--                                                                       -->
-<classpath>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--                                                                       -->
+<!-- Copyright (c) 2016 Intel Corporation.				   -->
+<!-- 									   -->
+<!-- All rights reserved. This program and the accompanying materials	   -->
+<!-- are made available under the terms of the Eclipse Public License v1.0 -->
+<!-- which accompanies this distribution, and is available at		   -->
+<!-- http://www.eclipse.org/legal/epl-v10.html				   -->
+<!-- 									   -->
+<!-- Contributors:							   -->
+<!--     Intel Corporation - initial implementation and documentation	   -->
+<!--                                                                       -->
+<classpath>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

+ 39 - 39
Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/.project

@@ -1,39 +1,39 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--                                                                       -->
-<!-- Copyright (c) 2016 Intel Corporation.				   -->
-<!-- 									   -->
-<!-- All rights reserved. This program and the accompanying materials	   -->
-<!-- are made available under the terms of the Eclipse Public License v1.0 -->
-<!-- which accompanies this distribution, and is available at		   -->
-<!-- http://www.eclipse.org/legal/epl-v10.html				   -->
-<!-- 									   -->
-<!-- Contributors:							   -->
-<!--     Intel Corporation - initial implementation and documentation	   -->
-<!--                                                                       -->
-<projectDescription>
-	<name>com.intel.sgx.userguide</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.pde.ManifestBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.pde.SchemaBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.pde.PluginNature</nature>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-	</natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--                                                                       -->
+<!-- Copyright (c) 2016 Intel Corporation.				   -->
+<!-- 									   -->
+<!-- All rights reserved. This program and the accompanying materials	   -->
+<!-- are made available under the terms of the Eclipse Public License v1.0 -->
+<!-- which accompanies this distribution, and is available at		   -->
+<!-- http://www.eclipse.org/legal/epl-v10.html				   -->
+<!-- 									   -->
+<!-- Contributors:							   -->
+<!--     Intel Corporation - initial implementation and documentation	   -->
+<!--                                                                       -->
+<projectDescription>
+	<name>com.intel.sgx.userguide</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

+ 1 - 1
Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/META-INF/MANIFEST.MF

@@ -6,6 +6,6 @@ Bundle-SymbolicName: com.intel.sgx.userguide;singleton:=true
 Bundle-Version: 1.0.1.qualifier
 Bundle-Activator: com.intel.sgx.userguide.Activator
 Bundle-Vendor: INTEL
-Require-Bundle: org.eclipse.ui,
+Require-Bundle: org.eclipse.ui,
  org.eclipse.core.runtime
 Bundle-ActivationPolicy: lazy

+ 19 - 19
Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/build.properties

@@ -1,19 +1,19 @@
-#########################################################################
-# Copyright (c) 2016 Intel Corporation.				        #
-# 								        #
-# All rights reserved. This program and the accompanying materials      #
-# are made available under the terms of the Eclipse Public License v1.0 #
-# which accompanies this distribution, and is available at	        #
-# http://www.eclipse.org/legal/epl-v10.html			        #
-# 								        #
-# Contributors:							        #
-#     Intel Corporation - initial implementation and documentation      #
-#########################################################################
-
-source.. = src/
-output.. = bin/
-bin.includes = plugin.xml,\
-               META-INF/,\
-               .,\
-               html/,\
-               *.xml
+#########################################################################
+# Copyright (c) 2016 Intel Corporation.				        #
+# 								        #
+# All rights reserved. This program and the accompanying materials      #
+# are made available under the terms of the Eclipse Public License v1.0 #
+# which accompanies this distribution, and is available at	        #
+# http://www.eclipse.org/legal/epl-v10.html			        #
+# 								        #
+# Contributors:							        #
+#     Intel Corporation - initial implementation and documentation      #
+#########################################################################
+
+source.. = src/
+output.. = bin/
+bin.includes = plugin.xml,\
+               META-INF/,\
+               .,\
+               html/,\
+               *.xml

+ 470 - 470
Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Stylesheets/intel_css_styles.css

@@ -1,470 +1,470 @@
-/*************************************************************************/
-/* Copyright (c) 2016 Intel Corporation.				 */
-/* 									 */
-/* All rights reserved. This program and the accompanying materials	 */
-/* are made available under the terms of the Eclipse Public License v1.0 */
-/* which accompanies this distribution, and is available at		 */
-/* http://www.eclipse.org/legal/epl-v10.html				 */
-/* 									 */
-/* Contributors:							 */
-/*     Intel Corporation - initial implementation and documentation	 */
-/*************************************************************************/
-/*<meta />*/
-
-/*begin-old-version{{*/
-
-body
-{
-	color: #333333;
-	background-color: #ffffff;
-	font-family: "Intel Clear", Verdana, Arial, sans-serif;
-	margin-left: 30px;
-	margin-right: 30px;
-	margin-bottom: 7%;
-	color: #333333;
-	background-color: #ffffff;
-	font-family: "Intel Clear", Verdana, Arial, sans-serif;
-	margin-left: 30px;
-	margin-right: 30px;
-	margin-bottom: 7%;
-	font-size: 12pt;
-}
-
-.RevUpdate
-{
-	background-color: #FFFF99;
-	font-weight: normal;
-	line-height: 100%;
-	background-color: #FFFF99;
-	font-weight: normal;
-	line-height: 100%;
-}
-
-.NonStdFortran
-{
-	color: #007F00;
-	color: #007F00;
-}
-
-body.OH_VSIP_body
-{
-	margin-left: 30px;
-	margin-left: 30px;
-}
-
-DIV.OH_outerContent
-{
-	border: 0px none #FFFFFF;
-	border: 0px none #ffffff;
-}
-
-h1
-{
-	color: #0071c5;
-	font-size: 15pt;
-	font-weight: normal;
-	padding-bottom: 1px;
-	margin-left: 0pt;
-	margin-bottom: 0px;
-	color: #0071c5;
-	font-size: 15pt;
-	font-weight: normal;
-	padding-bottom: 1px;
-	margin-left: 0pt;
-	margin-bottom: 0px;
-}
-
-h1.firsttitle
-{
-	font-weight: normal;
-	border-bottom: 0 none;
-	margin-left: 0;
-	font-size: 18pt;
-	border-bottom: 1px solid #0071c5;
-	line-height: 100%;
-	padding-bottom: 10px;
-	margin-bottom: 20px;
-	margin-top: 20px;
-	font-weight: normal;
-	border-bottom: 0 none;
-	margin-left: 0;
-	font-size: 18pt;
-	border-bottom: 1px solid #0071c5;
-	line-height: 100%;
-	padding-bottom: 10px;
-	margin-bottom: 20px;
-	margin-top: 20px;
-}
-
-h2
-{
-	color: #0071c5;
-	margin-top: 15pt;
-	margin-bottom: 5pt;
-	font-size: 12pt;
-	color: #0071c5;
-	margin-top: 15pt;
-	margin-bottom: 5pt;
-	font-size: 12pt;
-}
-
-h3
-{
-	color: #333333;
-	font-weight: bold;
-	margin-top: 15pt;
-	margin-bottom: 5pt;
-	font-size: 11pt;
-	color: #333333;
-	font-weight: bold;
-	margin-top: 15pt;
-	margin-bottom: 5pt;
-	font-size: 11pt;
-}
-
-h4
-{
-	color: #0071c5;
-	margin-top: 10pt;
-	margin-bottom: 5pt;
-	padding-left: 0px;
-	font-size: 10pt;
-	color: #0071c5;
-	margin-top: 10pt;
-	margin-bottom: 5pt;
-	padding-left: 0px;
-	font-size: 10pt;
-}
-
-h5
-{
-	color: #0071c5;
-	margin-top: 10pt;
-	margin-bottom: 5pt;
-	padding-left: 0px;
-	font-size: 10pt;
-	color: #0071c5;
-	margin-top: 10pt;
-	margin-bottom: 5pt;
-	padding-left: 0px;
-	font-size: 10pt;
-}
-
-h6
-{
-	color: #0071c5;
-	margin-top: 10pt;
-	margin-bottom: 5pt;
-	padding-left: 0px;
-	font-size: 10pt;
-	color: #0071c5;
-	margin-top: 10pt;
-	margin-bottom: 5pt;
-	padding-left: 0px;
-	font-size: 10pt;
-}
-
-.relinfo
-{
-	padding-left: 30px;
-	padding-left: 30px;
-}
-
-.tablecap
-{
-	color: #0071c5;
-}
-
-caption
-{
-	font-weight: bold;
-	text-align: left;
-	font-weight: bold;
-	text-align: left;
-	font-size: 12pt;
-}
-
-.figcap
-{
-	margin-left: 24px;
-	font-size: 10pt;
-	font-weight: bold;
-	text-align: center;
-	margin-left: 24px;
-	font-size: 10pt;
-	font-weight: bold;
-	text-align: center;
-}
-
-.sectiontitle
-{
-	padding-left: 0px;
-	padding-left: 0px;
-}
-
-.linklist
-{
-	padding-left: 0px;
-	padding-left: 0px;
-}
-
-h1.topictitle1
-{
-	color: #0071c5;
-	font-size: 18pt;
-	margin-left: 0pt;
-	margin-bottom: 15px;
-	color: #0071c5;
-	font-size: 18pt;
-	margin-left: 0pt;
-	margin-bottom: 15px;
-}
-
-#header_text
-{
-	color: #0071C5;
-	text-align: right;
-	color: #0071C5;
-	text-align: right;
-}
-
-.titlepage
-{
-	margin-right: 15%;
-	margin-right: 15%;
-}
-
-.familylinks
-{
-	margin-top: 1em;
-	margin-top: 1em;
-}
-
-a.start
-{
-	font-size: 18pt;
-	text-decoration: underline;
-	font-size: 18pt;
-	text-decoration: underline;
-}
-
-a.underlined
-{
-	text-decoration: underline;
-	text-decoration: underline;
-}
-
-.shortdesc
-{
-	font-size: inherit;
-	padding-left: inherit;
-	line-height: 16pt;
-	margin-top: 0px;
-	margin-bottom: 0.5em;
-	font-size: inherit;
-	padding-left: inherit;
-	line-height: 16pt;
-	margin-top: 0px;
-	margin-bottom: 0.5em;
-}
-
-.shortdesc-it
-{
-	font-style: italic;
-	font-style: italic;
-}
-
-p
-{
-	margin-left: 0px;
-	line-height: 120%;
-	margin-top: 0;
-	margin-bottom: 10px;
-	margin-left: 0px;
-	line-height: 120%;
-	margin-top: 0;
-	margin-bottom: 10px;
-	font-size: 12pt;
-}
-
-.p
-{
-	font-size: inherit;
-	margin-left: 0px;
-	line-height: 170%;
-	margin-top: 0;
-	margin-bottom: 5pt;
-	padding-left: 0pt;
-	font-size: inherit;
-	margin-left: 0px;
-	line-height: 170%;
-	margin-top: 0;
-	margin-bottom: 5pt;
-	padding-left: 0pt;
-}
-
-table
-{
-	margin-bottom: 5pt;
-	border-collapse: collapse;
-	margin-left: 0px;
-	margin-top: 0.3em;
-	font-size: 10pt;
-	margin-bottom: 5pt;
-	border-collapse: collapse;
-	margin-left: 0px;
-	margin-top: 0.3em;
-	font-size: 10pt;
-}
-
-tr
-{
-	vertical-align: top;
-	vertical-align: top;
-}
-
-DIV.Note
-{
-	margin-top: 20pt;
-	margin-bottom: 20pt;
-	margin-right: 0.46cm;
-	padding-left: 5px;
-	border-top-style: solid;
-	border-top-width: 1px;
-	border-bottom-style: solid;
-	border-bottom-width: 1px;
-	font-size: 10pt;
-}
-
-p.NoteTipHead
-{
-	font-weight: bold;
-	font-style: italic;
-	margin-top: 9pt;
-	margin-bottom: 3pt;
-	line-height: 15pt;
-	margin-left: 0.202cm;
-	font-family: "Verdana", "sans-serif";
-	text-transform: uppercase;
-	text-align: justify;
-	font-size: 12pt;
-}
-
-MadCap|xref
-{
-	color: #0860a8;
-	mc-format: '{paratext}';
-	text-decoration: none;
-	font-size: 12pt;
-}
-
-div.NoteCont
-{
-	border-bottom-style: solid;
-	border-bottom-width: 1px;
-	border-top-style: solid;
-	border-top-width: 1px;
-	font-size: 10pt;
-}
-
-p.figcap
-{
-	text-align: left;
-	font-size: 12pt;
-}
-
-th
-{
-	text-align: left;
-	font-size: 12pt;
-}
-
-ul
-{
-	font-size: 12pt;
-}
-
-ol
-{
-	font-size: 12pt;
-}
-
-li
-{
-	font-size: 12pt;
-}
-
-b
-{
-	font-size: 12pt;
-}
-
-code
-{
-	font-size: 12pt;
-}
-
-a:link
-{
-	color: #0071c5;
-	text-decoration: none;
-	color: #0071c5;
-	text-decoration: none;
-}
-
-a:visited
-{
-	color: #0071c5;
-	text-decoration: none;
-	color: #0071c5;
-	text-decoration: none;
-}
-
-a:hover
-{
-	color: #00aeef;
-	text-decoration: underline;
-	color: #00aeef;
-	text-decoration: underline;
-}
-
-a:active
-{
-	color: #0071c5;
-	text-decoration: underline;
-	color: #0071c5;
-	text-decoration: underline;
-}
-
-a.start:visited
-{
-	color: #0071c5;
-	text-decoration: underline;
-	color: #0071c5;
-	text-decoration: underline;
-}
-
-a.start:active
-{
-	color: #0071c5;
-	text-decoration: underline;
-	color: #0071c5;
-	text-decoration: underline;
-}
-
-a.underlined:visited
-{
-	color: #0071c5;
-	text-decoration: underline;
-	color: #0071c5;
-	text-decoration: underline;
-}
-
-a.underlined:active
-{
-	color: #0071c5;
-	text-decoration: underline;
-	color: #0071c5;
-	text-decoration: underline;
-}
-
+/*************************************************************************/
+/* Copyright (c) 2016 Intel Corporation.				 */
+/* 									 */
+/* All rights reserved. This program and the accompanying materials	 */
+/* are made available under the terms of the Eclipse Public License v1.0 */
+/* which accompanies this distribution, and is available at		 */
+/* http://www.eclipse.org/legal/epl-v10.html				 */
+/* 									 */
+/* Contributors:							 */
+/*     Intel Corporation - initial implementation and documentation	 */
+/*************************************************************************/
+/*<meta />*/
+
+/*begin-old-version{{*/
+
+body
+{
+	color: #333333;
+	background-color: #ffffff;
+	font-family: "Intel Clear", Verdana, Arial, sans-serif;
+	margin-left: 30px;
+	margin-right: 30px;
+	margin-bottom: 7%;
+	color: #333333;
+	background-color: #ffffff;
+	font-family: "Intel Clear", Verdana, Arial, sans-serif;
+	margin-left: 30px;
+	margin-right: 30px;
+	margin-bottom: 7%;
+	font-size: 12pt;
+}
+
+.RevUpdate
+{
+	background-color: #FFFF99;
+	font-weight: normal;
+	line-height: 100%;
+	background-color: #FFFF99;
+	font-weight: normal;
+	line-height: 100%;
+}
+
+.NonStdFortran
+{
+	color: #007F00;
+	color: #007F00;
+}
+
+body.OH_VSIP_body
+{
+	margin-left: 30px;
+	margin-left: 30px;
+}
+
+DIV.OH_outerContent
+{
+	border: 0px none #FFFFFF;
+	border: 0px none #ffffff;
+}
+
+h1
+{
+	color: #0071c5;
+	font-size: 15pt;
+	font-weight: normal;
+	padding-bottom: 1px;
+	margin-left: 0pt;
+	margin-bottom: 0px;
+	color: #0071c5;
+	font-size: 15pt;
+	font-weight: normal;
+	padding-bottom: 1px;
+	margin-left: 0pt;
+	margin-bottom: 0px;
+}
+
+h1.firsttitle
+{
+	font-weight: normal;
+	border-bottom: 0 none;
+	margin-left: 0;
+	font-size: 18pt;
+	border-bottom: 1px solid #0071c5;
+	line-height: 100%;
+	padding-bottom: 10px;
+	margin-bottom: 20px;
+	margin-top: 20px;
+	font-weight: normal;
+	border-bottom: 0 none;
+	margin-left: 0;
+	font-size: 18pt;
+	border-bottom: 1px solid #0071c5;
+	line-height: 100%;
+	padding-bottom: 10px;
+	margin-bottom: 20px;
+	margin-top: 20px;
+}
+
+h2
+{
+	color: #0071c5;
+	margin-top: 15pt;
+	margin-bottom: 5pt;
+	font-size: 12pt;
+	color: #0071c5;
+	margin-top: 15pt;
+	margin-bottom: 5pt;
+	font-size: 12pt;
+}
+
+h3
+{
+	color: #333333;
+	font-weight: bold;
+	margin-top: 15pt;
+	margin-bottom: 5pt;
+	font-size: 11pt;
+	color: #333333;
+	font-weight: bold;
+	margin-top: 15pt;
+	margin-bottom: 5pt;
+	font-size: 11pt;
+}
+
+h4
+{
+	color: #0071c5;
+	margin-top: 10pt;
+	margin-bottom: 5pt;
+	padding-left: 0px;
+	font-size: 10pt;
+	color: #0071c5;
+	margin-top: 10pt;
+	margin-bottom: 5pt;
+	padding-left: 0px;
+	font-size: 10pt;
+}
+
+h5
+{
+	color: #0071c5;
+	margin-top: 10pt;
+	margin-bottom: 5pt;
+	padding-left: 0px;
+	font-size: 10pt;
+	color: #0071c5;
+	margin-top: 10pt;
+	margin-bottom: 5pt;
+	padding-left: 0px;
+	font-size: 10pt;
+}
+
+h6
+{
+	color: #0071c5;
+	margin-top: 10pt;
+	margin-bottom: 5pt;
+	padding-left: 0px;
+	font-size: 10pt;
+	color: #0071c5;
+	margin-top: 10pt;
+	margin-bottom: 5pt;
+	padding-left: 0px;
+	font-size: 10pt;
+}
+
+.relinfo
+{
+	padding-left: 30px;
+	padding-left: 30px;
+}
+
+.tablecap
+{
+	color: #0071c5;
+}
+
+caption
+{
+	font-weight: bold;
+	text-align: left;
+	font-weight: bold;
+	text-align: left;
+	font-size: 12pt;
+}
+
+.figcap
+{
+	margin-left: 24px;
+	font-size: 10pt;
+	font-weight: bold;
+	text-align: center;
+	margin-left: 24px;
+	font-size: 10pt;
+	font-weight: bold;
+	text-align: center;
+}
+
+.sectiontitle
+{
+	padding-left: 0px;
+	padding-left: 0px;
+}
+
+.linklist
+{
+	padding-left: 0px;
+	padding-left: 0px;
+}
+
+h1.topictitle1
+{
+	color: #0071c5;
+	font-size: 18pt;
+	margin-left: 0pt;
+	margin-bottom: 15px;
+	color: #0071c5;
+	font-size: 18pt;
+	margin-left: 0pt;
+	margin-bottom: 15px;
+}
+
+#header_text
+{
+	color: #0071C5;
+	text-align: right;
+	color: #0071C5;
+	text-align: right;
+}
+
+.titlepage
+{
+	margin-right: 15%;
+	margin-right: 15%;
+}
+
+.familylinks
+{
+	margin-top: 1em;
+	margin-top: 1em;
+}
+
+a.start
+{
+	font-size: 18pt;
+	text-decoration: underline;
+	font-size: 18pt;
+	text-decoration: underline;
+}
+
+a.underlined
+{
+	text-decoration: underline;
+	text-decoration: underline;
+}
+
+.shortdesc
+{
+	font-size: inherit;
+	padding-left: inherit;
+	line-height: 16pt;
+	margin-top: 0px;
+	margin-bottom: 0.5em;
+	font-size: inherit;
+	padding-left: inherit;
+	line-height: 16pt;
+	margin-top: 0px;
+	margin-bottom: 0.5em;
+}
+
+.shortdesc-it
+{
+	font-style: italic;
+	font-style: italic;
+}
+
+p
+{
+	margin-left: 0px;
+	line-height: 120%;
+	margin-top: 0;
+	margin-bottom: 10px;
+	margin-left: 0px;
+	line-height: 120%;
+	margin-top: 0;
+	margin-bottom: 10px;
+	font-size: 12pt;
+}
+
+.p
+{
+	font-size: inherit;
+	margin-left: 0px;
+	line-height: 170%;
+	margin-top: 0;
+	margin-bottom: 5pt;
+	padding-left: 0pt;
+	font-size: inherit;
+	margin-left: 0px;
+	line-height: 170%;
+	margin-top: 0;
+	margin-bottom: 5pt;
+	padding-left: 0pt;
+}
+
+table
+{
+	margin-bottom: 5pt;
+	border-collapse: collapse;
+	margin-left: 0px;
+	margin-top: 0.3em;
+	font-size: 10pt;
+	margin-bottom: 5pt;
+	border-collapse: collapse;
+	margin-left: 0px;
+	margin-top: 0.3em;
+	font-size: 10pt;
+}
+
+tr
+{
+	vertical-align: top;
+	vertical-align: top;
+}
+
+DIV.Note
+{
+	margin-top: 20pt;
+	margin-bottom: 20pt;
+	margin-right: 0.46cm;
+	padding-left: 5px;
+	border-top-style: solid;
+	border-top-width: 1px;
+	border-bottom-style: solid;
+	border-bottom-width: 1px;
+	font-size: 10pt;
+}
+
+p.NoteTipHead
+{
+	font-weight: bold;
+	font-style: italic;
+	margin-top: 9pt;
+	margin-bottom: 3pt;
+	line-height: 15pt;
+	margin-left: 0.202cm;
+	font-family: "Verdana", "sans-serif";
+	text-transform: uppercase;
+	text-align: justify;
+	font-size: 12pt;
+}
+
+MadCap|xref
+{
+	color: #0860a8;
+	mc-format: '{paratext}';
+	text-decoration: none;
+	font-size: 12pt;
+}
+
+div.NoteCont
+{
+	border-bottom-style: solid;
+	border-bottom-width: 1px;
+	border-top-style: solid;
+	border-top-width: 1px;
+	font-size: 10pt;
+}
+
+p.figcap
+{
+	text-align: left;
+	font-size: 12pt;
+}
+
+th
+{
+	text-align: left;
+	font-size: 12pt;
+}
+
+ul
+{
+	font-size: 12pt;
+}
+
+ol
+{
+	font-size: 12pt;
+}
+
+li
+{
+	font-size: 12pt;
+}
+
+b
+{
+	font-size: 12pt;
+}
+
+code
+{
+	font-size: 12pt;
+}
+
+a:link
+{
+	color: #0071c5;
+	text-decoration: none;
+	color: #0071c5;
+	text-decoration: none;
+}
+
+a:visited
+{
+	color: #0071c5;
+	text-decoration: none;
+	color: #0071c5;
+	text-decoration: none;
+}
+
+a:hover
+{
+	color: #00aeef;
+	text-decoration: underline;
+	color: #00aeef;
+	text-decoration: underline;
+}
+
+a:active
+{
+	color: #0071c5;
+	text-decoration: underline;
+	color: #0071c5;
+	text-decoration: underline;
+}
+
+a.start:visited
+{
+	color: #0071c5;
+	text-decoration: underline;
+	color: #0071c5;
+	text-decoration: underline;
+}
+
+a.start:active
+{
+	color: #0071c5;
+	text-decoration: underline;
+	color: #0071c5;
+	text-decoration: underline;
+}
+
+a.underlined:visited
+{
+	color: #0071c5;
+	text-decoration: underline;
+	color: #0071c5;
+	text-decoration: underline;
+}
+
+a.underlined:active
+{
+	color: #0071c5;
+	text-decoration: underline;
+	color: #0071c5;
+	text-decoration: underline;
+}
+

+ 24 - 24
Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/plugin.xml

@@ -1,24 +1,24 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--                                                                       -->
-<!-- Copyright (c) 2016 Intel Corporation.				   -->
-<!-- 									   -->
-<!-- All rights reserved. This program and the accompanying materials	   -->
-<!-- are made available under the terms of the Eclipse Public License v1.0 -->
-<!-- which accompanies this distribution, and is available at		   -->
-<!-- http://www.eclipse.org/legal/epl-v10.html				   -->
-<!-- 									   -->
-<!-- Contributors:							   -->
-<!--     Intel Corporation - initial implementation and documentation	   -->
-<!--                                                                       -->
-<?eclipse version="3.4"?>
-<plugin>
-
-   <extension
-         point="org.eclipse.help.toc">
-      <toc
-            file="toc.xml"
-            primary="true">
-      </toc>
-   </extension>
-
-</plugin>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--                                                                       -->
+<!-- Copyright (c) 2016 Intel Corporation.				   -->
+<!-- 									   -->
+<!-- All rights reserved. This program and the accompanying materials	   -->
+<!-- are made available under the terms of the Eclipse Public License v1.0 -->
+<!-- which accompanies this distribution, and is available at		   -->
+<!-- http://www.eclipse.org/legal/epl-v10.html				   -->
+<!-- 									   -->
+<!-- Contributors:							   -->
+<!--     Intel Corporation - initial implementation and documentation	   -->
+<!--                                                                       -->
+<?eclipse version="3.4"?>
+<plugin>
+
+   <extension
+         point="org.eclipse.help.toc">
+      <toc
+            file="toc.xml"
+            primary="true">
+      </toc>
+   </extension>
+
+</plugin>

+ 73 - 73
Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/src/com/intel/sgx/userguide/Activator.java

@@ -1,73 +1,73 @@
-///////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2016 Intel Corporation.				 //
-// 									 //
-// All rights reserved. This program and the accompanying materials	 //
-// are made available under the terms of the Eclipse Public License v1.0 //
-// which accompanies this distribution, and is available at		 //
-// http://www.eclipse.org/legal/epl-v10.html				 //
-// 									 //
-// Contributors:							 //
-//     Intel Corporation - initial implementation and documentation	 //
-///////////////////////////////////////////////////////////////////////////
-
-package com.intel.sgx.userguide;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class Activator extends AbstractUIPlugin {
-
-	// The plug-in ID
-	public static final String PLUGIN_ID = "com.intel.sgx.userguide"; //$NON-NLS-1$
-
-	// The shared instance
-	private static Activator plugin;
-	
-	/**
-	 * The constructor
-	 */
-	public Activator() {
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
-	 */
-	public void start(BundleContext context) throws Exception {
-		super.start(context);
-		plugin = this;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
-	 */
-	public void stop(BundleContext context) throws Exception {
-		plugin = null;
-		super.stop(context);
-	}
-
-	/**
-	 * Returns the shared instance
-	 *
-	 * @return the shared instance
-	 */
-	public static Activator getDefault() {
-		return plugin;
-	}
-
-	/**
-	 * Returns an image descriptor for the image file at the given
-	 * plug-in relative path
-	 *
-	 * @param path the path
-	 * @return the image descriptor
-	 */
-	public static ImageDescriptor getImageDescriptor(String path) {
-		return imageDescriptorFromPlugin(PLUGIN_ID, path);
-	}
-}
+///////////////////////////////////////////////////////////////////////////
+// Copyright (c) 2016 Intel Corporation.				 //
+// 									 //
+// All rights reserved. This program and the accompanying materials	 //
+// are made available under the terms of the Eclipse Public License v1.0 //
+// which accompanies this distribution, and is available at		 //
+// http://www.eclipse.org/legal/epl-v10.html				 //
+// 									 //
+// Contributors:							 //
+//     Intel Corporation - initial implementation and documentation	 //
+///////////////////////////////////////////////////////////////////////////
+
+package com.intel.sgx.userguide;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+	// The plug-in ID
+	public static final String PLUGIN_ID = "com.intel.sgx.userguide"; //$NON-NLS-1$
+
+	// The shared instance
+	private static Activator plugin;
+	
+	/**
+	 * The constructor
+	 */
+	public Activator() {
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+	 */
+	public void start(BundleContext context) throws Exception {
+		super.start(context);
+		plugin = this;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+	 */
+	public void stop(BundleContext context) throws Exception {
+		plugin = null;
+		super.stop(context);
+	}
+
+	/**
+	 * Returns the shared instance
+	 *
+	 * @return the shared instance
+	 */
+	public static Activator getDefault() {
+		return plugin;
+	}
+
+	/**
+	 * Returns an image descriptor for the image file at the given
+	 * plug-in relative path
+	 *
+	 * @param path the path
+	 * @return the image descriptor
+	 */
+	public static ImageDescriptor getImageDescriptor(String path) {
+		return imageDescriptorFromPlugin(PLUGIN_ID, path);
+	}
+}

+ 24 - 24
Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/build.properties

@@ -1,24 +1,24 @@
-#########################################################################
-# Copyright (c) 2016 Intel Corporation.				        #
-# 								        #
-# All rights reserved. This program and the accompanying materials      #
-# are made available under the terms of the Eclipse Public License v1.0 #
-# which accompanies this distribution, and is available at	        #
-# http://www.eclipse.org/legal/epl-v10.html			        #
-# 								        #
-# Contributors:							        #
-#     Intel Corporation - initial implementation and documentation      #
-#########################################################################
-
-
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
-               .,\
-               plugin.xml,\
-               templates/,\
-               discovery/,\
-               build.properties,\
-               OSGI-INF/,\
-               OSGI-INF/l10n/bundle.properties
-jre.compilation.profile = JavaSE-1.8
+#########################################################################
+# Copyright (c) 2016 Intel Corporation.				        #
+# 								        #
+# All rights reserved. This program and the accompanying materials      #
+# are made available under the terms of the Eclipse Public License v1.0 #
+# which accompanies this distribution, and is available at	        #
+# http://www.eclipse.org/legal/epl-v10.html			        #
+# 								        #
+# Contributors:							        #
+#     Intel Corporation - initial implementation and documentation      #
+#########################################################################
+
+
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+               .,\
+               plugin.xml,\
+               templates/,\
+               discovery/,\
+               build.properties,\
+               OSGI-INF/,\
+               OSGI-INF/l10n/bundle.properties
+jre.compilation.profile = JavaSE-1.8

+ 75 - 75
Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/Activator.java

@@ -1,75 +1,75 @@
-///////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2016 Intel Corporation.				 //
-// 									 //
-// All rights reserved. This program and the accompanying materials	 //
-// are made available under the terms of the Eclipse Public License v1.0 //
-// which accompanies this distribution, and is available at		 //
-// http://www.eclipse.org/legal/epl-v10.html				 //
-// 									 //
-// Contributors:							 //
-//     Intel Corporation - initial implementation and documentation	 //
-///////////////////////////////////////////////////////////////////////////
-
-package com.intel.sgx;
-
-import java.net.URL;
-
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class Activator extends AbstractUIPlugin {
-
-	public static final String PLUGIN_ID = "com.intel.sgx";//$NON-NLS-1$
-
-	private static Activator plugin;
-	
-	public Activator() {
-	}
-
-	public void start(BundleContext context) throws Exception {
-		super.start(context);
-		plugin = this;
-	}
-
-	public void stop(BundleContext context) throws Exception {
-		plugin = null;
-		super.stop(context);
-	}
-
-	public static Activator getDefault() {
-		return plugin;
-	}
-
-	public static ImageDescriptor getImageDescriptor(String path) {
-		return imageDescriptorFromPlugin(PLUGIN_ID, path);
-	}
-
-	public static void log(Exception e) {
-		plugin.getLog().log(newStatus(e));
-	}
-
-	public static IStatus newStatus(Exception e) {
-		return new Status(IStatus.ERROR, PLUGIN_ID, e.getMessage(), e);
-	}
-
-	public static URL findFile(Path path) {
-		return FileLocator.find(plugin.getBundle(), path, null);
-	}
-	
-	public static Bundle getBundle(String id){
-		for(Bundle bundle : plugin.getBundle().getBundleContext().getBundles()){
-			if(bundle.getSymbolicName().equals(id))
-				return bundle;
-		}
-		return null;
-	}
-}
+///////////////////////////////////////////////////////////////////////////
+// Copyright (c) 2016 Intel Corporation.				 //
+// 									 //
+// All rights reserved. This program and the accompanying materials	 //
+// are made available under the terms of the Eclipse Public License v1.0 //
+// which accompanies this distribution, and is available at		 //
+// http://www.eclipse.org/legal/epl-v10.html				 //
+// 									 //
+// Contributors:							 //
+//     Intel Corporation - initial implementation and documentation	 //
+///////////////////////////////////////////////////////////////////////////
+
+package com.intel.sgx;
+
+import java.net.URL;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+	public static final String PLUGIN_ID = "com.intel.sgx";//$NON-NLS-1$
+
+	private static Activator plugin;
+	
+	public Activator() {
+	}
+
+	public void start(BundleContext context) throws Exception {
+		super.start(context);
+		plugin = this;
+	}
+
+	public void stop(BundleContext context) throws Exception {
+		plugin = null;
+		super.stop(context);
+	}
+
+	public static Activator getDefault() {
+		return plugin;
+	}
+
+	public static ImageDescriptor getImageDescriptor(String path) {
+		return imageDescriptorFromPlugin(PLUGIN_ID, path);
+	}
+
+	public static void log(Exception e) {
+		plugin.getLog().log(newStatus(e));
+	}
+
+	public static IStatus newStatus(Exception e) {
+		return new Status(IStatus.ERROR, PLUGIN_ID, e.getMessage(), e);
+	}
+
+	public static URL findFile(Path path) {
+		return FileLocator.find(plugin.getBundle(), path, null);
+	}
+	
+	public static Bundle getBundle(String id){
+		for(Bundle bundle : plugin.getBundle().getBundleContext().getBundles()){
+			if(bundle.getSymbolicName().equals(id))
+				return bundle;
+		}
+		return null;
+	}
+}

+ 46 - 46
Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/CConfigurationDataProvider2.java

@@ -1,46 +1,46 @@
-///////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2016 Intel Corporation.				 //
-// 									 //
-// All rights reserved. This program and the accompanying materials	 //
-// are made available under the terms of the Eclipse Public License v1.0 //
-// which accompanies this distribution, and is available at		 //
-// http://www.eclipse.org/legal/epl-v10.html				 //
-// 									 //
-// Contributors:							 //
-//     Intel Corporation - initial implementation and documentation	 //
-///////////////////////////////////////////////////////////////////////////
-
-
-package com.intel.sgx;
-
-import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
-import org.eclipse.cdt.core.settings.model.extension.CConfigurationData;
-import org.eclipse.cdt.core.settings.model.extension.CConfigurationDataProvider;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-
-public class CConfigurationDataProvider2 extends CConfigurationDataProvider {
-
-	public CConfigurationDataProvider2() {
-	}
-
-	@Override
-	public CConfigurationData loadConfiguration(ICConfigurationDescription des,
-			IProgressMonitor monitor) throws CoreException {
-		return null;
-	}
-
-	@Override
-	public CConfigurationData createConfiguration(
-			ICConfigurationDescription des,
-			ICConfigurationDescription baseDescription,
-			CConfigurationData baseData, boolean clone, IProgressMonitor monitor)
-			throws CoreException {
-		return null;
-	}
-
-	@Override
-	public void removeConfiguration(ICConfigurationDescription des,
-			CConfigurationData data, IProgressMonitor monitor) {
-	}
-}
+///////////////////////////////////////////////////////////////////////////
+// Copyright (c) 2016 Intel Corporation.				 //
+// 									 //
+// All rights reserved. This program and the accompanying materials	 //
+// are made available under the terms of the Eclipse Public License v1.0 //
+// which accompanies this distribution, and is available at		 //
+// http://www.eclipse.org/legal/epl-v10.html				 //
+// 									 //
+// Contributors:							 //
+//     Intel Corporation - initial implementation and documentation	 //
+///////////////////////////////////////////////////////////////////////////
+
+
+package com.intel.sgx;
+
+import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
+import org.eclipse.cdt.core.settings.model.extension.CConfigurationData;
+import org.eclipse.cdt.core.settings.model.extension.CConfigurationDataProvider;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+
+public class CConfigurationDataProvider2 extends CConfigurationDataProvider {
+
+	public CConfigurationDataProvider2() {
+	}
+
+	@Override
+	public CConfigurationData loadConfiguration(ICConfigurationDescription des,
+			IProgressMonitor monitor) throws CoreException {
+		return null;
+	}
+
+	@Override
+	public CConfigurationData createConfiguration(
+			ICConfigurationDescription des,
+			ICConfigurationDescription baseDescription,
+			CConfigurationData baseData, boolean clone, IProgressMonitor monitor)
+			throws CoreException {
+		return null;
+	}
+
+	@Override
+	public void removeConfiguration(ICConfigurationDescription des,
+			CConfigurationData data, IProgressMonitor monitor) {
+	}
+}

+ 70 - 70
Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/SdkPathVariableProvider.java

@@ -1,70 +1,70 @@
-///////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2016 Intel Corporation.				 //
-// 									 //
-// All rights reserved. This program and the accompanying materials	 //
-// are made available under the terms of the Eclipse Public License v1.0 //
-// which accompanies this distribution, and is available at		 //
-// http://www.eclipse.org/legal/epl-v10.html				 //
-// 									 //
-// Contributors:							 //
-//     Intel Corporation - initial implementation and documentation	 //
-///////////////////////////////////////////////////////////////////////////
-
-
-package com.intel.sgx;
-import java.io.File;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.variableresolvers.PathVariableResolver;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.preference.IPreferenceStore;
-
-import com.intel.sgx.preferences.PreferenceConstants;
-import com.intel.sgx.preferences.SGXPreferencePage;
-
-public class SdkPathVariableProvider extends PathVariableResolver {
-
-	public SdkPathVariableProvider() {
-		super();
-	}
-
-	@Override
-	public String[] getVariableNames(String variable, IResource resource) {
-		String variableNames[] = {"SGX_SDK_DIR_PATH"};
-		return (variableNames);
-	}
-	
-	@Override
-	public String getValue(String variable, IResource resource) {
-		if(variable.equals("SGX_SDK_DIR_PATH")) {		
-			IPreferenceStore store = Activator.getDefault().getPreferenceStore();
-			String SDKPath = store.getString(PreferenceConstants.SDK_PATH);
-			IPath SDKCanonicalPath= new Path(SDKPath);
-			return(SDKCanonicalPath.append("Include").toOSString());
-		}					
-		return null;
-	}
-	
-	public static String getSGXSdkLocation() {
-        return Activator.getDefault().getPreferenceStore().getString(PreferenceConstants.SDK_PATH);
-    }
-	
-	public static boolean isSGXSdkLocationValid() {
-        String location = getSGXSdkLocation();
-        if (location.length() == 0)
-            return false;
-
-        return isValidSGXSdkLocation(location);
-    }
-
-    public static boolean isValidSGXSdkLocation(String location) {
-    	File dir = new File(location);
-        if (!dir.isDirectory())
-            return false;
-        
-        return new PreferenceConstants.SGXSDK64Descriptor(dir).getSignerPath().canExecute()
-        		|| new PreferenceConstants.SGXSDK32Descriptor(dir).getSignerPath().canExecute();
-    }
-
-}
+///////////////////////////////////////////////////////////////////////////
+// Copyright (c) 2016 Intel Corporation.				 //
+// 									 //
+// All rights reserved. This program and the accompanying materials	 //
+// are made available under the terms of the Eclipse Public License v1.0 //
+// which accompanies this distribution, and is available at		 //
+// http://www.eclipse.org/legal/epl-v10.html				 //
+// 									 //
+// Contributors:							 //
+//     Intel Corporation - initial implementation and documentation	 //
+///////////////////////////////////////////////////////////////////////////
+
+
+package com.intel.sgx;
+import java.io.File;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.variableresolvers.PathVariableResolver;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.preference.IPreferenceStore;
+
+import com.intel.sgx.preferences.PreferenceConstants;
+import com.intel.sgx.preferences.SGXPreferencePage;
+
+public class SdkPathVariableProvider extends PathVariableResolver {
+
+	public SdkPathVariableProvider() {
+		super();
+	}
+
+	@Override
+	public String[] getVariableNames(String variable, IResource resource) {
+		String variableNames[] = {"SGX_SDK_DIR_PATH"};
+		return (variableNames);
+	}
+	
+	@Override
+	public String getValue(String variable, IResource resource) {
+		if(variable.equals("SGX_SDK_DIR_PATH")) {		
+			IPreferenceStore store = Activator.getDefault().getPreferenceStore();
+			String SDKPath = store.getString(PreferenceConstants.SDK_PATH);
+			IPath SDKCanonicalPath= new Path(SDKPath);
+			return(SDKCanonicalPath.append("Include").toOSString());
+		}					
+		return null;
+	}
+	
+	public static String getSGXSdkLocation() {
+        return Activator.getDefault().getPreferenceStore().getString(PreferenceConstants.SDK_PATH);
+    }
+	
+	public static boolean isSGXSdkLocationValid() {
+        String location = getSGXSdkLocation();
+        if (location.length() == 0)
+            return false;
+
+        return isValidSGXSdkLocation(location);
+    }
+
+    public static boolean isValidSGXSdkLocation(String location) {
+    	File dir = new File(location);
+        if (!dir.isDirectory())
+            return false;
+        
+        return new PreferenceConstants.SGXSDK64Descriptor(dir).getSignerPath().canExecute()
+        		|| new PreferenceConstants.SGXSDK32Descriptor(dir).getSignerPath().canExecute();
+    }
+
+}

+ 38 - 38
Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/build/SGXSDKCommandLauncher.java

@@ -1,38 +1,38 @@
-///////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2016 Intel Corporation.				 //
-// 									 //
-// All rights reserved. This program and the accompanying materials	 //
-// are made available under the terms of the Eclipse Public License v1.0 //
-// which accompanies this distribution, and is available at		 //
-// http://www.eclipse.org/legal/epl-v10.html				 //
-// 									 //
-// Contributors:							 //
-//     Intel Corporation - initial implementation and documentation	 //
-///////////////////////////////////////////////////////////////////////////
-
-
-/**
- * This class follows the same solution provided in the NDK_PLUGIN for NDKCommandLauncher.
- */
-package com.intel.sgx.build;
-
-import org.eclipse.cdt.core.CommandLauncher;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
-
-import com.intel.sgx.SdkPathVariableProvider;
-/**
- * This launches the sgx-ndk-build.
- */
-public class SGXSDKCommandLauncher extends CommandLauncher {
-
-    @Override
-    public Process execute(IPath commandPath, String[] args, String[] env, IPath changeToDirectory,
-            IProgressMonitor monitor)
-            throws CoreException {
-    	
-        return super.execute(commandPath, args, env, changeToDirectory, monitor);
-    }
-}
+///////////////////////////////////////////////////////////////////////////
+// Copyright (c) 2016 Intel Corporation.				 //
+// 									 //
+// All rights reserved. This program and the accompanying materials	 //
+// are made available under the terms of the Eclipse Public License v1.0 //
+// which accompanies this distribution, and is available at		 //
+// http://www.eclipse.org/legal/epl-v10.html				 //
+// 									 //
+// Contributors:							 //
+//     Intel Corporation - initial implementation and documentation	 //
+///////////////////////////////////////////////////////////////////////////
+
+
+/**
+ * This class follows the same solution provided in the NDK_PLUGIN for NDKCommandLauncher.
+ */
+package com.intel.sgx.build;
+
+import org.eclipse.cdt.core.CommandLauncher;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Path;
+
+import com.intel.sgx.SdkPathVariableProvider;
+/**
+ * This launches the sgx-ndk-build.
+ */
+public class SGXSDKCommandLauncher extends CommandLauncher {
+
+    @Override
+    public Process execute(IPath commandPath, String[] args, String[] env, IPath changeToDirectory,
+            IProgressMonitor monitor)
+            throws CoreException {
+    	
+        return super.execute(commandPath, args, env, changeToDirectory, monitor);
+    }
+}

+ 126 - 126
Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/dialogs/AddEnclaveFileDialog.java

@@ -1,126 +1,126 @@
-///////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2016 Intel Corporation.				 //
-// 									 //
-// All rights reserved. This program and the accompanying materials	 //
-// are made available under the terms of the Eclipse Public License v1.0 //
-// which accompanies this distribution, and is available at		 //
-// http://www.eclipse.org/legal/epl-v10.html				 //
-// 									 //
-// Contributors:							 //
-//     Intel Corporation - initial implementation and documentation	 //
-///////////////////////////////////////////////////////////////////////////
-
-
-package com.intel.sgx.dialogs;
-
-import javax.swing.JOptionPane;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-import com.intel.sgx.handlers.AddEnclave;
-
-public class AddEnclaveFileDialog extends SGXDialogBase {
-
-	private Text fileNameField;
-	private AddEnclave addHandler;
-	private boolean generateApp = true;
-	
-	public AddEnclaveFileDialog(Shell shell, AddEnclave addHandler) {
-		super(shell);
-		this.addHandler = addHandler;
-		this.shell = shell;
-		// setShellStyle(SWT.RESIZE | SWT.TITLE);
-	}
-	
-	public boolean generateApp()
-	{
-		return generateApp;
-	}
-	
-	@Override
-	protected Control createDialogArea(Composite parent) {
-		Composite composite = (Composite) super.createDialogArea(parent);
-		final GridLayout gridLayout = new GridLayout(1,false);
-		composite.setLayout(gridLayout);
-		
-		final Group container = new Group(composite, SWT.NONE);
-		container.setLayout(new GridLayout(3,false));
-		GridData innergrid1 = new GridData(GridData.FILL_HORIZONTAL);
-		innergrid1.horizontalSpan = 3;
-		container.setLayoutData(innergrid1);
-		
-		addLabel(container, "Enter the name of the Enclave. Make sure the name is unique within the hosting application.");
-			
-		final Label fileNameLabel = new Label(container, SWT.NONE);
-		fileNameLabel.setText("Enclave name:");
-		fileNameLabel.setLayoutData(new GridData(GridData.BEGINNING,GridData.CENTER, false, false));
-
-		fileNameField = new Text(container,SWT.SINGLE | SWT.BORDER);
-		GridData textGridData1 = new GridData(GridData.FILL_HORIZONTAL);
-		textGridData1.minimumWidth = 400;
-		textGridData1.grabExcessHorizontalSpace = true;
-		fileNameField.setLayoutData(textGridData1);
-
-        Button generateUntrustedApp = new Button(container, SWT.CHECK);
-        generateUntrustedApp.setText("Generate sample untrusted application?");
-        generateUntrustedApp.setLayoutData(new GridData(GridData.BEGINNING, GridData.END, false, false, 3, 1));
-        generateUntrustedApp.setSelection(true);
-        
-        generateUntrustedApp.addSelectionListener(new SelectionAdapter() {
-
-            @Override
-            public void widgetSelected(SelectionEvent event) {
-                Button btn = (Button) event.getSource();
-                generateApp = btn.getSelection();
-            }
-        });
-        
-        container.layout();
-        composite.layout();
-		return composite;
-	}
-
-	@Override
-	protected void configureShell(Shell newShell) {
-		super.configureShell(newShell);
-		newShell.setText("Add New Intel(R) SGX Enclave Dialog");
-		newShell.layout();
-	}
-	
-	@Override
-	protected
-	void okPressed() {
-		addHandler.edlFilename = fileNameField.getText();
-		if(!fileNameField.getText().isEmpty() 
-				){
-				if(Character.isDigit(fileNameField.getText().charAt(0)))
-				{
-				JOptionPane.showMessageDialog(null, "Enclave names starting with digits are not allowed.", "Error",
-						JOptionPane.ERROR_MESSAGE);
-				}
-				else
-				super.okPressed();
-		}
-	}
-	
-	@Override
-	protected Point getInitialSize(){
-		return new Point(675,200);
-	}
-	
-	public String getFileName() {
-		return fileNameField.getText();
-	}
-}
+///////////////////////////////////////////////////////////////////////////
+// Copyright (c) 2016 Intel Corporation.				 //
+// 									 //
+// All rights reserved. This program and the accompanying materials	 //
+// are made available under the terms of the Eclipse Public License v1.0 //
+// which accompanies this distribution, and is available at		 //
+// http://www.eclipse.org/legal/epl-v10.html				 //
+// 									 //
+// Contributors:							 //
+//     Intel Corporation - initial implementation and documentation	 //
+///////////////////////////////////////////////////////////////////////////
+
+
+package com.intel.sgx.dialogs;
+
+import javax.swing.JOptionPane;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+
+import com.intel.sgx.handlers.AddEnclave;
+
+public class AddEnclaveFileDialog extends SGXDialogBase {
+
+	private Text fileNameField;
+	private AddEnclave addHandler;
+	private boolean generateApp = true;
+	
+	public AddEnclaveFileDialog(Shell shell, AddEnclave addHandler) {
+		super(shell);
+		this.addHandler = addHandler;
+		this.shell = shell;
+		// setShellStyle(SWT.RESIZE | SWT.TITLE);
+	}
+	
+	public boolean generateApp()
+	{
+		return generateApp;
+	}
+	
+	@Override
+	protected Control createDialogArea(Composite parent) {
+		Composite composite = (Composite) super.createDialogArea(parent);
+		final GridLayout gridLayout = new GridLayout(1,false);
+		composite.setLayout(gridLayout);
+		
+		final Group container = new Group(composite, SWT.NONE);
+		container.setLayout(new GridLayout(3,false));
+		GridData innergrid1 = new GridData(GridData.FILL_HORIZONTAL);
+		innergrid1.horizontalSpan = 3;
+		container.setLayoutData(innergrid1);
+		
+		addLabel(container, "Enter the name of the Enclave. Make sure the name is unique within the hosting application.");
+			
+		final Label fileNameLabel = new Label(container, SWT.NONE);
+		fileNameLabel.setText("Enclave name:");
+		fileNameLabel.setLayoutData(new GridData(GridData.BEGINNING,GridData.CENTER, false, false));
+
+		fileNameField = new Text(container,SWT.SINGLE | SWT.BORDER);
+		GridData textGridData1 = new GridData(GridData.FILL_HORIZONTAL);
+		textGridData1.minimumWidth = 400;
+		textGridData1.grabExcessHorizontalSpace = true;
+		fileNameField.setLayoutData(textGridData1);
+
+        Button generateUntrustedApp = new Button(container, SWT.CHECK);
+        generateUntrustedApp.setText("Generate sample untrusted application?");
+        generateUntrustedApp.setLayoutData(new GridData(GridData.BEGINNING, GridData.END, false, false, 3, 1));
+        generateUntrustedApp.setSelection(true);
+        
+        generateUntrustedApp.addSelectionListener(new SelectionAdapter() {
+
+            @Override
+            public void widgetSelected(SelectionEvent event) {
+                Button btn = (Button) event.getSource();
+                generateApp = btn.getSelection();
+            }
+        });
+        
+        container.layout();
+        composite.layout();
+		return composite;
+	}
+
+	@Override
+	protected void configureShell(Shell newShell) {
+		super.configureShell(newShell);
+		newShell.setText("Add New Intel(R) SGX Enclave Dialog");
+		newShell.layout();
+	}
+	
+	@Override
+	protected
+	void okPressed() {
+		addHandler.edlFilename = fileNameField.getText();
+		if(!fileNameField.getText().isEmpty() 
+				){
+				if(Character.isDigit(fileNameField.getText().charAt(0)))
+				{
+				JOptionPane.showMessageDialog(null, "Enclave names starting with digits are not allowed.", "Error",
+						JOptionPane.ERROR_MESSAGE);
+				}
+				else
+				super.okPressed();
+		}
+	}
+	
+	@Override
+	protected Point getInitialSize(){
+		return new Point(675,200);
+	}
+	
+	public String getFileName() {
+		return fileNameField.getText();
+	}
+}

+ 109 - 109
Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/dialogs/AddTrustedStaticLibFileDialog.java

@@ -1,109 +1,109 @@
-///////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2016 Intel Corporation.				 //
-// 									 //
-// All rights reserved. This program and the accompanying materials	 //
-// are made available under the terms of the Eclipse Public License v1.0 //
-// which accompanies this distribution, and is available at		 //
-// http://www.eclipse.org/legal/epl-v10.html				 //
-// 									 //
-// Contributors:							 //
-//     Intel Corporation - initial implementation and documentation	 //
-///////////////////////////////////////////////////////////////////////////
-
-
-package com.intel.sgx.dialogs;
-
-import javax.swing.JOptionPane;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-import com.intel.sgx.handlers.AddTrustedStaticLib;
-
-public class AddTrustedStaticLibFileDialog extends SGXDialogBase  {
-
-	private Text fileNameField;
-	private AddTrustedStaticLib addHandler;
-	private boolean generateApp = false;
-
-	public AddTrustedStaticLibFileDialog(Shell shell, AddTrustedStaticLib addHandler) {
-		super(shell);
-		this.addHandler = addHandler;
-		this.shell = shell;
-		// setShellStyle(SWT.RESIZE | SWT.TITLE);
-	}
-
-	public boolean generateApp()
-	{
-		return generateApp;
-	}
-
-	@Override
-	protected Control createDialogArea(Composite parent) {
-		Composite composite = (Composite) super.createDialogArea(parent);
-		final GridLayout gridLayout = new GridLayout(1,false);
-		composite.setLayout(gridLayout);
-
-		final Group container = new Group(composite, SWT.NONE);
-		container.setLayout(new GridLayout(3,false));
-		GridData innergrid1 = new GridData(GridData.FILL_HORIZONTAL);
-		innergrid1.horizontalSpan = 3;
-		container.setLayoutData(innergrid1);
-
-		addLabel(container, "Enter the name of the Static Trusted Library.");
-		addLabel(container, "Make sure the name is unique within the hosting application.");
-
-		final Label fileNameLabel = new Label(container, SWT.NONE);
-		fileNameLabel.setText("Static Trusted Library Name:");
-		fileNameLabel.setLayoutData(new GridData(GridData.BEGINNING,GridData.CENTER, false, false));
-
-		fileNameField = new Text(container,SWT.SINGLE | SWT.BORDER);
-		GridData textGridData1 = new GridData(GridData.FILL_HORIZONTAL);
-		textGridData1.minimumWidth = 400;
-		textGridData1.grabExcessHorizontalSpace = true;
-		fileNameField.setLayoutData(textGridData1);
-
-		composite.layout();
-
-		return composite;
-	}
-
-	@Override
-	protected void configureShell(Shell newShell) {
-		super.configureShell(newShell);
-		newShell.setText("Add New Intel(R) SGX Static Trusted Library Dialog");
-	}
-
-	@Override
-	protected
-	void okPressed(){
-		addHandler.edlFilename = fileNameField.getText();
-		if(!fileNameField.getText().isEmpty() 
-				){
-			if(Character.isDigit(fileNameField.getText().charAt(0)))
-			{
-				JOptionPane.showMessageDialog(null, "Enclave names starting with digits are not allowed.", "Error",
-						JOptionPane.ERROR_MESSAGE);
-			}
-			else
-				super.okPressed();
-		}
-	}
-
-	@Override
-	protected Point getInitialSize(){
-		return new Point(675,200);
-	}
-
-	public String getFileName() {
-		return fileNameField.getText();
-	}
-}
+///////////////////////////////////////////////////////////////////////////
+// Copyright (c) 2016 Intel Corporation.				 //
+// 									 //
+// All rights reserved. This program and the accompanying materials	 //
+// are made available under the terms of the Eclipse Public License v1.0 //
+// which accompanies this distribution, and is available at		 //
+// http://www.eclipse.org/legal/epl-v10.html				 //
+// 									 //
+// Contributors:							 //
+//     Intel Corporation - initial implementation and documentation	 //
+///////////////////////////////////////////////////////////////////////////
+
+
+package com.intel.sgx.dialogs;
+
+import javax.swing.JOptionPane;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+
+import com.intel.sgx.handlers.AddTrustedStaticLib;
+
+public class AddTrustedStaticLibFileDialog extends SGXDialogBase  {
+
+	private Text fileNameField;
+	private AddTrustedStaticLib addHandler;
+	private boolean generateApp = false;
+
+	public AddTrustedStaticLibFileDialog(Shell shell, AddTrustedStaticLib addHandler) {
+		super(shell);
+		this.addHandler = addHandler;
+		this.shell = shell;
+		// setShellStyle(SWT.RESIZE | SWT.TITLE);
+	}
+
+	public boolean generateApp()
+	{
+		return generateApp;
+	}
+
+	@Override
+	protected Control createDialogArea(Composite parent) {
+		Composite composite = (Composite) super.createDialogArea(parent);
+		final GridLayout gridLayout = new GridLayout(1,false);
+		composite.setLayout(gridLayout);
+
+		final Group container = new Group(composite, SWT.NONE);
+		container.setLayout(new GridLayout(3,false));
+		GridData innergrid1 = new GridData(GridData.FILL_HORIZONTAL);
+		innergrid1.horizontalSpan = 3;
+		container.setLayoutData(innergrid1);
+
+		addLabel(container, "Enter the name of the Static Trusted Library.");
+		addLabel(container, "Make sure the name is unique within the hosting application.");
+
+		final Label fileNameLabel = new Label(container, SWT.NONE);
+		fileNameLabel.setText("Static Trusted Library Name:");
+		fileNameLabel.setLayoutData(new GridData(GridData.BEGINNING,GridData.CENTER, false, false));
+
+		fileNameField = new Text(container,SWT.SINGLE | SWT.BORDER);
+		GridData textGridData1 = new GridData(GridData.FILL_HORIZONTAL);
+		textGridData1.minimumWidth = 400;
+		textGridData1.grabExcessHorizontalSpace = true;
+		fileNameField.setLayoutData(textGridData1);
+
+		composite.layout();
+
+		return composite;
+	}
+
+	@Override
+	protected void configureShell(Shell newShell) {
+		super.configureShell(newShell);
+		newShell.setText("Add New Intel(R) SGX Static Trusted Library Dialog");
+	}
+
+	@Override
+	protected
+	void okPressed(){
+		addHandler.edlFilename = fileNameField.getText();
+		if(!fileNameField.getText().isEmpty() 
+				){
+			if(Character.isDigit(fileNameField.getText().charAt(0)))
+			{
+				JOptionPane.showMessageDialog(null, "Enclave names starting with digits are not allowed.", "Error",
+						JOptionPane.ERROR_MESSAGE);
+			}
+			else
+				super.okPressed();
+		}
+	}
+
+	@Override
+	protected Point getInitialSize(){
+		return new Point(675,200);
+	}
+
+	public String getFileName() {
+		return fileNameField.getText();
+	}
+}

+ 72 - 72
Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/dialogs/TwoStepSignStep1Dialog1.java

@@ -1,72 +1,72 @@
-///////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2016 Intel Corporation.				 //
-// 									 //
-// All rights reserved. This program and the accompanying materials	 //
-// are made available under the terms of the Eclipse Public License v1.0 //
-// which accompanies this distribution, and is available at		 //
-// http://www.eclipse.org/legal/epl-v10.html				 //
-// 									 //
-// Contributors:							 //
-//     Intel Corporation - initial implementation and documentation	 //
-///////////////////////////////////////////////////////////////////////////
-
-
-package com.intel.sgx.dialogs;
-
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-
-import com.intel.sgx.handlers.TwoStepSignHandlerBase;
-
-public class TwoStepSignStep1Dialog1 extends TwoStepSignDialogBase {
-
-	final private TwoStepSignHandlerBase handler;
-
-	public TwoStepSignStep1Dialog1(Shell parentShell, TwoStepSignHandlerBase handler) {
-		super(parentShell);
-		this.handler = handler;
-	}
-
-	@Override
-	protected Control createDialogArea(Composite parent) {
-		Composite composite = (Composite) super.createDialogArea(parent);
-		final GridLayout gridLayout = new GridLayout(1, false);
-		composite.setLayout(gridLayout);
-
-		enclaveFileField = addGroup(composite, "Unsigned Enclave Path:",
-				"Select Enclave for which to generate the Hash.",
-				"Enclave Path:", "Select Enclave", enclaveFileSelectionListener);
-
-		hashFileField = addGroup(composite, "Generate Hash:",
-				"Select Location to Output Hash File.", "Hash File Location:",
-				"Select File Path", hashFileSelectionListener);
-
-		configFileField = addGroup(composite, "Configuration File:",
-				"Select Input Configuration XML File.  ",
-				"Configuration File:", "Select Config",
-				configFileSelectionListener);
-
-		composite.pack(true);
-		return composite;
-	}
-
-	@Override
-	protected void okPressed() {
-		handler.enclaveFile = enclaveFileField.getText();
-		handler.hashFile = hashFileField.getText();
-		handler.configFile = configFileField.getText();
-		
-		super.okPressed();
-	}
-
-	@Override
-	protected void configureShell(Shell newShell) {
-		super.configureShell(newShell);
-		newShell.setText("Two Step Enclave Sign - Generate Hash");
-	}
-	
-	
-
-}
+///////////////////////////////////////////////////////////////////////////
+// Copyright (c) 2016 Intel Corporation.				 //
+// 									 //
+// All rights reserved. This program and the accompanying materials	 //
+// are made available under the terms of the Eclipse Public License v1.0 //
+// which accompanies this distribution, and is available at		 //
+// http://www.eclipse.org/legal/epl-v10.html				 //
+// 									 //
+// Contributors:							 //
+//     Intel Corporation - initial implementation and documentation	 //
+///////////////////////////////////////////////////////////////////////////
+
+
+package com.intel.sgx.dialogs;
+
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Shell;
+
+import com.intel.sgx.handlers.TwoStepSignHandlerBase;
+
+public class TwoStepSignStep1Dialog1 extends TwoStepSignDialogBase {
+
+	final private TwoStepSignHandlerBase handler;
+
+	public TwoStepSignStep1Dialog1(Shell parentShell, TwoStepSignHandlerBase handler) {
+		super(parentShell);
+		this.handler = handler;
+	}
+
+	@Override
+	protected Control createDialogArea(Composite parent) {
+		Composite composite = (Composite) super.createDialogArea(parent);
+		final GridLayout gridLayout = new GridLayout(1, false);
+		composite.setLayout(gridLayout);
+
+		enclaveFileField = addGroup(composite, "Unsigned Enclave Path:",
+				"Select Enclave for which to generate the Hash.",
+				"Enclave Path:", "Select Enclave", enclaveFileSelectionListener);
+
+		hashFileField = addGroup(composite, "Generate Hash:",
+				"Select Location to Output Hash File.", "Hash File Location:",
+				"Select File Path", hashFileSelectionListener);
+
+		configFileField = addGroup(composite, "Configuration File:",
+				"Select Input Configuration XML File.  ",
+				"Configuration File:", "Select Config",
+				configFileSelectionListener);
+
+		composite.pack(true);
+		return composite;
+	}
+
+	@Override
+	protected void okPressed() {
+		handler.enclaveFile = enclaveFileField.getText();
+		handler.hashFile = hashFileField.getText();
+		handler.configFile = configFileField.getText();
+		
+		super.okPressed();
+	}
+
+	@Override
+	protected void configureShell(Shell newShell) {
+		super.configureShell(newShell);
+		newShell.setText("Two Step Enclave Sign - Generate Hash");
+	}
+	
+	
+
+}

+ 89 - 89
Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/dialogs/TwoStepSignStep1Dialog2.java

@@ -1,89 +1,89 @@
-///////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2016 Intel Corporation.				 //
-// 									 //
-// All rights reserved. This program and the accompanying materials	 //
-// are made available under the terms of the Eclipse Public License v1.0 //
-// which accompanies this distribution, and is available at		 //
-// http://www.eclipse.org/legal/epl-v10.html				 //
-// 									 //
-// Contributors:							 //
-//     Intel Corporation - initial implementation and documentation	 //
-///////////////////////////////////////////////////////////////////////////
-
-
-package com.intel.sgx.dialogs;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-
-public class TwoStepSignStep1Dialog2 extends TwoStepSignDialogBase {
-
-	final private String hashFile;
-
-	public TwoStepSignStep1Dialog2(Shell parentShell, String hashFile) {
-		super(parentShell);
-		this.hashFile = hashFile;
-	}
-
-	@Override
-	protected Control createDialogArea(Composite parent) {
-		Composite composite = (Composite) super.createDialogArea(parent);
-		final GridLayout gridLayout = new GridLayout(1,false);
-		composite.setLayout(gridLayout);
-		
-		addGroup1(composite);
-		addGroup3(composite);
-		
-		
-		return composite;
-	}
-
-	private void addGroup1(Composite composite) {
-		final Group container = new Group(composite, SWT.None);
-		container.setLayout(new GridLayout(3,false));
-		GridData innergrid1 = new GridData(GridData.FILL_HORIZONTAL);
-	innergrid1.horizontalSpan = 3;
-		container.setLayoutData(innergrid1);
-		container.setText("Hash File:");
-		
-		final Label messageLabel = new Label(container, SWT.NONE);
-		messageLabel.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false, 3, 1));
-		messageLabel.setText("Hash File Generated at Location:");
-		
-		final Label messageLabel1 = new Label(container, SWT.NONE);
-		messageLabel1.setText(hashFile);
-
-		messageLabel1.setLayoutData(new GridData(GridData.BEGINNING));
-	}
-
-	private void addGroup3(Composite composite) {
-		final Group container3 = new Group(composite, SWT.None);
-		container3.setLayout(new GridLayout(3,false));
-		GridData innergrid3 = new GridData(GridData.FILL_HORIZONTAL);
-		innergrid3.horizontalSpan = 3;
-		container3.setLayoutData(innergrid3);
-		container3.setText("Generate Signed Enclave (Step-2):");
-		
-		final Label messageLabel4 = new Label(container3, SWT.NONE);
-		messageLabel4.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false, 3, 1));
-		messageLabel4.setText("To Generate Signed Enclave Now: Click OK");
-		
-		final Label messageLabel5 = new Label(container3, SWT.NONE);
-		messageLabel5.setLayoutData(new GridData(GridData.CENTER, GridData.END, false, false, 3, 1));
-		messageLabel5.setText("To Generate Signed Enclave Later: Click Cancel");
-	}
-
-	@Override
-	protected void configureShell(Shell newShell) {
-		super.configureShell(newShell);
-		newShell.setText("Two Step Enclave Sign - Generate Hash");
-	}
-	
-	
-}
+///////////////////////////////////////////////////////////////////////////
+// Copyright (c) 2016 Intel Corporation.				 //
+// 									 //
+// All rights reserved. This program and the accompanying materials	 //
+// are made available under the terms of the Eclipse Public License v1.0 //
+// which accompanies this distribution, and is available at		 //
+// http://www.eclipse.org/legal/epl-v10.html				 //
+// 									 //
+// Contributors:							 //
+//     Intel Corporation - initial implementation and documentation	 //
+///////////////////////////////////////////////////////////////////////////
+
+
+package com.intel.sgx.dialogs;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+
+public class TwoStepSignStep1Dialog2 extends TwoStepSignDialogBase {
+
+	final private String hashFile;
+
+	public TwoStepSignStep1Dialog2(Shell parentShell, String hashFile) {
+		super(parentShell);
+		this.hashFile = hashFile;
+	}
+
+	@Override
+	protected Control createDialogArea(Composite parent) {
+		Composite composite = (Composite) super.createDialogArea(parent);
+		final GridLayout gridLayout = new GridLayout(1,false);
+		composite.setLayout(gridLayout);
+		
+		addGroup1(composite);
+		addGroup3(composite);
+		
+		
+		return composite;
+	}
+
+	private void addGroup1(Composite composite) {
+		final Group container = new Group(composite, SWT.None);
+		container.setLayout(new GridLayout(3,false));
+		GridData innergrid1 = new GridData(GridData.FILL_HORIZONTAL);
+	innergrid1.horizontalSpan = 3;
+		container.setLayoutData(innergrid1);
+		container.setText("Hash File:");
+		
+		final Label messageLabel = new Label(container, SWT.NONE);
+		messageLabel.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false, 3, 1));
+		messageLabel.setText("Hash File Generated at Location:");
+		
+		final Label messageLabel1 = new Label(container, SWT.NONE);
+		messageLabel1.setText(hashFile);
+
+		messageLabel1.setLayoutData(new GridData(GridData.BEGINNING));
+	}
+
+	private void addGroup3(Composite composite) {
+		final Group container3 = new Group(composite, SWT.None);
+		container3.setLayout(new GridLayout(3,false));
+		GridData innergrid3 = new GridData(GridData.FILL_HORIZONTAL);
+		innergrid3.horizontalSpan = 3;
+		container3.setLayoutData(innergrid3);
+		container3.setText("Generate Signed Enclave (Step-2):");
+		
+		final Label messageLabel4 = new Label(container3, SWT.NONE);
+		messageLabel4.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false, 3, 1));
+		messageLabel4.setText("To Generate Signed Enclave Now: Click OK");
+		
+		final Label messageLabel5 = new Label(container3, SWT.NONE);
+		messageLabel5.setLayoutData(new GridData(GridData.CENTER, GridData.END, false, false, 3, 1));
+		messageLabel5.setText("To Generate Signed Enclave Later: Click Cancel");
+	}
+
+	@Override
+	protected void configureShell(Shell newShell) {
+		super.configureShell(newShell);
+		newShell.setText("Two Step Enclave Sign - Generate Hash");
+	}
+	
+	
+}

+ 105 - 105
Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/dialogs/TwoStepSignStep1Dialog3.java

@@ -1,105 +1,105 @@
-///////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2016 Intel Corporation.				 //
-// 									 //
-// All rights reserved. This program and the accompanying materials	 //
-// are made available under the terms of the Eclipse Public License v1.0 //
-// which accompanies this distribution, and is available at		 //
-// http://www.eclipse.org/legal/epl-v10.html				 //
-// 									 //
-// Contributors:							 //
-//     Intel Corporation - initial implementation and documentation	 //
-///////////////////////////////////////////////////////////////////////////
-
-
-package com.intel.sgx.dialogs;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-
-import com.intel.sgx.handlers.TwoStepSignHandlerBase;
-
-public class TwoStepSignStep1Dialog3 extends TwoStepSignDialogBase {
-	
-	final private TwoStepSignHandlerBase handler;
-
-	public TwoStepSignStep1Dialog3(Shell parentShell, TwoStepSignHandlerBase handler) {
-		super(parentShell);
-		this.handler = handler;
-	}
-
-	protected Control createDialogArea(Composite parent) {
-		Composite composite = (Composite) super.createDialogArea(parent);
-		final GridLayout gridLayout = new GridLayout(1, false);
-		composite.setLayout(gridLayout);
-
-		addInfoGroup(composite);
-
-		externalSignPublicKeyFileField = addGroup(composite, "Public Key:",
-				"Select the Public Key file obtained from signing facility",
-				"Public Key:", "Select", publicKeyLocationSelectionListener);
-
-		externalSignedHashFileField = addGroup(composite, "Signature:",
-				"Select the Signature file obtained from signing facility.", 
-				"Signature:",
-				"Select", externalSignedHashFileSelectionListener);
-
-		
-		outputSignedEnclaveFileField = addGroup(composite, "Signed Enclave:",
-				"Select where to save the output Signed Enclave.", 
-				"Signed Enclave:",
-				"Select", outputSignedEnclaveListener);
-
-		return composite;
-	}
-	
-	protected void addInfoGroup(Composite composite) {
-		final Group container = new Group(composite, SWT.None);
-		container.setLayout(new GridLayout(3,false));
-		GridData innergrid1 = new GridData(GridData.FILL_HORIZONTAL);
-		innergrid1.horizontalSpan = 3;
-		container.setLayoutData(innergrid1);
-		container.setText("Hash and Enclave:");
-
-		
-		addInfoKeyValue(container, "Enclave File:", handler.enclaveFile);
-		addInfoKeyValue(container, "Config File:", handler.configFile);
-		addInfoKeyValue(container, "Hash File:", handler.hashFile);
-	}
-
-	private void addInfoKeyValue(final Group container, String key,
-			String value) {
-		final Label messageLabel2 = new Label(container, SWT.NONE);
-		messageLabel2.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false, 3, 1));
-		messageLabel2.setText(key);
-		
-		final Label messageLabel3 = new Label(container, SWT.NONE);
-		messageLabel3.setText(value);
-		messageLabel3.setLayoutData(new GridData(GridData.BEGINNING));
-	}
-
-	@Override
-	protected void okPressed() {
-		handler.externalSignPublicKeyFile = externalSignPublicKeyFileField.getText();
-		handler.externallySignedHashFile = externalSignedHashFileField.getText(); 
-		handler.outputSignedEnclaveFile = outputSignedEnclaveFileField.getText();
-		super.okPressed();
-	}
-	
-	
-	
-	@Override
-	protected void configureShell(Shell newShell) {
-		super.configureShell(newShell);
-		newShell.setText("Two Step Enclave Sign - Generate Signed Enclave");
-	}
-	
-
-
-
-}
+///////////////////////////////////////////////////////////////////////////
+// Copyright (c) 2016 Intel Corporation.				 //
+// 									 //
+// All rights reserved. This program and the accompanying materials	 //
+// are made available under the terms of the Eclipse Public License v1.0 //
+// which accompanies this distribution, and is available at		 //
+// http://www.eclipse.org/legal/epl-v10.html				 //
+// 									 //
+// Contributors:							 //
+//     Intel Corporation - initial implementation and documentation	 //
+///////////////////////////////////////////////////////////////////////////
+
+
+package com.intel.sgx.dialogs;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+
+import com.intel.sgx.handlers.TwoStepSignHandlerBase;
+
+public class TwoStepSignStep1Dialog3 extends TwoStepSignDialogBase {
+	
+	final private TwoStepSignHandlerBase handler;
+
+	public TwoStepSignStep1Dialog3(Shell parentShell, TwoStepSignHandlerBase handler) {
+		super(parentShell);
+		this.handler = handler;
+	}
+
+	protected Control createDialogArea(Composite parent) {
+		Composite composite = (Composite) super.createDialogArea(parent);
+		final GridLayout gridLayout = new GridLayout(1, false);
+		composite.setLayout(gridLayout);
+
+		addInfoGroup(composite);
+
+		externalSignPublicKeyFileField = addGroup(composite, "Public Key:",
+				"Select the Public Key file obtained from signing facility",
+				"Public Key:", "Select", publicKeyLocationSelectionListener);
+
+		externalSignedHashFileField = addGroup(composite, "Signature:",
+				"Select the Signature file obtained from signing facility.", 
+				"Signature:",
+				"Select", externalSignedHashFileSelectionListener);
+
+		
+		outputSignedEnclaveFileField = addGroup(composite, "Signed Enclave:",
+				"Select where to save the output Signed Enclave.", 
+				"Signed Enclave:",
+				"Select", outputSignedEnclaveListener);
+
+		return composite;
+	}
+	
+	protected void addInfoGroup(Composite composite) {
+		final Group container = new Group(composite, SWT.None);
+		container.setLayout(new GridLayout(3,false));
+		GridData innergrid1 = new GridData(GridData.FILL_HORIZONTAL);
+		innergrid1.horizontalSpan = 3;
+		container.setLayoutData(innergrid1);
+		container.setText("Hash and Enclave:");
+
+		
+		addInfoKeyValue(container, "Enclave File:", handler.enclaveFile);
+		addInfoKeyValue(container, "Config File:", handler.configFile);
+		addInfoKeyValue(container, "Hash File:", handler.hashFile);
+	}
+
+	private void addInfoKeyValue(final Group container, String key,
+			String value) {
+		final Label messageLabel2 = new Label(container, SWT.NONE);
+		messageLabel2.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false, 3, 1));
+		messageLabel2.setText(key);
+		
+		final Label messageLabel3 = new Label(container, SWT.NONE);
+		messageLabel3.setText(value);
+		messageLabel3.setLayoutData(new GridData(GridData.BEGINNING));
+	}
+
+	@Override
+	protected void okPressed() {
+		handler.externalSignPublicKeyFile = externalSignPublicKeyFileField.getText();
+		handler.externallySignedHashFile = externalSignedHashFileField.getText(); 
+		handler.outputSignedEnclaveFile = outputSignedEnclaveFileField.getText();
+		super.okPressed();
+	}
+	
+	
+	
+	@Override
+	protected void configureShell(Shell newShell) {
+		super.configureShell(newShell);
+		newShell.setText("Two Step Enclave Sign - Generate Signed Enclave");
+	}
+	
+
+
+
+}

+ 92 - 92
Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/dialogs/TwoStepSignStep2Dialog.java

@@ -1,92 +1,92 @@
-///////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2016 Intel Corporation.				 //
-// 									 //
-// All rights reserved. This program and the accompanying materials	 //
-// are made available under the terms of the Eclipse Public License v1.0 //
-// which accompanies this distribution, and is available at		 //
-// http://www.eclipse.org/legal/epl-v10.html				 //
-// 									 //
-// Contributors:							 //
-//     Intel Corporation - initial implementation and documentation	 //
-///////////////////////////////////////////////////////////////////////////
-
-
-package com.intel.sgx.dialogs;
-
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-
-import com.intel.sgx.handlers.TwoStepSignHandlerBase;
-import com.intel.sgx.handlers.TwoStepSignStep2;
-
-public class TwoStepSignStep2Dialog extends TwoStepSignDialogBase{
-
-	final private TwoStepSignHandlerBase handler;
-
-
-	public TwoStepSignStep2Dialog(Shell parentShell, TwoStepSignHandlerBase handler) {
-		super(parentShell);
-		this.handler = handler;
-	}
-
-	
-	@Override
-	protected Control createDialogArea(Composite parent) {
-		Composite composite = (Composite) super.createDialogArea(parent);
-		final GridLayout gridLayout = new GridLayout(1,false);
-		composite.setLayout(gridLayout);
-		
-		
-		
-		enclaveFileField= addGroup(composite, "Enclave:",
-				"Select the unsigned enclave file",
-				"Unsigned Enclave File:", "Select", enclaveFileSelectionListener);
-		
-		configFileField = addGroup(composite, "Configuration File:",
-				"Select Input Configuration XML File.  ",
-				"Configuration File:", "Select Config",
-				configFileSelectionListener);
-
-		hashFileField= addGroup(composite, "Hash:",
-				"Select the Hash file obtained from previous step",
-				"Hash File:", "Select", hashFileSelectionListener);
-
-		externalSignPublicKeyFileField= addGroup(composite, "Public Key:",
-				"Select the Public Key file obtained from external signing facility",
-				"Public Key:", "Select", publicKeyLocationSelectionListener);
-		
-		externalSignedHashFileField = addGroup(composite, "Signature:",
-				"Select the Signature file obtained from signing facility.", 
-				"Signature:",
-				"Select", externalSignedHashFileSelectionListener);
-
-		outputSignedEnclaveFileField = addGroup(composite, "Signed Enclave:",
-				"Select where to save the output Signed Enclave.", 
-				"Signed Enclave:",
-				"Select", outputSignedEnclaveListener);
-
-		return composite;
-	}
-
-
-	@Override
-	protected void okPressed() {
-		handler.enclaveFile = enclaveFileField.getText();
-		handler.hashFile = hashFileField.getText();
-		handler.configFile = configFileField.getText();
-		handler.externalSignPublicKeyFile = externalSignPublicKeyFileField.getText();
-		handler.externallySignedHashFile = externalSignedHashFileField.getText(); 
-		handler.outputSignedEnclaveFile = outputSignedEnclaveFileField.getText();
-
-		super.okPressed();
-	}
-
-	@Override
-	protected void configureShell(Shell newShell) {
-		super.configureShell(newShell);
-		newShell.setText("Two Step Enclave Sign - Generate Signed Enclave");
-	}
-	
-}
+///////////////////////////////////////////////////////////////////////////
+// Copyright (c) 2016 Intel Corporation.				 //
+// 									 //
+// All rights reserved. This program and the accompanying materials	 //
+// are made available under the terms of the Eclipse Public License v1.0 //
+// which accompanies this distribution, and is available at		 //
+// http://www.eclipse.org/legal/epl-v10.html				 //
+// 									 //
+// Contributors:							 //
+//     Intel Corporation - initial implementation and documentation	 //
+///////////////////////////////////////////////////////////////////////////
+
+
+package com.intel.sgx.dialogs;
+
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Shell;
+
+import com.intel.sgx.handlers.TwoStepSignHandlerBase;
+import com.intel.sgx.handlers.TwoStepSignStep2;
+
+public class TwoStepSignStep2Dialog extends TwoStepSignDialogBase{
+
+	final private TwoStepSignHandlerBase handler;
+
+
+	public TwoStepSignStep2Dialog(Shell parentShell, TwoStepSignHandlerBase handler) {
+		super(parentShell);
+		this.handler = handler;
+	}
+
+	
+	@Override
+	protected Control createDialogArea(Composite parent) {
+		Composite composite = (Composite) super.createDialogArea(parent);
+		final GridLayout gridLayout = new GridLayout(1,false);
+		composite.setLayout(gridLayout);
+		
+		
+		
+		enclaveFileField= addGroup(composite, "Enclave:",
+				"Select the unsigned enclave file",
+				"Unsigned Enclave File:", "Select", enclaveFileSelectionListener);
+		
+		configFileField = addGroup(composite, "Configuration File:",
+				"Select Input Configuration XML File.  ",
+				"Configuration File:", "Select Config",
+				configFileSelectionListener);
+
+		hashFileField= addGroup(composite, "Hash:",
+				"Select the Hash file obtained from previous step",
+				"Hash File:", "Select", hashFileSelectionListener);
+
+		externalSignPublicKeyFileField= addGroup(composite, "Public Key:",
+				"Select the Public Key file obtained from external signing facility",
+				"Public Key:", "Select", publicKeyLocationSelectionListener);
+		
+		externalSignedHashFileField = addGroup(composite, "Signature:",
+				"Select the Signature file obtained from signing facility.", 
+				"Signature:",
+				"Select", externalSignedHashFileSelectionListener);
+
+		outputSignedEnclaveFileField = addGroup(composite, "Signed Enclave:",
+				"Select where to save the output Signed Enclave.", 
+				"Signed Enclave:",
+				"Select", outputSignedEnclaveListener);
+
+		return composite;
+	}
+
+
+	@Override
+	protected void okPressed() {
+		handler.enclaveFile = enclaveFileField.getText();
+		handler.hashFile = hashFileField.getText();
+		handler.configFile = configFileField.getText();
+		handler.externalSignPublicKeyFile = externalSignPublicKeyFileField.getText();
+		handler.externallySignedHashFile = externalSignedHashFileField.getText(); 
+		handler.outputSignedEnclaveFile = outputSignedEnclaveFileField.getText();
+
+		super.okPressed();
+	}
+
+	@Override
+	protected void configureShell(Shell newShell) {
+		super.configureShell(newShell);
+		newShell.setText("Two Step Enclave Sign - Generate Signed Enclave");
+	}
+	
+}

+ 202 - 202
Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/discovery/SGXSDKDiscoveredPathInfo.java

@@ -1,202 +1,202 @@
-///////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2016 Intel Corporation.				 //
-// 									 //
-// All rights reserved. This program and the accompanying materials	 //
-// are made available under the terms of the Eclipse Public License v1.0 //
-// which accompanies this distribution, and is available at		 //
-// http://www.eclipse.org/legal/epl-v10.html				 //
-// 									 //
-// Contributors:							 //
-//     Intel Corporation - initial implementation and documentation	 //
-///////////////////////////////////////////////////////////////////////////
-
-
-package com.intel.sgx.discovery;
-
-import java.util.List;
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileReader;
-import java.io.IOException;
-import java.io.PrintStream;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.eclipse.cdt.core.CCorePlugin;
-import org.eclipse.cdt.core.model.CoreModel;
-import org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IDiscoveredPathInfo;
-import org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IDiscoveredScannerInfoSerializable;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
-
-import com.intel.sgx.Activator;
-/*
- * This code has been taken from the NDK plugin for Linux. If there is an update to this code there, then refactor this code.
- */
-public class SGXSDKDiscoveredPathInfo implements IDiscoveredPathInfo {
-
-	private final IProject mProject;
-    private long mLastUpdate = IFile.NULL_STAMP;
-    private IPath[] mIncludePaths;
-    private Map<String, String> mSymbols;
-    private boolean mNeedReindexing = false;
-    private static final IPath LINUX_MK = new Path("sgx/Makefile");
-    
-    //Keys for preferences
-    // public static final String LAST_UPDATE = "lastUpdate"; //$NON-NLS-1$
-
-    
-    public SGXSDKDiscoveredPathInfo(IProject project) {
-        this.mProject = project;
-        load();
-    }
-
-	@Override
-	public IProject getProject() {
-		return mProject;
-	}
-
-	@Override
-	public IPath[] getIncludePaths() {
-		if (mNeedReindexing) {
-            CCorePlugin.getIndexManager().reindex(CoreModel.getDefault().create(mProject));
-            mNeedReindexing = false;
-        }
-		return mIncludePaths;
-	}
-
-    void setIncludePaths(List<String> pathStrings) {
-        mIncludePaths = new IPath[pathStrings.size()];
-        int i = 0;
-        for (String path : pathStrings)
-            mIncludePaths[i++] = new Path(path);
-        mNeedReindexing = true;
-    }
-
-	@Override
-	public Map<String, String> getSymbols() {
-		if (mSymbols == null)
-            mSymbols = new HashMap<String, String>();
-        return mSymbols;
-    }
-
-    void setSymbols(Map<String, String> symbols) {
-        this.mSymbols = symbols;
-    }
-
-	@Override
-	public IDiscoveredScannerInfoSerializable getSerializable() {
-		return null;
-	}
-
-	public void update(IProgressMonitor monitor) throws CoreException {
-        if (!needUpdating())
-            return;
-
-        new SGXSDKDiscoveryUpdater(this).runUpdate(monitor);
-
-        if (mIncludePaths != null && mSymbols != null) {
-            recordUpdate();
-            save();
-        }
-    }
-
-    private boolean needUpdating() {
-
-    	
-        if (mLastUpdate == IFile.NULL_STAMP) {
-        	    return true;
-        }
-
-        return mProject.getFile(LINUX_MK).getLocalTimeStamp() > mLastUpdate;
-    }
-
-    private void recordUpdate() {
-        mLastUpdate = mProject.getFile(LINUX_MK).getLocalTimeStamp();
-    }
-
-    public void delete() {
-        mLastUpdate = IFile.NULL_STAMP;
-    }
-
-    private File getInfoFile() {
-        File stateLoc = Activator.getDefault().getStateLocation().toFile();
-        return new File(stateLoc, mProject.getName() + ".pathInfo"); //$NON-NLS-1$
-    }
-    
-    private void save() {
-        try {
-            File infoFile = getInfoFile();
-            infoFile.getParentFile().mkdirs();
-            PrintStream out = new PrintStream(infoFile);
-
-            out.print("t,"); //$NON-NLS-1$
-            out.print(mLastUpdate);
-            out.println();
-
-            for (IPath include : mIncludePaths) {
-                out.print("i,"); //$NON-NLS-1$
-                out.print(include.toPortableString());
-                out.println();
-            }
-
-            for (Entry<String, String> symbol : mSymbols.entrySet()) {
-                out.print("d,"); //$NON-NLS-1$
-                out.print(symbol.getKey());
-                out.print(","); //$NON-NLS-1$
-                out.print(symbol.getValue());
-                out.println();
-            }
-
-            out.close();
-        } catch (IOException e) {
-            Activator.log(e);
-        }
-
-    }
-    
-	private void load() {
-        try {
-            File infoFile = getInfoFile();
-            if (!infoFile.exists())
-                return;
-
-            long timestamp = IFile.NULL_STAMP;
-            List<IPath> includes = new ArrayList<IPath>();
-            Map<String, String> defines = new HashMap<String, String>();
-
-            BufferedReader reader = new BufferedReader(new FileReader(infoFile));
-            for (String line = reader.readLine(); line != null; line = reader.readLine()) {
-                switch (line.charAt(0)) {
-                    case 't':
-                        timestamp = Long.valueOf(line.substring(2));
-                        break;
-                    case 'i':
-                        includes.add(Path.fromPortableString(line.substring(2)));
-                        break;
-                    case 'd':
-                        int n = line.indexOf(',', 2);
-                        if (n == -1)
-                            defines.put(line.substring(2), ""); //$NON-NLS-1$
-                        else
-                            defines.put(line.substring(2, n), line.substring(n + 1));
-                        break;
-                }
-            }
-            reader.close();
-
-            mLastUpdate = timestamp;
-            mIncludePaths = includes.toArray(new IPath[includes.size()]);
-            mSymbols = defines;
-        } catch (IOException e) {
-            Activator.log(e);
-        }
-    }
-
-}
+///////////////////////////////////////////////////////////////////////////
+// Copyright (c) 2016 Intel Corporation.				 //
+// 									 //
+// All rights reserved. This program and the accompanying materials	 //
+// are made available under the terms of the Eclipse Public License v1.0 //
+// which accompanies this distribution, and is available at		 //
+// http://www.eclipse.org/legal/epl-v10.html				 //
+// 									 //
+// Contributors:							 //
+//     Intel Corporation - initial implementation and documentation	 //
+///////////////////////////////////////////////////////////////////////////
+
+
+package com.intel.sgx.discovery;
+
+import java.util.List;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.eclipse.cdt.core.CCorePlugin;
+import org.eclipse.cdt.core.model.CoreModel;
+import org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IDiscoveredPathInfo;
+import org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IDiscoveredScannerInfoSerializable;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Path;
+
+import com.intel.sgx.Activator;
+/*
+ * This code has been taken from the NDK plugin for Linux. If there is an update to this code there, then refactor this code.
+ */
+public class SGXSDKDiscoveredPathInfo implements IDiscoveredPathInfo {
+
+	private final IProject mProject;
+    private long mLastUpdate = IFile.NULL_STAMP;
+    private IPath[] mIncludePaths;
+    private Map<String, String> mSymbols;
+    private boolean mNeedReindexing = false;
+    private static final IPath LINUX_MK = new Path("sgx/Makefile");
+    
+    //Keys for preferences
+    // public static final String LAST_UPDATE = "lastUpdate"; //$NON-NLS-1$
+
+    
+    public SGXSDKDiscoveredPathInfo(IProject project) {
+        this.mProject = project;
+        load();
+    }
+
+	@Override
+	public IProject getProject() {
+		return mProject;
+	}
+
+	@Override
+	public IPath[] getIncludePaths() {
+		if (mNeedReindexing) {
+            CCorePlugin.getIndexManager().reindex(CoreModel.getDefault().create(mProject));
+            mNeedReindexing = false;
+        }
+		return mIncludePaths;
+	}
+
+    void setIncludePaths(List<String> pathStrings) {
+        mIncludePaths = new IPath[pathStrings.size()];
+        int i = 0;
+        for (String path : pathStrings)
+            mIncludePaths[i++] = new Path(path);
+        mNeedReindexing = true;
+    }
+
+	@Override
+	public Map<String, String> getSymbols() {
+		if (mSymbols == null)
+            mSymbols = new HashMap<String, String>();
+        return mSymbols;
+    }
+
+    void setSymbols(Map<String, String> symbols) {
+        this.mSymbols = symbols;
+    }
+
+	@Override
+	public IDiscoveredScannerInfoSerializable getSerializable() {
+		return null;
+	}
+
+	public void update(IProgressMonitor monitor) throws CoreException {
+        if (!needUpdating())
+            return;
+
+        new SGXSDKDiscoveryUpdater(this).runUpdate(monitor);
+
+        if (mIncludePaths != null && mSymbols != null) {
+            recordUpdate();
+            save();
+        }
+    }
+
+    private boolean needUpdating() {
+
+    	
+        if (mLastUpdate == IFile.NULL_STAMP) {
+        	    return true;
+        }
+
+        return mProject.getFile(LINUX_MK).getLocalTimeStamp() > mLastUpdate;
+    }
+
+    private void recordUpdate() {
+        mLastUpdate = mProject.getFile(LINUX_MK).getLocalTimeStamp();
+    }
+
+    public void delete() {
+        mLastUpdate = IFile.NULL_STAMP;
+    }
+
+    private File getInfoFile() {
+        File stateLoc = Activator.getDefault().getStateLocation().toFile();
+        return new File(stateLoc, mProject.getName() + ".pathInfo"); //$NON-NLS-1$
+    }
+    
+    private void save() {
+        try {
+            File infoFile = getInfoFile();
+            infoFile.getParentFile().mkdirs();
+            PrintStream out = new PrintStream(infoFile);
+
+            out.print("t,"); //$NON-NLS-1$
+            out.print(mLastUpdate);
+            out.println();
+
+            for (IPath include : mIncludePaths) {
+                out.print("i,"); //$NON-NLS-1$
+                out.print(include.toPortableString());
+                out.println();
+            }
+
+            for (Entry<String, String> symbol : mSymbols.entrySet()) {
+                out.print("d,"); //$NON-NLS-1$
+                out.print(symbol.getKey());
+                out.print(","); //$NON-NLS-1$
+                out.print(symbol.getValue());
+                out.println();
+            }
+
+            out.close();
+        } catch (IOException e) {
+            Activator.log(e);
+        }
+
+    }
+    
+	private void load() {
+        try {
+            File infoFile = getInfoFile();
+            if (!infoFile.exists())
+                return;
+
+            long timestamp = IFile.NULL_STAMP;
+            List<IPath> includes = new ArrayList<IPath>();
+            Map<String, String> defines = new HashMap<String, String>();
+
+            BufferedReader reader = new BufferedReader(new FileReader(infoFile));
+            for (String line = reader.readLine(); line != null; line = reader.readLine()) {
+                switch (line.charAt(0)) {
+                    case 't':
+                        timestamp = Long.valueOf(line.substring(2));
+                        break;
+                    case 'i':
+                        includes.add(Path.fromPortableString(line.substring(2)));
+                        break;
+                    case 'd':
+                        int n = line.indexOf(',', 2);
+                        if (n == -1)
+                            defines.put(line.substring(2), ""); //$NON-NLS-1$
+                        else
+                            defines.put(line.substring(2, n), line.substring(n + 1));
+                        break;
+                }
+            }
+            reader.close();
+
+            mLastUpdate = timestamp;
+            mIncludePaths = includes.toArray(new IPath[includes.size()]);
+            mSymbols = defines;
+        } catch (IOException e) {
+            Activator.log(e);
+        }
+    }
+
+}

+ 310 - 310
Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/discovery/SGXSDKDiscoveryUpdater.java

@@ -1,310 +1,310 @@
-///////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2016 Intel Corporation.				 //
-// 									 //
-// All rights reserved. This program and the accompanying materials	 //
-// are made available under the terms of the Eclipse Public License v1.0 //
-// which accompanies this distribution, and is available at		 //
-// http://www.eclipse.org/legal/epl-v10.html				 //
-// 									 //
-// Contributors:							 //
-//     Intel Corporation - initial implementation and documentation	 //
-///////////////////////////////////////////////////////////////////////////
-
-
-package com.intel.sgx.discovery;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.eclipse.cdt.core.CCorePlugin;
-import org.eclipse.cdt.core.envvar.IEnvironmentVariable;
-import org.eclipse.cdt.core.envvar.IEnvironmentVariableManager;
-import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
-import org.eclipse.cdt.managedbuilder.core.IBuilder;
-import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
-import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
-
-import com.intel.sgx.Activator;
-import com.intel.sgx.build.SGXSDKCommandLauncher;
-
-/*
- * This code has been taken from the NDK plugin for Linux. If there is an update to this code there, then refactor this code.
- */
-public class SGXSDKDiscoveryUpdater {
-	private final SGXSDKDiscoveredPathInfo mPathInfo;
-    private final IProject mProject;
-
-    private boolean mCPlusPlus = false;
-    private String mCommand;
-    private List<String> mArguments = new ArrayList<String>();
-
-    public SGXSDKDiscoveryUpdater(SGXSDKDiscoveredPathInfo pathInfo) {
-        mPathInfo = pathInfo;
-        mProject = pathInfo.getProject();
-    }
-    
-    public void runUpdate(IProgressMonitor monitor) throws CoreException {
-        try {
-            // Run make -nB to get the list of commands
-            IPath commandPath = new Path("make"); //$NON-NLS-1$
-            String[] args = {"-f", "sgx/Makefile", "-n", "-B" }; //$NON-NLS-1$
-            String[] env = calcEnvironment();
-            File projectDir = new File(mProject.getLocationURI());
-            IPath changeToDirectory = new Path(projectDir.getAbsolutePath());
-            Process proc = new SGXSDKCommandLauncher().execute(commandPath, args, env,changeToDirectory, monitor);
-            if (proc == null) {
-                return;
-            }
-            
-            BufferedReader reader = new BufferedReader(new InputStreamReader(proc.getInputStream()));
-            String line = reader.readLine();
-            while (line != null) {
-                checkBuildLine(line);
-                line = reader.readLine();
-            }
-
-            if (mCommand == null) {
-                return;
-            }
-
-            // Run the unique commands with special gcc options to extract the
-            // symbols and paths
-            // -E -P -v -dD
-            mArguments.add("-E"); //$NON-NLS-1$
-            mArguments.add("-P"); //$NON-NLS-1$
-            mArguments.add("-v"); //$NON-NLS-1$
-            mArguments.add("-dD"); //$NON-NLS-1$
-
-            URL url = Activator.findFile(new Path("discovery/" + (mCPlusPlus ? "test.cpp" : "test.c"))); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-            File testFile = new File(FileLocator.toFileURL(url).toURI());
-            String testFileName = testFile.getAbsolutePath().replace('\\', '/');
-            mArguments.add(testFileName);
-
-            args = mArguments.toArray(new String[mArguments.size()]);
-            proc = new SGXSDKCommandLauncher().execute(new Path(mCommand), args, env,changeToDirectory, monitor);
- 
-            final InputStream errStream = proc.getErrorStream();
-            new Thread() {
-                @Override
-                public void run() {
-                    checkIncludes(errStream);
-                };
-            }.start();
-
-            checkDefines(proc.getInputStream());
-        } catch (IOException e) {
-            throw new CoreException(Activator.newStatus(e));
-        } catch (URISyntaxException e) {
-            throw new CoreException(Activator.newStatus(e));
-        }
-    }
-
-    private String[] calcEnvironment() throws CoreException {
-        IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(mProject);
-        IBuilder builder = info.getDefaultConfiguration().getBuilder();
-        HashMap<String, String> envMap = new HashMap<String, String>();
-        if (builder.appendEnvironment()) {
-            ICConfigurationDescription cfgDes = ManagedBuildManager.getDescriptionForConfiguration(builder.getParent().getParent());
-            IEnvironmentVariableManager mngr = CCorePlugin.getDefault().getBuildEnvironmentManager();
-            IEnvironmentVariable[] vars = mngr.getVariables(cfgDes, true);
-            for (IEnvironmentVariable var : vars) {
-                envMap.put(var.getName(), var.getValue());
-            }
-        }
-        // Add variables from build info
-        Map<String, String> builderEnv = builder.getExpandedEnvironment();
-        if (builderEnv != null)
-            envMap.putAll(builderEnv);
-        List<String> strings = new ArrayList<String>(envMap.size());
-        for (Entry<String, String> entry : envMap.entrySet()) {
-            StringBuffer buffer = new StringBuffer(entry.getKey());
-            buffer.append('=').append(entry.getValue());
-            strings.add(buffer.toString());
-        }
-        return strings.toArray(new String[strings.size()]);
-    }
-
-    private static class Line {
-        private final String line;
-        private int pos;
-
-        public Line(String line) {
-            this.line = line;
-        }
-
-        public Line(String line, int pos) {
-            this(line);
-            this.pos = pos;
-        }
-
-        public String getToken() {
-            skipWhiteSpace();
-            if (pos == line.length())
-                return null;
-
-            int start = pos;
-            boolean inQuote = false;
-
-            while (true) {
-                char c = line.charAt(pos);
-                if (c == ' ') {
-                    if (!inQuote)
-                        return line.substring(start, pos);
-                } else if (c == '"') {
-                    inQuote = !inQuote;
-                }
-
-                if (++pos == line.length())
-                    return null;
-            }
-
-        }
-
-        private String getRemaining() {
-            if (pos == line.length())
-                return null;
-
-            skipWhiteSpace();
-            String rc = line.substring(pos);
-            pos = line.length();
-            return rc;
-        }
-
-        private void skipWhiteSpace() {
-            while (true) {
-                if (pos == line.length())
-                    return;
-                char c = line.charAt(pos);
-                if (c == ' ')
-                    pos++;
-                else
-                    return;
-            }
-        }
-    }
-
-    private void checkBuildLine(String text) {
-        Line line = new Line(text);
-        String cmd = line.getToken();
-        if (cmd == null) {
-                return;
-        } else if (cmd.endsWith("g++")) {           //$NON-NLS-1$
-            if (mCommand == null || !mCPlusPlus) {
-                mCommand = cmd;
-                mCPlusPlus = true;
-            }
-            gatherOptions(line);
-        } else if (cmd.endsWith("gcc")) {   //$NON-NLS-1$
-            if (mCommand == null){
-                mCommand = cmd;
-            }
-            gatherOptions(line);
-        }
-        
-    }
-    
-    private void gatherOptions(Line line) {
-        for (String option = line.getToken(); option != null; option = line.getToken()) {
-            if (option.startsWith("-")) { //$NON-NLS-1$
-                // only look at options
-                if (option.equals("-I")) { //$NON-NLS-1$
-                    String dir = line.getToken();
-                    if (dir != null)
-                        addArg(option + dir);
-                } else if (option.startsWith("-I")) { //$NON-NLS-1$
-                    addArg(option);
-                } else if (option.equals("-D")) { //$NON-NLS-1$
-                    String def = line.getToken();
-                    if (def != null)
-                        addArg(option + def);
-                } else if (option.startsWith("-D")) { //$NON-NLS-1$
-                    addArg(option);
-                } else if (option.startsWith("-f")) { //$NON-NLS-1$
-                    addArg(option);
-                } else if (option.startsWith("-m")) { //$NON-NLS-1$
-                    addArg(option);
-                } else if (option.startsWith("--sysroot")) { //$NON-NLS-1$
-                    addArg(option);
-                }
-            }
-        }
-    }
-    
-    private void addArg(String arg) {
-        if (!mArguments.contains(arg))
-            mArguments.add(arg);
-    }
-
-    private void checkIncludes(InputStream in) {
-        try {
-            List<String> includes = new ArrayList<String>();
-            boolean inIncludes1 = false;
-            boolean inIncludes2 = false;
-            BufferedReader reader = new BufferedReader(new InputStreamReader(in));
-            String line = reader.readLine();
-            while (line != null) {
-                if (!inIncludes1) {
-                    if (line.equals("#include \"...\" search starts here:")) //$NON-NLS-1$
-                        inIncludes1 = true;
-                } else {
-                    if (!inIncludes2) {
-                        if (line.equals("#include <...> search starts here:")) //$NON-NLS-1$
-                            inIncludes2 = true;
-                        else
-                            includes.add(line.trim());
-                    } else {
-                        if (line.equals("End of search list.")) { //$NON-NLS-1$
-                            mPathInfo.setIncludePaths(includes);
-                        } else {
-                            includes.add(line.trim());
-                        }
-                    }
-                }
-                line = reader.readLine();
-            }
-        } catch (IOException e) {
-            Activator.log(e);
-        }
-    }
-
-    private void checkDefines(InputStream in) {
-        try {
-            Map<String, String> defines = new HashMap<String, String>();
-            BufferedReader reader = new BufferedReader(new InputStreamReader(in));
-            String line = reader.readLine();
-            while (line != null) {
-                if (line.startsWith("#define")) { //$NON-NLS-1$
-                    Line l = new Line(line, 7);
-                    String var = l.getToken();
-                    if (var == null)
-                        continue;
-                    String value = l.getRemaining();
-                    if (value == null)
-                        value = ""; //$NON-NLS-1$
-                    defines.put(var, value);
-                }
-                line = reader.readLine();
-            }
-            mPathInfo.setSymbols(defines);
-        } catch (IOException e) {
-            Activator.log(e);
-        }
-    }
-
-}
+///////////////////////////////////////////////////////////////////////////
+// Copyright (c) 2016 Intel Corporation.				 //
+// 									 //
+// All rights reserved. This program and the accompanying materials	 //
+// are made available under the terms of the Eclipse Public License v1.0 //
+// which accompanies this distribution, and is available at		 //
+// http://www.eclipse.org/legal/epl-v10.html				 //
+// 									 //
+// Contributors:							 //
+//     Intel Corporation - initial implementation and documentation	 //
+///////////////////////////////////////////////////////////////////////////
+
+
+package com.intel.sgx.discovery;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.eclipse.cdt.core.CCorePlugin;
+import org.eclipse.cdt.core.envvar.IEnvironmentVariable;
+import org.eclipse.cdt.core.envvar.IEnvironmentVariableManager;
+import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
+import org.eclipse.cdt.managedbuilder.core.IBuilder;
+import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
+import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Path;
+
+import com.intel.sgx.Activator;
+import com.intel.sgx.build.SGXSDKCommandLauncher;
+
+/*
+ * This code has been taken from the NDK plugin for Linux. If there is an update to this code there, then refactor this code.
+ */
+public class SGXSDKDiscoveryUpdater {
+	private final SGXSDKDiscoveredPathInfo mPathInfo;
+    private final IProject mProject;
+
+    private boolean mCPlusPlus = false;
+    private String mCommand;
+    private List<String> mArguments = new ArrayList<String>();
+
+    public SGXSDKDiscoveryUpdater(SGXSDKDiscoveredPathInfo pathInfo) {
+        mPathInfo = pathInfo;
+        mProject = pathInfo.getProject();
+    }
+    
+    public void runUpdate(IProgressMonitor monitor) throws CoreException {
+        try {
+            // Run make -nB to get the list of commands
+            IPath commandPath = new Path("make"); //$NON-NLS-1$
+            String[] args = {"-f", "sgx/Makefile", "-n", "-B" }; //$NON-NLS-1$
+            String[] env = calcEnvironment();
+            File projectDir = new File(mProject.getLocationURI());
+            IPath changeToDirectory = new Path(projectDir.getAbsolutePath());
+            Process proc = new SGXSDKCommandLauncher().execute(commandPath, args, env,changeToDirectory, monitor);
+            if (proc == null) {
+                return;
+            }
+            
+            BufferedReader reader = new BufferedReader(new InputStreamReader(proc.getInputStream()));
+            String line = reader.readLine();
+            while (line != null) {
+                checkBuildLine(line);
+                line = reader.readLine();
+            }
+
+            if (mCommand == null) {
+                return;
+            }
+
+            // Run the unique commands with special gcc options to extract the
+            // symbols and paths
+            // -E -P -v -dD
+            mArguments.add("-E"); //$NON-NLS-1$
+            mArguments.add("-P"); //$NON-NLS-1$
+            mArguments.add("-v"); //$NON-NLS-1$
+            mArguments.add("-dD"); //$NON-NLS-1$
+
+            URL url = Activator.findFile(new Path("discovery/" + (mCPlusPlus ? "test.cpp" : "test.c"))); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+            File testFile = new File(FileLocator.toFileURL(url).toURI());
+            String testFileName = testFile.getAbsolutePath().replace('\\', '/');
+            mArguments.add(testFileName);
+
+            args = mArguments.toArray(new String[mArguments.size()]);
+            proc = new SGXSDKCommandLauncher().execute(new Path(mCommand), args, env,changeToDirectory, monitor);
+ 
+            final InputStream errStream = proc.getErrorStream();
+            new Thread() {
+                @Override
+                public void run() {
+                    checkIncludes(errStream);
+                };
+            }.start();
+
+            checkDefines(proc.getInputStream());
+        } catch (IOException e) {
+            throw new CoreException(Activator.newStatus(e));
+        } catch (URISyntaxException e) {
+            throw new CoreException(Activator.newStatus(e));
+        }
+    }
+
+    private String[] calcEnvironment() throws CoreException {
+        IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(mProject);
+        IBuilder builder = info.getDefaultConfiguration().getBuilder();
+        HashMap<String, String> envMap = new HashMap<String, String>();
+        if (builder.appendEnvironment()) {
+            ICConfigurationDescription cfgDes = ManagedBuildManager.getDescriptionForConfiguration(builder.getParent().getParent());
+            IEnvironmentVariableManager mngr = CCorePlugin.getDefault().getBuildEnvironmentManager();
+            IEnvironmentVariable[] vars = mngr.getVariables(cfgDes, true);
+            for (IEnvironmentVariable var : vars) {
+                envMap.put(var.getName(), var.getValue());
+            }
+        }
+        // Add variables from build info
+        Map<String, String> builderEnv = builder.getExpandedEnvironment();
+        if (builderEnv != null)
+            envMap.putAll(builderEnv);
+        List<String> strings = new ArrayList<String>(envMap.size());
+        for (Entry<String, String> entry : envMap.entrySet()) {
+            StringBuffer buffer = new StringBuffer(entry.getKey());
+            buffer.append('=').append(entry.getValue());
+            strings.add(buffer.toString());
+        }
+        return strings.toArray(new String[strings.size()]);
+    }
+
+    private static class Line {
+        private final String line;
+        private int pos;
+
+        public Line(String line) {
+            this.line = line;
+        }
+
+        public Line(String line, int pos) {
+            this(line);
+            this.pos = pos;
+        }
+
+        public String getToken() {
+            skipWhiteSpace();
+            if (pos == line.length())
+                return null;
+
+            int start = pos;
+            boolean inQuote = false;
+
+            while (true) {
+                char c = line.charAt(pos);
+                if (c == ' ') {
+                    if (!inQuote)
+                        return line.substring(start, pos);
+                } else if (c == '"') {
+                    inQuote = !inQuote;
+                }
+
+                if (++pos == line.length())
+                    return null;
+            }
+
+        }
+
+        private String getRemaining() {
+            if (pos == line.length())
+                return null;
+
+            skipWhiteSpace();
+            String rc = line.substring(pos);
+            pos = line.length();
+            return rc;
+        }
+
+        private void skipWhiteSpace() {
+            while (true) {
+                if (pos == line.length())
+                    return;
+                char c = line.charAt(pos);
+                if (c == ' ')
+                    pos++;
+                else
+                    return;
+            }
+        }
+    }
+
+    private void checkBuildLine(String text) {
+        Line line = new Line(text);
+        String cmd = line.getToken();
+        if (cmd == null) {
+                return;
+        } else if (cmd.endsWith("g++")) {           //$NON-NLS-1$
+            if (mCommand == null || !mCPlusPlus) {
+                mCommand = cmd;
+                mCPlusPlus = true;
+            }
+            gatherOptions(line);
+        } else if (cmd.endsWith("gcc")) {   //$NON-NLS-1$
+            if (mCommand == null){
+                mCommand = cmd;
+            }
+            gatherOptions(line);
+        }
+        
+    }
+    
+    private void gatherOptions(Line line) {
+        for (String option = line.getToken(); option != null; option = line.getToken()) {
+            if (option.startsWith("-")) { //$NON-NLS-1$
+                // only look at options
+                if (option.equals("-I")) { //$NON-NLS-1$
+                    String dir = line.getToken();
+                    if (dir != null)
+                        addArg(option + dir);
+                } else if (option.startsWith("-I")) { //$NON-NLS-1$
+                    addArg(option);
+                } else if (option.equals("-D")) { //$NON-NLS-1$
+                    String def = line.getToken();
+                    if (def != null)
+                        addArg(option + def);
+                } else if (option.startsWith("-D")) { //$NON-NLS-1$
+                    addArg(option);
+                } else if (option.startsWith("-f")) { //$NON-NLS-1$
+                    addArg(option);
+                } else if (option.startsWith("-m")) { //$NON-NLS-1$
+                    addArg(option);
+                } else if (option.startsWith("--sysroot")) { //$NON-NLS-1$
+                    addArg(option);
+                }
+            }
+        }
+    }
+    
+    private void addArg(String arg) {
+        if (!mArguments.contains(arg))
+            mArguments.add(arg);
+    }
+
+    private void checkIncludes(InputStream in) {
+        try {
+            List<String> includes = new ArrayList<String>();
+            boolean inIncludes1 = false;
+            boolean inIncludes2 = false;
+            BufferedReader reader = new BufferedReader(new InputStreamReader(in));
+            String line = reader.readLine();
+            while (line != null) {
+                if (!inIncludes1) {
+                    if (line.equals("#include \"...\" search starts here:")) //$NON-NLS-1$
+                        inIncludes1 = true;
+                } else {
+                    if (!inIncludes2) {
+                        if (line.equals("#include <...> search starts here:")) //$NON-NLS-1$
+                            inIncludes2 = true;
+                        else
+                            includes.add(line.trim());
+                    } else {
+                        if (line.equals("End of search list.")) { //$NON-NLS-1$
+                            mPathInfo.setIncludePaths(includes);
+                        } else {
+                            includes.add(line.trim());
+                        }
+                    }
+                }
+                line = reader.readLine();
+            }
+        } catch (IOException e) {
+            Activator.log(e);
+        }
+    }
+
+    private void checkDefines(InputStream in) {
+        try {
+            Map<String, String> defines = new HashMap<String, String>();
+            BufferedReader reader = new BufferedReader(new InputStreamReader(in));
+            String line = reader.readLine();
+            while (line != null) {
+                if (line.startsWith("#define")) { //$NON-NLS-1$
+                    Line l = new Line(line, 7);
+                    String var = l.getToken();
+                    if (var == null)
+                        continue;
+                    String value = l.getRemaining();
+                    if (value == null)
+                        value = ""; //$NON-NLS-1$
+                    defines.put(var, value);
+                }
+                line = reader.readLine();
+            }
+            mPathInfo.setSymbols(defines);
+        } catch (IOException e) {
+            Activator.log(e);
+        }
+    }
+
+}

+ 213 - 213
Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/handlers/AddEnclave.java

@@ -1,213 +1,213 @@
-///////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2016 Intel Corporation.				 //
-// 									 //
-// All rights reserved. This program and the accompanying materials	 //
-// are made available under the terms of the Eclipse Public License v1.0 //
-// which accompanies this distribution, and is available at		 //
-// http://www.eclipse.org/legal/epl-v10.html				 //
-// 									 //
-// Contributors:							 //
-//     Intel Corporation - initial implementation and documentation	 //
-///////////////////////////////////////////////////////////////////////////
-
-
-package com.intel.sgx.handlers;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.util.Map;
-
-import org.eclipse.cdt.core.templateengine.TemplateCore;
-import org.eclipse.cdt.core.templateengine.TemplateEngine;
-import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.IHandler;
-import org.eclipse.core.commands.IHandlerListener;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.dialogs.InputDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-import com.intel.sgx.Activator;
-import com.intel.sgx.dialogs.AddEnclaveFileDialog;
-import com.intel.sgx.preferences.PreferenceConstants;
-
-public class AddEnclave extends ModuleCreationBaseHandler implements IHandler  {
-
-	public String edlFilename = "";
-	public String linuxMakePath = "";
-	@Override
-	public void addHandlerListener(IHandlerListener handlerListener) {
-	}
-
-	@Override
-	public void dispose() {
-	}
-
-	@Override
-	public Object execute(ExecutionEvent event) throws ExecutionException {
-		String edlBasename,linuxPath,enclaveBasename;
-		IProject project = null;
-		
-		// Display display = Display.getCurrent();
-		// Shell shell = new Shell(display);
-		Shell shell = null;
-		AddEnclaveFileDialog dialog = new AddEnclaveFileDialog(shell, this);
-		if (dialog.open() != InputDialog.OK) {
-			return null;
-		}
-
-		if((edlFilename.isEmpty())){
-			System.err.println("No Enclave selected to Import.");
-			return null;
-		}
-
-		edlBasename = edlFilename;
-		ISelection selection = HandlerUtil.getCurrentSelection(event);
-		Object element = null;
-		if (selection instanceof IStructuredSelection) {
-			element = ((IStructuredSelection) selection).getFirstElement();
-			if (element instanceof IResource) {
-				project = ((IResource) element).getProject();
-			}
-		}
-		if (!project.exists()) {
-			System.err.println("Error:  Project not found");
-			return null;
-		}
-		
-		for (IConfigurationElement i : Platform.getExtensionRegistry().getConfigurationElementsFor("org.eclipse.core.resources.projectNature")){
-		}
-		
-		
-		
-		
-		IPath linuxMkRelPath = (Path.fromOSString(linuxMakePath)).makeRelativeTo(project.getLocation().append("sgx").append("enclave_"+edlBasename));
-
-		
-		if(linuxMkRelPath.removeLastSegments(1).lastSegment().toString().equalsIgnoreCase("sgx")){
-			linuxPath = linuxMkRelPath.removeLastSegments(3).toOSString();
-			enclaveBasename = linuxMkRelPath.removeLastSegments(2).lastSegment().toString();
-		}
-		
-		else{
-			linuxPath = linuxMkRelPath.removeLastSegments(2).toOSString();
-			enclaveBasename = linuxMkRelPath.removeLastSegments(1).lastSegment().toString();
-		}
-		
-		IProgressMonitor monitor = new NullProgressMonitor();
-		TemplateCore template = null;
-        if(isCPProject(project))
-    		if(dialog.generateApp())
-    		{
-	    		template = TemplateEngine.getDefault().getTemplateById("SGXEnclaveC++WithSample");
-    		}
-    		else
-    		{
-	    		template = TemplateEngine.getDefault().getTemplateById("SGXEnclaveC++Minimal");
-    		}
-        else
-    		if(dialog.generateApp())
-    		{
-	    		template = TemplateEngine.getDefault().getTemplateById("SGXEnclaveCWithSample");
-    		}
-    		else
-    		{
-	    		template = TemplateEngine.getDefault().getTemplateById("SGXEnclaveCMinimal");
-    		}
-		
-		Map<String, String> valueStore = template.getValueStore();
-		valueStore.put("projectName", project.getName());
-		valueStore.put("workspacePath", linuxPath);
-		valueStore.put("baseName", enclaveBasename);
-		valueStore.put("enclaveName",edlFilename);
-		valueStore.put("EnclaveName",capitalize(edlFilename));
-		valueStore.put("ENCLAVENAME",edlFilename.toUpperCase());
-		valueStore.put("SdkPathFromPlugin", Activator.getDefault().getPreferenceStore().getString(PreferenceConstants.SDK_PATH));
-		
-		IStatus[] statuses =  template.executeTemplateProcesses(monitor, false);
-		for(IStatus e: statuses)
-		{
-		}
-
-		ManagedBuildManager.saveBuildInfo(project, true);
-		try {
-			project.refreshLocal(IResource.DEPTH_INFINITE, null);
-		} catch (CoreException e) {
-			Activator.log(e);
-			e.printStackTrace();
-		}
-		
-		
-		return null;
-	}
-	
-	private String capitalize(final String line) {
-		   return Character.toUpperCase(line.charAt(0)) + line.substring(1);
-	}
-
-	@Override
-	public boolean isEnabled() {
-		return true;
-	}
-
-	@Override
-	public boolean isHandled() {
-		return true;
-	}
-
-	@Override
-	public void removeHandlerListener(IHandlerListener handlerListener) {
-	}
-
-	public void setFilename(String filename) {
-		edlFilename = filename;
-	}
-	
-	
-	
-
-	public static void copyFile(File source, File dest) throws IOException {
-		byte[] bytes = new byte[4092];
-		if (source != null && dest != null) {
-			if (source.isFile()) {
-				FileInputStream in = null;
-				FileOutputStream out = null;
-				try {
-					in = new FileInputStream(source);
-					out = new FileOutputStream(dest);
-					int len;
-					while ((len = in.read(bytes)) != -1) {
-						out.write(bytes, 0, len);
-					}
-				} catch (Exception e) {
-					Activator.log(e);
-					System.err.println("Error: " + e.toString());
-				} finally {
-					try {
-						if (in != null)
-							in.close();
-					} finally {
-						if (out != null)
-							out.close();
-					}
-				}
-			}
-		}
-	}
-
-}
+///////////////////////////////////////////////////////////////////////////
+// Copyright (c) 2016 Intel Corporation.				 //
+// 									 //
+// All rights reserved. This program and the accompanying materials	 //
+// are made available under the terms of the Eclipse Public License v1.0 //
+// which accompanies this distribution, and is available at		 //
+// http://www.eclipse.org/legal/epl-v10.html				 //
+// 									 //
+// Contributors:							 //
+//     Intel Corporation - initial implementation and documentation	 //
+///////////////////////////////////////////////////////////////////////////
+
+
+package com.intel.sgx.handlers;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.Map;
+
+import org.eclipse.cdt.core.templateengine.TemplateCore;
+import org.eclipse.cdt.core.templateengine.TemplateEngine;
+import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.IHandler;
+import org.eclipse.core.commands.IHandlerListener;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.dialogs.InputDialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+import com.intel.sgx.Activator;
+import com.intel.sgx.dialogs.AddEnclaveFileDialog;
+import com.intel.sgx.preferences.PreferenceConstants;
+
+public class AddEnclave extends ModuleCreationBaseHandler implements IHandler  {
+
+	public String edlFilename = "";
+	public String linuxMakePath = "";
+	@Override
+	public void addHandlerListener(IHandlerListener handlerListener) {
+	}
+
+	@Override
+	public void dispose() {
+	}
+
+	@Override
+	public Object execute(ExecutionEvent event) throws ExecutionException {
+		String edlBasename,linuxPath,enclaveBasename;
+		IProject project = null;
+		
+		// Display display = Display.getCurrent();
+		// Shell shell = new Shell(display);
+		Shell shell = null;
+		AddEnclaveFileDialog dialog = new AddEnclaveFileDialog(shell, this);
+		if (dialog.open() != InputDialog.OK) {
+			return null;
+		}
+
+		if((edlFilename.isEmpty())){
+			System.err.println("No Enclave selected to Import.");
+			return null;
+		}
+
+		edlBasename = edlFilename;
+		ISelection selection = HandlerUtil.getCurrentSelection(event);
+		Object element = null;
+		if (selection instanceof IStructuredSelection) {
+			element = ((IStructuredSelection) selection).getFirstElement();
+			if (element instanceof IResource) {
+				project = ((IResource) element).getProject();
+			}
+		}
+		if (!project.exists()) {
+			System.err.println("Error:  Project not found");
+			return null;
+		}
+		
+		for (IConfigurationElement i : Platform.getExtensionRegistry().getConfigurationElementsFor("org.eclipse.core.resources.projectNature")){
+		}
+		
+		
+		
+		
+		IPath linuxMkRelPath = (Path.fromOSString(linuxMakePath)).makeRelativeTo(project.getLocation().append("sgx").append("enclave_"+edlBasename));
+
+		
+		if(linuxMkRelPath.removeLastSegments(1).lastSegment().toString().equalsIgnoreCase("sgx")){
+			linuxPath = linuxMkRelPath.removeLastSegments(3).toOSString();
+			enclaveBasename = linuxMkRelPath.removeLastSegments(2).lastSegment().toString();
+		}
+		
+		else{
+			linuxPath = linuxMkRelPath.removeLastSegments(2).toOSString();
+			enclaveBasename = linuxMkRelPath.removeLastSegments(1).lastSegment().toString();
+		}
+		
+		IProgressMonitor monitor = new NullProgressMonitor();
+		TemplateCore template = null;
+        if(isCPProject(project))
+    		if(dialog.generateApp())
+    		{
+	    		template = TemplateEngine.getDefault().getTemplateById("SGXEnclaveC++WithSample");
+    		}
+    		else
+    		{
+	    		template = TemplateEngine.getDefault().getTemplateById("SGXEnclaveC++Minimal");
+    		}
+        else
+    		if(dialog.generateApp())
+    		{
+	    		template = TemplateEngine.getDefault().getTemplateById("SGXEnclaveCWithSample");
+    		}
+    		else
+    		{
+	    		template = TemplateEngine.getDefault().getTemplateById("SGXEnclaveCMinimal");
+    		}
+		
+		Map<String, String> valueStore = template.getValueStore();
+		valueStore.put("projectName", project.getName());
+		valueStore.put("workspacePath", linuxPath);
+		valueStore.put("baseName", enclaveBasename);
+		valueStore.put("enclaveName",edlFilename);
+		valueStore.put("EnclaveName",capitalize(edlFilename));
+		valueStore.put("ENCLAVENAME",edlFilename.toUpperCase());
+		valueStore.put("SdkPathFromPlugin", Activator.getDefault().getPreferenceStore().getString(PreferenceConstants.SDK_PATH));
+		
+		IStatus[] statuses =  template.executeTemplateProcesses(monitor, false);
+		for(IStatus e: statuses)
+		{
+		}
+
+		ManagedBuildManager.saveBuildInfo(project, true);
+		try {
+			project.refreshLocal(IResource.DEPTH_INFINITE, null);
+		} catch (CoreException e) {
+			Activator.log(e);
+			e.printStackTrace();
+		}
+		
+		
+		return null;
+	}
+	
+	private String capitalize(final String line) {
+		   return Character.toUpperCase(line.charAt(0)) + line.substring(1);
+	}
+
+	@Override
+	public boolean isEnabled() {
+		return true;
+	}
+
+	@Override
+	public boolean isHandled() {
+		return true;
+	}
+
+	@Override
+	public void removeHandlerListener(IHandlerListener handlerListener) {
+	}
+
+	public void setFilename(String filename) {
+		edlFilename = filename;
+	}
+	
+	
+	
+
+	public static void copyFile(File source, File dest) throws IOException {
+		byte[] bytes = new byte[4092];
+		if (source != null && dest != null) {
+			if (source.isFile()) {
+				FileInputStream in = null;
+				FileOutputStream out = null;
+				try {
+					in = new FileInputStream(source);
+					out = new FileOutputStream(dest);
+					int len;
+					while ((len = in.read(bytes)) != -1) {
+						out.write(bytes, 0, len);
+					}
+				} catch (Exception e) {
+					Activator.log(e);
+					System.err.println("Error: " + e.toString());
+				} finally {
+					try {
+						if (in != null)
+							in.close();
+					} finally {
+						if (out != null)
+							out.close();
+					}
+				}
+			}
+		}
+	}
+
+}

+ 193 - 193
Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/handlers/AddTrustedStaticLib.java

@@ -1,193 +1,193 @@
-///////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2016 Intel Corporation.				 //
-// 									 //
-// All rights reserved. This program and the accompanying materials	 //
-// are made available under the terms of the Eclipse Public License v1.0 //
-// which accompanies this distribution, and is available at		 //
-// http://www.eclipse.org/legal/epl-v10.html				 //
-// 									 //
-// Contributors:							 //
-//     Intel Corporation - initial implementation and documentation	 //
-///////////////////////////////////////////////////////////////////////////
-
-
-package com.intel.sgx.handlers;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.util.Map;
-
-import org.eclipse.cdt.core.templateengine.TemplateCore;
-import org.eclipse.cdt.core.templateengine.TemplateEngine;
-import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.IHandler;
-import org.eclipse.core.commands.IHandlerListener;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.dialogs.InputDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-import com.intel.sgx.Activator;
-import com.intel.sgx.dialogs.AddTrustedStaticLibFileDialog;
-import com.intel.sgx.preferences.PreferenceConstants;
-
-public class AddTrustedStaticLib extends ModuleCreationBaseHandler implements IHandler {
-
-	public String edlFilename = "";
-	public String linuxMakePath = "";
-
-	@Override
-	public void addHandlerListener(IHandlerListener handlerListener) {
-	}
-
-	@Override
-	public void dispose() {
-	}
-
-	@Override
-	public Object execute(ExecutionEvent event) throws ExecutionException {
-		String edlBasename,linuxPath,enclaveBasename;
-		IProject project = null;
-		
-		// Display display = Display.getCurrent();
-		// Shell shell = new Shell(display);
-		Shell shell = null;
-		AddTrustedStaticLibFileDialog dialog = new AddTrustedStaticLibFileDialog(shell, this);
-		if (dialog.open() != InputDialog.OK) {
-			return null;
-		}
-
-		if((edlFilename.isEmpty() )){
-			System.err.println("No Enclave selected to Import.");
-			return null;
-		}
-
-		edlBasename = edlFilename;
-		ISelection selection = HandlerUtil.getCurrentSelection(event);
-		Object element = null;
-		if (selection instanceof IStructuredSelection) {
-			element = ((IStructuredSelection) selection).getFirstElement();
-			if (element instanceof IResource) {
-				project = ((IResource) element).getProject();
-			}
-		}
-		if (!project.exists()) {
-			System.err.println("Error:  Project not found");
-			return null;
-		}
-		
-		for (IConfigurationElement i : Platform.getExtensionRegistry().getConfigurationElementsFor("org.eclipse.core.resources.projectNature")){
-		}
-		
-		
-		
-		
-		IPath linuxMkRelPath = (Path.fromOSString(linuxMakePath)).makeRelativeTo(project.getLocation().append("sgx").append("enclave_"+edlBasename));
-
-		
-		if(linuxMkRelPath.removeLastSegments(1).lastSegment().toString().equalsIgnoreCase("sgx")){
-			linuxPath = linuxMkRelPath.removeLastSegments(3).toOSString();
-			enclaveBasename = linuxMkRelPath.removeLastSegments(2).lastSegment().toString();
-		}
-		
-		else{
-			linuxPath = linuxMkRelPath.removeLastSegments(2).toOSString();
-			enclaveBasename = linuxMkRelPath.removeLastSegments(1).lastSegment().toString();
-		}
-		
-		IProgressMonitor monitor = new NullProgressMonitor();
-		TemplateCore template = null;
-		if(isCPProject(project))
-				template = TemplateEngine.getDefault().getTemplateById("SGXTrustedStaticLibraryC++Minimal");
-		else
-				template = TemplateEngine.getDefault().getTemplateById("SGXTrustedStaticLibraryCMinimal");
-		
-		Map<String, String> valueStore = template.getValueStore();
-		valueStore.put("projectName", project.getName());
-		valueStore.put("workspacePath", linuxPath);
-		valueStore.put("baseName", enclaveBasename);
-		valueStore.put("enclaveName",edlFilename);
-		valueStore.put("EnclaveName",capitalize(edlFilename));
-		valueStore.put("ENCLAVENAME",edlFilename.toUpperCase());
-		valueStore.put("SdkPathFromPlugin", Activator.getDefault().getPreferenceStore().getString(PreferenceConstants.SDK_PATH));
-		
-		IStatus[] statuses =  template.executeTemplateProcesses(monitor, false);
-
-		
-		ManagedBuildManager.saveBuildInfo(project, true);
-		try {
-			project.refreshLocal(IResource.DEPTH_INFINITE, null);
-		} catch (CoreException e) {
-			Activator.log(e);
-			e.printStackTrace();
-		}
-		return null;
-	}
-	
-	private String capitalize(final String line) {
-		   return Character.toUpperCase(line.charAt(0)) + line.substring(1);
-	}
-
-	@Override
-	public boolean isEnabled() {
-		return true;
-	}
-
-	@Override
-	public boolean isHandled() {
-		return true;
-	}
-
-	@Override
-	public void removeHandlerListener(IHandlerListener handlerListener) {
-	}
-
-	public void setFilename(String filename) {
-		edlFilename = filename;
-	}
-
-	public static void copyFile(File source, File dest) throws IOException {
-		byte[] bytes = new byte[4092];
-		if (source != null && dest != null) {
-			if (source.isFile()) {
-				FileInputStream in = null;
-				FileOutputStream out = null;
-				try {
-					in = new FileInputStream(source);
-					out = new FileOutputStream(dest);
-					int len;
-					while ((len = in.read(bytes)) != -1) {
-						out.write(bytes, 0, len);
-					}
-				} catch (Exception e) {
-					Activator.log(e);
-					System.err.println("Error: " + e.toString());
-				} finally {
-					try {
-						if (in != null)
-							in.close();
-					} finally {
-						if (out != null)
-							out.close();
-					}
-				}
-			}
-		}
-	}
-
-}
+///////////////////////////////////////////////////////////////////////////
+// Copyright (c) 2016 Intel Corporation.				 //
+// 									 //
+// All rights reserved. This program and the accompanying materials	 //
+// are made available under the terms of the Eclipse Public License v1.0 //
+// which accompanies this distribution, and is available at		 //
+// http://www.eclipse.org/legal/epl-v10.html				 //
+// 									 //
+// Contributors:							 //
+//     Intel Corporation - initial implementation and documentation	 //
+///////////////////////////////////////////////////////////////////////////
+
+
+package com.intel.sgx.handlers;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.Map;
+
+import org.eclipse.cdt.core.templateengine.TemplateCore;
+import org.eclipse.cdt.core.templateengine.TemplateEngine;
+import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.IHandler;
+import org.eclipse.core.commands.IHandlerListener;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.dialogs.InputDialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+import com.intel.sgx.Activator;
+import com.intel.sgx.dialogs.AddTrustedStaticLibFileDialog;
+import com.intel.sgx.preferences.PreferenceConstants;
+
+public class AddTrustedStaticLib extends ModuleCreationBaseHandler implements IHandler {
+
+	public String edlFilename = "";
+	public String linuxMakePath = "";
+
+	@Override
+	public void addHandlerListener(IHandlerListener handlerListener) {
+	}
+
+	@Override
+	public void dispose() {
+	}
+
+	@Override
+	public Object execute(ExecutionEvent event) throws ExecutionException {
+		String edlBasename,linuxPath,enclaveBasename;
+		IProject project = null;
+		
+		// Display display = Display.getCurrent();
+		// Shell shell = new Shell(display);
+		Shell shell = null;
+		AddTrustedStaticLibFileDialog dialog = new AddTrustedStaticLibFileDialog(shell, this);
+		if (dialog.open() != InputDialog.OK) {
+			return null;
+		}
+
+		if((edlFilename.isEmpty() )){
+			System.err.println("No Enclave selected to Import.");
+			return null;
+		}
+
+		edlBasename = edlFilename;
+		ISelection selection = HandlerUtil.getCurrentSelection(event);
+		Object element = null;
+		if (selection instanceof IStructuredSelection) {
+			element = ((IStructuredSelection) selection).getFirstElement();
+			if (element instanceof IResource) {
+				project = ((IResource) element).getProject();
+			}
+		}
+		if (!project.exists()) {
+			System.err.println("Error:  Project not found");
+			return null;
+		}
+		
+		for (IConfigurationElement i : Platform.getExtensionRegistry().getConfigurationElementsFor("org.eclipse.core.resources.projectNature")){
+		}
+		
+		
+		
+		
+		IPath linuxMkRelPath = (Path.fromOSString(linuxMakePath)).makeRelativeTo(project.getLocation().append("sgx").append("enclave_"+edlBasename));
+
+		
+		if(linuxMkRelPath.removeLastSegments(1).lastSegment().toString().equalsIgnoreCase("sgx")){
+			linuxPath = linuxMkRelPath.removeLastSegments(3).toOSString();
+			enclaveBasename = linuxMkRelPath.removeLastSegments(2).lastSegment().toString();
+		}
+		
+		else{
+			linuxPath = linuxMkRelPath.removeLastSegments(2).toOSString();
+			enclaveBasename = linuxMkRelPath.removeLastSegments(1).lastSegment().toString();
+		}
+		
+		IProgressMonitor monitor = new NullProgressMonitor();
+		TemplateCore template = null;
+		if(isCPProject(project))
+				template = TemplateEngine.getDefault().getTemplateById("SGXTrustedStaticLibraryC++Minimal");
+		else
+				template = TemplateEngine.getDefault().getTemplateById("SGXTrustedStaticLibraryCMinimal");
+		
+		Map<String, String> valueStore = template.getValueStore();
+		valueStore.put("projectName", project.getName());
+		valueStore.put("workspacePath", linuxPath);
+		valueStore.put("baseName", enclaveBasename);
+		valueStore.put("enclaveName",edlFilename);
+		valueStore.put("EnclaveName",capitalize(edlFilename));
+		valueStore.put("ENCLAVENAME",edlFilename.toUpperCase());
+		valueStore.put("SdkPathFromPlugin", Activator.getDefault().getPreferenceStore().getString(PreferenceConstants.SDK_PATH));
+		
+		IStatus[] statuses =  template.executeTemplateProcesses(monitor, false);
+
+		
+		ManagedBuildManager.saveBuildInfo(project, true);
+		try {
+			project.refreshLocal(IResource.DEPTH_INFINITE, null);
+		} catch (CoreException e) {
+			Activator.log(e);
+			e.printStackTrace();
+		}
+		return null;
+	}
+	
+	private String capitalize(final String line) {
+		   return Character.toUpperCase(line.charAt(0)) + line.substring(1);
+	}
+
+	@Override
+	public boolean isEnabled() {
+		return true;
+	}
+
+	@Override
+	public boolean isHandled() {
+		return true;
+	}
+
+	@Override
+	public void removeHandlerListener(IHandlerListener handlerListener) {
+	}
+
+	public void setFilename(String filename) {
+		edlFilename = filename;
+	}
+
+	public static void copyFile(File source, File dest) throws IOException {
+		byte[] bytes = new byte[4092];
+		if (source != null && dest != null) {
+			if (source.isFile()) {
+				FileInputStream in = null;
+				FileOutputStream out = null;
+				try {
+					in = new FileInputStream(source);
+					out = new FileOutputStream(dest);
+					int len;
+					while ((len = in.read(bytes)) != -1) {
+						out.write(bytes, 0, len);
+					}
+				} catch (Exception e) {
+					Activator.log(e);
+					System.err.println("Error: " + e.toString());
+				} finally {
+					try {
+						if (in != null)
+							in.close();
+					} finally {
+						if (out != null)
+							out.close();
+					}
+				}
+			}
+		}
+	}
+
+}

+ 169 - 169
Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/handlers/RemoveEnclave.java

@@ -1,169 +1,169 @@
-///////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2016 Intel Corporation.				 //
-// 									 //
-// All rights reserved. This program and the accompanying materials	 //
-// are made available under the terms of the Eclipse Public License v1.0 //
-// which accompanies this distribution, and is available at		 //
-// http://www.eclipse.org/legal/epl-v10.html				 //
-// 									 //
-// Contributors:							 //
-//     Intel Corporation - initial implementation and documentation	 //
-///////////////////////////////////////////////////////////////////////////
-
-
-package com.intel.sgx.handlers;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.IHandler;
-import org.eclipse.core.commands.IHandlerListener;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.dialogs.InputDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-import com.intel.sgx.Activator;
-import com.intel.sgx.dialogs.RemoveEnclaveFileDialog;
-
-public class RemoveEnclave implements IHandler {
-
-	public String edlFilename = "";
-	private IPath edlCanonicalFilename;
-	
-	@Override
-	public void addHandlerListener(IHandlerListener handlerListener) {
-	}
-
-	@Override
-	public void dispose() {
-	}
-
-	@Override
-	public Object execute(ExecutionEvent event) throws ExecutionException {
-		String edlBasename;
-		IProject project = null;
-
-		// Display display = Display.getCurrent();
-		// Shell shell = new Shell(display);
-	
-		RemoveEnclaveFileDialog dialog  = new RemoveEnclaveFileDialog(null, this);
-
-		if (dialog.open() != InputDialog.OK) {
-			return null;
-		}
-
-		edlCanonicalFilename = Path.fromOSString(edlFilename);
-		edlBasename = edlCanonicalFilename.lastSegment();
-
-		if(edlBasename.isEmpty()){
-			return null;
-		}
-		
-		ISelection selection = HandlerUtil.getCurrentSelection(event);
-		Object element = null;
-		if(selection instanceof IStructuredSelection) {
-			element = ((IStructuredSelection)selection).getFirstElement();
-			if (element instanceof IResource) {
-				project= ((IResource)element).getProject();
-			}
-		}
-		if (!project.exists()) {
-			System.err.println("Error: Project not found");
-			return null;
-		}
-			
-		IPath targetRelPath = project.getProjectRelativePath().append("sgx").append("enclave_" + edlBasename);
-
-		try {
-			for (int i=1;i<=targetRelPath.segmentCount();i++) {
-				IFolder subfolder = project.getFolder(targetRelPath.uptoSegment(i));
-
-				if (subfolder.exists()){
-					if(subfolder.getProjectRelativePath().toOSString().contains("enclave_"+edlBasename)){
-						subfolder.delete(true, true, null);
-						break;
-					}
-				}
-			}
-			targetRelPath = project.getProjectRelativePath().append("sgx").append(edlBasename);
-			for (int i=1;i<=targetRelPath.segmentCount();i++) {
-				IFolder subfolder = project.getFolder(targetRelPath.uptoSegment(i));
-
-				if (subfolder.exists()){
-					if(subfolder.getProjectRelativePath().toOSString().contains(edlBasename)){
-						subfolder.delete(true, true, null);
-						break;
-					}
-				}
-			}			
-		} catch (Exception e) {
-			Activator.log(e);
-		}
-		
-		try {
-			project.refreshLocal(IResource.DEPTH_INFINITE, null);
-		} catch (CoreException e) {
-			Activator.log(e);
-		} catch (IllegalArgumentException e){
-			Activator.log(e);
-		}
-		
-		return null;
-	}
-
-	@Override
-	public boolean isEnabled() {
-		return true;
-	}
-
-	@Override
-	public boolean isHandled() {
-		return true;
-	}
-
-	@Override
-	public void removeHandlerListener(IHandlerListener handlerListener) {
-	}
-
-	public static void copyFile(File source, File dest) throws IOException {
-		byte[] bytes = new byte[4092];
-		if (source != null && dest != null) {
-			if (source.isFile()) {
-				FileInputStream in = null;
-				FileOutputStream out = null;
-				try {
-					in = new FileInputStream(source);
-					out = new FileOutputStream(dest);
-					int len;
-					while ((len = in.read(bytes)) != -1) {
-						out.write(bytes, 0, len);
-					}
-				} catch (Exception e) {
-					System.err.println("Error: " + e.toString());
-					Activator.log(e);
-				} finally {
-					try {
-						if (in != null)
-							in.close();
-					} finally {
-						if (out != null)
-							out.close();
-					}
-				}
-			}
-		}
-	}
-}
+///////////////////////////////////////////////////////////////////////////
+// Copyright (c) 2016 Intel Corporation.				 //
+// 									 //
+// All rights reserved. This program and the accompanying materials	 //
+// are made available under the terms of the Eclipse Public License v1.0 //
+// which accompanies this distribution, and is available at		 //
+// http://www.eclipse.org/legal/epl-v10.html				 //
+// 									 //
+// Contributors:							 //
+//     Intel Corporation - initial implementation and documentation	 //
+///////////////////////////////////////////////////////////////////////////
+
+
+package com.intel.sgx.handlers;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.IHandler;
+import org.eclipse.core.commands.IHandlerListener;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.dialogs.InputDialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+import com.intel.sgx.Activator;
+import com.intel.sgx.dialogs.RemoveEnclaveFileDialog;
+
+public class RemoveEnclave implements IHandler {
+
+	public String edlFilename = "";
+	private IPath edlCanonicalFilename;
+	
+	@Override
+	public void addHandlerListener(IHandlerListener handlerListener) {
+	}
+
+	@Override
+	public void dispose() {
+	}
+
+	@Override
+	public Object execute(ExecutionEvent event) throws ExecutionException {
+		String edlBasename;
+		IProject project = null;
+
+		// Display display = Display.getCurrent();
+		// Shell shell = new Shell(display);
+	
+		RemoveEnclaveFileDialog dialog  = new RemoveEnclaveFileDialog(null, this);
+
+		if (dialog.open() != InputDialog.OK) {
+			return null;
+		}
+
+		edlCanonicalFilename = Path.fromOSString(edlFilename);
+		edlBasename = edlCanonicalFilename.lastSegment();
+
+		if(edlBasename.isEmpty()){
+			return null;
+		}
+		
+		ISelection selection = HandlerUtil.getCurrentSelection(event);
+		Object element = null;
+		if(selection instanceof IStructuredSelection) {
+			element = ((IStructuredSelection)selection).getFirstElement();
+			if (element instanceof IResource) {
+				project= ((IResource)element).getProject();
+			}
+		}
+		if (!project.exists()) {
+			System.err.println("Error: Project not found");
+			return null;
+		}
+			
+		IPath targetRelPath = project.getProjectRelativePath().append("sgx").append("enclave_" + edlBasename);
+
+		try {
+			for (int i=1;i<=targetRelPath.segmentCount();i++) {
+				IFolder subfolder = project.getFolder(targetRelPath.uptoSegment(i));
+
+				if (subfolder.exists()){
+					if(subfolder.getProjectRelativePath().toOSString().contains("enclave_"+edlBasename)){
+						subfolder.delete(true, true, null);
+						break;
+					}
+				}
+			}
+			targetRelPath = project.getProjectRelativePath().append("sgx").append(edlBasename);
+			for (int i=1;i<=targetRelPath.segmentCount();i++) {
+				IFolder subfolder = project.getFolder(targetRelPath.uptoSegment(i));
+
+				if (subfolder.exists()){
+					if(subfolder.getProjectRelativePath().toOSString().contains(edlBasename)){
+						subfolder.delete(true, true, null);
+						break;
+					}
+				}
+			}			
+		} catch (Exception e) {
+			Activator.log(e);
+		}
+		
+		try {
+			project.refreshLocal(IResource.DEPTH_INFINITE, null);
+		} catch (CoreException e) {
+			Activator.log(e);
+		} catch (IllegalArgumentException e){
+			Activator.log(e);
+		}
+		
+		return null;
+	}
+
+	@Override
+	public boolean isEnabled() {
+		return true;
+	}
+
+	@Override
+	public boolean isHandled() {
+		return true;
+	}
+
+	@Override
+	public void removeHandlerListener(IHandlerListener handlerListener) {
+	}
+
+	public static void copyFile(File source, File dest) throws IOException {
+		byte[] bytes = new byte[4092];
+		if (source != null && dest != null) {
+			if (source.isFile()) {
+				FileInputStream in = null;
+				FileOutputStream out = null;
+				try {
+					in = new FileInputStream(source);
+					out = new FileOutputStream(dest);
+					int len;
+					while ((len = in.read(bytes)) != -1) {
+						out.write(bytes, 0, len);
+					}
+				} catch (Exception e) {
+					System.err.println("Error: " + e.toString());
+					Activator.log(e);
+				} finally {
+					try {
+						if (in != null)
+							in.close();
+					} finally {
+						if (out != null)
+							out.close();
+					}
+				}
+			}
+		}
+	}
+}

+ 38 - 38
Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/handlers/SGXSDKWizardHandler.java

@@ -1,38 +1,38 @@
-///////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2016 Intel Corporation.				 //
-// 									 //
-// All rights reserved. This program and the accompanying materials	 //
-// are made available under the terms of the Eclipse Public License v1.0 //
-// which accompanies this distribution, and is available at		 //
-// http://www.eclipse.org/legal/epl-v10.html				 //
-// 									 //
-// Contributors:							 //
-//     Intel Corporation - initial implementation and documentation	 //
-///////////////////////////////////////////////////////////////////////////
-
-
-package com.intel.sgx.handlers;
-
-import org.eclipse.cdt.managedbuilder.core.IToolChain;
-import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
-import org.eclipse.cdt.managedbuilder.ui.wizards.STDWizardHandler;
-
-public class SGXSDKWizardHandler extends STDWizardHandler {
-
-	public SGXSDKWizardHandler() {
-		super(null, null);
-	}
-
-	
-    @Override
-    public IToolChain[] getSelectedToolChains() {
-        IToolChain[] tcs = ManagedBuildManager.getRealToolChains();
-        for (IToolChain tc : tcs) {
-            if (tc.getId().equals("com.intel.sgx.SGXtoolChain"))
-                return new IToolChain[] {
-                    tc
-                };
-        }
-        return super.getSelectedToolChains();
-    }
-}
+///////////////////////////////////////////////////////////////////////////
+// Copyright (c) 2016 Intel Corporation.				 //
+// 									 //
+// All rights reserved. This program and the accompanying materials	 //
+// are made available under the terms of the Eclipse Public License v1.0 //
+// which accompanies this distribution, and is available at		 //
+// http://www.eclipse.org/legal/epl-v10.html				 //
+// 									 //
+// Contributors:							 //
+//     Intel Corporation - initial implementation and documentation	 //
+///////////////////////////////////////////////////////////////////////////
+
+
+package com.intel.sgx.handlers;
+
+import org.eclipse.cdt.managedbuilder.core.IToolChain;
+import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
+import org.eclipse.cdt.managedbuilder.ui.wizards.STDWizardHandler;
+
+public class SGXSDKWizardHandler extends STDWizardHandler {
+
+	public SGXSDKWizardHandler() {
+		super(null, null);
+	}
+
+	
+    @Override
+    public IToolChain[] getSelectedToolChains() {
+        IToolChain[] tcs = ManagedBuildManager.getRealToolChains();
+        for (IToolChain tc : tcs) {
+            if (tc.getId().equals("com.intel.sgx.SGXtoolChain"))
+                return new IToolChain[] {
+                    tc
+                };
+        }
+        return super.getSelectedToolChains();
+    }
+}

+ 74 - 74
Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/handlers/TwoStepSignStep1.java

@@ -1,74 +1,74 @@
-///////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2016 Intel Corporation.				 //
-// 									 //
-// All rights reserved. This program and the accompanying materials	 //
-// are made available under the terms of the Eclipse Public License v1.0 //
-// which accompanies this distribution, and is available at		 //
-// http://www.eclipse.org/legal/epl-v10.html				 //
-// 									 //
-// Contributors:							 //
-//     Intel Corporation - initial implementation and documentation	 //
-///////////////////////////////////////////////////////////////////////////
-
-
-package com.intel.sgx.handlers;
-
-import org.eclipse.jface.dialogs.InputDialog;
-
-import com.intel.sgx.dialogs.SGXDialogBase;
-import com.intel.sgx.dialogs.TwoStepSignStep1Dialog1;
-import com.intel.sgx.dialogs.TwoStepSignStep1Dialog2;
-import com.intel.sgx.dialogs.TwoStepSignStep1Dialog3;
-
-// Generate Hash
-public class TwoStepSignStep1 extends TwoStepSignHandlerBase {
-
-	public TwoStepSignStep1() {
-	}
-
-	@Override
-	protected Object executeSGXStuff() throws ErrorException, CancelException {
-
-		initializeSigntool();
-
-		showDialog1();
-		showDialog2();
-		showDialog3();
-		return null;
-	}
-
-	private void showDialog1() throws CancelException, ErrorException {
-
-		TwoStepSignStep1Dialog1 dialog1 = new TwoStepSignStep1Dialog1(shell, this);
-		if (dialog1.open() != InputDialog.OK) {
-			cancel();
-		}
-		
-		executeGenData();
-
-	}
-
-	private void showDialog2() throws CancelException {
-		TwoStepSignStep1Dialog2 dialog2 = new TwoStepSignStep1Dialog2(shell,
-				hashFile);
-
-		if (dialog2.open() != InputDialog.OK) {
-			cancel();
-		}
-	}
-
-	protected void showDialog3() throws CancelException, ErrorException {
-		SGXDialogBase dialog3 = new TwoStepSignStep1Dialog3(shell, this);
-		if (dialog3.open() != InputDialog.OK) {
-			cancel();
-		}
-		
-		validateExternalSignPublicKeyFile();
-
-		validateExternallySignedHashFile();
-
-		executeCatSig();
-		
-	}
-
-}
+///////////////////////////////////////////////////////////////////////////
+// Copyright (c) 2016 Intel Corporation.				 //
+// 									 //
+// All rights reserved. This program and the accompanying materials	 //
+// are made available under the terms of the Eclipse Public License v1.0 //
+// which accompanies this distribution, and is available at		 //
+// http://www.eclipse.org/legal/epl-v10.html				 //
+// 									 //
+// Contributors:							 //
+//     Intel Corporation - initial implementation and documentation	 //
+///////////////////////////////////////////////////////////////////////////
+
+
+package com.intel.sgx.handlers;
+
+import org.eclipse.jface.dialogs.InputDialog;
+
+import com.intel.sgx.dialogs.SGXDialogBase;
+import com.intel.sgx.dialogs.TwoStepSignStep1Dialog1;
+import com.intel.sgx.dialogs.TwoStepSignStep1Dialog2;
+import com.intel.sgx.dialogs.TwoStepSignStep1Dialog3;
+
+// Generate Hash
+public class TwoStepSignStep1 extends TwoStepSignHandlerBase {
+
+	public TwoStepSignStep1() {
+	}
+
+	@Override
+	protected Object executeSGXStuff() throws ErrorException, CancelException {
+
+		initializeSigntool();
+
+		showDialog1();
+		showDialog2();
+		showDialog3();
+		return null;
+	}
+
+	private void showDialog1() throws CancelException, ErrorException {
+
+		TwoStepSignStep1Dialog1 dialog1 = new TwoStepSignStep1Dialog1(shell, this);
+		if (dialog1.open() != InputDialog.OK) {
+			cancel();
+		}
+		
+		executeGenData();
+
+	}
+
+	private void showDialog2() throws CancelException {
+		TwoStepSignStep1Dialog2 dialog2 = new TwoStepSignStep1Dialog2(shell,
+				hashFile);
+
+		if (dialog2.open() != InputDialog.OK) {
+			cancel();
+		}
+	}
+
+	protected void showDialog3() throws CancelException, ErrorException {
+		SGXDialogBase dialog3 = new TwoStepSignStep1Dialog3(shell, this);
+		if (dialog3.open() != InputDialog.OK) {
+			cancel();
+		}
+		
+		validateExternalSignPublicKeyFile();
+
+		validateExternallySignedHashFile();
+
+		executeCatSig();
+		
+	}
+
+}

+ 39 - 39
Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/handlers/TwoStepSignStep2.java

@@ -1,39 +1,39 @@
-///////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2016 Intel Corporation.				 //
-// 									 //
-// All rights reserved. This program and the accompanying materials	 //
-// are made available under the terms of the Eclipse Public License v1.0 //
-// which accompanies this distribution, and is available at		 //
-// http://www.eclipse.org/legal/epl-v10.html				 //
-// 									 //
-// Contributors:							 //
-//     Intel Corporation - initial implementation and documentation	 //
-///////////////////////////////////////////////////////////////////////////
-
-
-package com.intel.sgx.handlers;
-
-import org.eclipse.jface.dialogs.InputDialog;
-
-import com.intel.sgx.dialogs.TwoStepSignStep2Dialog;
-
-// Sign
-public class TwoStepSignStep2 extends TwoStepSignHandlerBase {
-	
-	public TwoStepSignStep2() {
-	}
-	
-	@Override
-	protected Object executeSGXStuff() throws ErrorException, CancelException {
-		initializeSigntool();
-		
-		TwoStepSignStep2Dialog dialog = new TwoStepSignStep2Dialog(shell, this);
-		if(dialog.open() != InputDialog.OK) {
-			cancel();
-		}
-		
-		executeCatSig();
-		return null;
-	}
-
-}
+///////////////////////////////////////////////////////////////////////////
+// Copyright (c) 2016 Intel Corporation.				 //
+// 									 //
+// All rights reserved. This program and the accompanying materials	 //
+// are made available under the terms of the Eclipse Public License v1.0 //
+// which accompanies this distribution, and is available at		 //
+// http://www.eclipse.org/legal/epl-v10.html				 //
+// 									 //
+// Contributors:							 //
+//     Intel Corporation - initial implementation and documentation	 //
+///////////////////////////////////////////////////////////////////////////
+
+
+package com.intel.sgx.handlers;
+
+import org.eclipse.jface.dialogs.InputDialog;
+
+import com.intel.sgx.dialogs.TwoStepSignStep2Dialog;
+
+// Sign
+public class TwoStepSignStep2 extends TwoStepSignHandlerBase {
+	
+	public TwoStepSignStep2() {
+	}
+	
+	@Override
+	protected Object executeSGXStuff() throws ErrorException, CancelException {
+		initializeSigntool();
+		
+		TwoStepSignStep2Dialog dialog = new TwoStepSignStep2Dialog(shell, this);
+		if(dialog.open() != InputDialog.OK) {
+			cancel();
+		}
+		
+		executeCatSig();
+		return null;
+	}
+
+}

+ 83 - 83
Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/SGXtemplates/ctemplate.xml

@@ -1,83 +1,83 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--                                                                       -->
-<!-- Copyright (c) 2016 Intel Corporation.				   -->
-<!-- 									   -->
-<!-- All rights reserved. This program and the accompanying materials	   -->
-<!-- are made available under the terms of the Eclipse Public License v1.0 -->
-<!-- which accompanies this distribution, and is available at		   -->
-<!-- http://www.eclipse.org/legal/epl-v10.html				   -->
-<!-- 									   -->
-<!-- Contributors:							   -->
-<!--     Intel Corporation - initial implementation and documentation	   -->
-<!--                                                                       -->
-<template type="ProjTempl" version="1.0" supplier="Eclipse.org" revision="1.0" author="Bala Torati (Symbian)"
-		copyright="Copyright (c) 2007 Symbian Software Limited and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available athttp://www.eclipse.org/legal/epl-v10.html"
-		id="myHelloWorldCCProject" label="HelloWorld.CCtemplate.label" description="HelloWorld.CCtemplate.description"
-		 help="help.html">
-	<property-group id="basics" label="HelloWorld.basics.label" description="HelloWorld.basics.description" type="PAGES-ONLY" help="help.html">
-		<property id="author"
-			label="HelloWorld.author.label"
-			description="HelloWorld.author.description"
-			type="input"
-			pattern=".*"
-			default=""
-			hidden="false"
-			persist="true"/>
-		<property id="copyright"
-			label="HelloWorld.copyright.label"
-			description="HelloWorld.copyright.description"
-			type="input"
-			pattern=".*"
-			default="HelloWorld.copyright.default"
-			hidden="false"
-			persist="true"/>
-		<property id="message"
-			label="HelloWorld.message.label"
-			description="HelloWorld.message.description"
-			type="input"
-			pattern=".*"
-			default="HelloWorld.message.default"
-			hidden="false"
-			persist="true"/>
-		<property id="sourceDir"
-				label="HelloWorld.sourceDir.label"
-				description="HelloWorld.sourceDir.description"
-				type="input"
-				default="HelloWorld.sourceDir.default"
-				pattern="[a-zA-Z0-9]+"
-				persist="true"/>
-	</property-group>
-	
-	<process type="org.eclipse.cdt.managedbuilder.core.NewManagedProject">
-		<simple name="name" value="$(projectName)" /> 
-		<simple name="artifactExtension" value="exe" /> 
-		<simple name="isCProject" value="false" /> 
-	</process>
-
-	<process type="org.eclipse.cdt.core.CreateSourceFolder">
-		<simple name="projectName" value="$(projectName)"/>
-		<simple name="path" value="$(sourceDir)"/>
-	</process>
-
-	<process type="org.eclipse.cdt.core.AddFiles">
-		<simple name="projectName" value="$(projectName)"/>
-		<complex-array name="files">
-			<element>
-				<simple name="source" value="src/Basename.cpp"/>
-				<simple name="target" value="$(sourceDir)/$(projectName).cpp"/>
-				<simple name="replaceable" value="true"/>
-			</element>
-		</complex-array>
-	</process>
-
-	<process type="org.eclipse.cdt.ui.OpenFiles">
-		<simple name="projectName" value="$(projectName)"/>
-		<complex-array name="files">
-			<element>
-				<simple name="target" value="$(sourceDir)/$(projectName).cpp"/>
-			</element>
-		</complex-array>
-	</process>
-
-</template>
-
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--                                                                       -->
+<!-- Copyright (c) 2016 Intel Corporation.				   -->
+<!-- 									   -->
+<!-- All rights reserved. This program and the accompanying materials	   -->
+<!-- are made available under the terms of the Eclipse Public License v1.0 -->
+<!-- which accompanies this distribution, and is available at		   -->
+<!-- http://www.eclipse.org/legal/epl-v10.html				   -->
+<!-- 									   -->
+<!-- Contributors:							   -->
+<!--     Intel Corporation - initial implementation and documentation	   -->
+<!--                                                                       -->
+<template type="ProjTempl" version="1.0" supplier="Eclipse.org" revision="1.0" author="Bala Torati (Symbian)"
+		copyright="Copyright (c) 2007 Symbian Software Limited and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available athttp://www.eclipse.org/legal/epl-v10.html"
+		id="myHelloWorldCCProject" label="HelloWorld.CCtemplate.label" description="HelloWorld.CCtemplate.description"
+		 help="help.html">
+	<property-group id="basics" label="HelloWorld.basics.label" description="HelloWorld.basics.description" type="PAGES-ONLY" help="help.html">
+		<property id="author"
+			label="HelloWorld.author.label"
+			description="HelloWorld.author.description"
+			type="input"
+			pattern=".*"
+			default=""
+			hidden="false"
+			persist="true"/>
+		<property id="copyright"
+			label="HelloWorld.copyright.label"
+			description="HelloWorld.copyright.description"
+			type="input"
+			pattern=".*"
+			default="HelloWorld.copyright.default"
+			hidden="false"
+			persist="true"/>
+		<property id="message"
+			label="HelloWorld.message.label"
+			description="HelloWorld.message.description"
+			type="input"
+			pattern=".*"
+			default="HelloWorld.message.default"
+			hidden="false"
+			persist="true"/>
+		<property id="sourceDir"
+				label="HelloWorld.sourceDir.label"
+				description="HelloWorld.sourceDir.description"
+				type="input"
+				default="HelloWorld.sourceDir.default"
+				pattern="[a-zA-Z0-9]+"
+				persist="true"/>
+	</property-group>
+	
+	<process type="org.eclipse.cdt.managedbuilder.core.NewManagedProject">
+		<simple name="name" value="$(projectName)" /> 
+		<simple name="artifactExtension" value="exe" /> 
+		<simple name="isCProject" value="false" /> 
+	</process>
+
+	<process type="org.eclipse.cdt.core.CreateSourceFolder">
+		<simple name="projectName" value="$(projectName)"/>
+		<simple name="path" value="$(sourceDir)"/>
+	</process>
+
+	<process type="org.eclipse.cdt.core.AddFiles">
+		<simple name="projectName" value="$(projectName)"/>
+		<complex-array name="files">
+			<element>
+				<simple name="source" value="src/Basename.cpp"/>
+				<simple name="target" value="$(sourceDir)/$(projectName).cpp"/>
+				<simple name="replaceable" value="true"/>
+			</element>
+		</complex-array>
+	</process>
+
+	<process type="org.eclipse.cdt.ui.OpenFiles">
+		<simple name="projectName" value="$(projectName)"/>
+		<complex-array name="files">
+			<element>
+				<simple name="target" value="$(sourceDir)/$(projectName).cpp"/>
+			</element>
+		</complex-array>
+	</process>
+
+</template>
+

+ 109 - 109
Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/SGXtemplates/cxxstaticlibtemplate.xml

@@ -1,109 +1,109 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--                                                                       -->
-<!-- Copyright (c) 2016 Intel Corporation.				   -->
-<!-- 									   -->
-<!-- All rights reserved. This program and the accompanying materials	   -->
-<!-- are made available under the terms of the Eclipse Public License v1.0 -->
-<!-- which accompanies this distribution, and is available at		   -->
-<!-- http://www.eclipse.org/legal/epl-v10.html				   -->
-<!-- 									   -->
-<!-- Contributors:							   -->
-<!--     Intel Corporation - initial implementation and documentation	   -->
-<!--                                                                       -->
-<template type="ProjTempl" version="1.0" supplier="Intel"
-	revision="1.0" author="Intel" id="%SGX.CXXStatictemplate.title.id" label="%SGX.CXXStatictemplate.title.label"
-	description="%SGX.CXXStatictemplate.title.description" help="help.html">
-	<property-group id="enclaveSettings" label="%SGX.CXXStatictemplate.enclaveSettings.label"
-		description="%SGX.CXXStatictemplate.enclaveSettings.description" type="PAGES-ONLY"
-		help="help.html" branding-icon="SGX.gif">
-		<property id="GenerateEdl" label="%SGX.CXXStatictemplate.requiresEdl.label"
-			description="%SGX.CXXStatictemplate.requiresEdl.description"
-			type="boolean" default="false" pattern="" hidden="false" mandatory="false"
-			persist="false"> 
-		</property>
-	</property-group>
-	<process type="org.eclipse.cdt.managedbuilder.core.NewManagedProject">
-		<simple name="name" value="$(projectName)" />
-		<simple name="location" value="$(location)" />
-		<simple name="artifactExtension" value="exe" />
-		<simple name="isCProject" value="true" />
-	</process>
-	<process type="org.eclipse.cdt.core.CreateSourceFolder">
-		<simple name="projectName" value="$(projectName)" />
-		<simple name="path" value="src" />
-	</process>
-	<if condition="$(GenerateEdl)!=false">
-		<process type="org.eclipse.cdt.core.AddFiles">
-			<simple name="projectName" value="$(projectName)" />
-			<complex-array name="files">
-				<element>
-					<simple name="source" value="../source/Basename.edl" />
-					<simple name="target" value="src/$(baseName).edl" />
-					<simple name="replaceable" value="true" />
-				</element>
-				<element>
-					<simple name="source" value="../include/Basename_t.h" />
-					<simple name="target" value="sgx/$(baseName)/$(baseName)_t.h" />
-					<simple name="replaceable" value="true" />
-				</element>
-			</complex-array>
-		</process>
-	</if>
-	<process type="com.intel.sgx.SetStaticCCNature">
-		<simple name="projectName" value="$(projectName)" />
-	</process>	
-	<if condition="$(GenerateEdl)!=false">
-		<process type="org.eclipse.cdt.core.AddFiles">
-			<simple name="projectName" value="$(projectName)" />
-			<complex-array name="files">
-				<element>
-					<simple name="source" value="../source/Basename.edl" />
-					<simple name="target" value="src/$(baseName).edl" />
-					<simple name="replaceable" value="true" />
-				</element>
-				<element>
-					<simple name="source" value="../source/Basename.cpp" />
-					<simple name="target" value="src/$(baseName).cpp" />
-					<simple name="replaceable" value="true" />
-				</element>
-				<element>
-					<simple name="source" value="../include/Basename_t.h" />
-					<simple name="target" value="sgx/$(baseName)_trusted_stubs/$(baseName)_t.h" />
-					<simple name="replaceable" value="true" />
-				</element>
-				<element>
-					<simple name="source" value="../sgx/Enclave/SGXC++StaticLibLinuxMK/sgx.mk" />
-					<simple name="target" value="sgx/sgx.mk" />
-					<simple name="replaceable" value="true" />
-				</element>
-				<element>
-					<simple name="source" value="../sgx/Enclave/SGXC++StaticLibLinuxMK/Makefile" />
-					<simple name="target" value="sgx/Makefile" />
-					<simple name="replaceable" value="true" />
-				</element>
-			</complex-array>
-		</process>
-	</if>
-	<if condition="$(GenerateEdl)!=true">
-		<process type="org.eclipse.cdt.core.AddFiles">
-			<simple name="projectName" value="$(projectName)" />
-			<complex-array name="files">
-				<element>
-					<simple name="source" value="../source/Basename.cpp" />
-					<simple name="target" value="src/$(baseName).cpp" />
-					<simple name="replaceable" value="true" />
-				</element>
-				<element>
-					<simple name="source" value="../sgx/TrustedLibrary/C++StaticLibLinuxMK/sgx.mk" />
-					<simple name="target" value="sgx/sgx.mk" />
-					<simple name="replaceable" value="true" />
-				</element>
-				<element>
-					<simple name="source" value="../sgx/TrustedLibrary/C++StaticLibLinuxMK/Makefile" />
-					<simple name="target" value="sgx/Makefile" />
-					<simple name="replaceable" value="true" />
-				</element>
-			</complex-array>
-		</process>
-	</if>
-</template>
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--                                                                       -->
+<!-- Copyright (c) 2016 Intel Corporation.				   -->
+<!-- 									   -->
+<!-- All rights reserved. This program and the accompanying materials	   -->
+<!-- are made available under the terms of the Eclipse Public License v1.0 -->
+<!-- which accompanies this distribution, and is available at		   -->
+<!-- http://www.eclipse.org/legal/epl-v10.html				   -->
+<!-- 									   -->
+<!-- Contributors:							   -->
+<!--     Intel Corporation - initial implementation and documentation	   -->
+<!--                                                                       -->
+<template type="ProjTempl" version="1.0" supplier="Intel"
+	revision="1.0" author="Intel" id="%SGX.CXXStatictemplate.title.id" label="%SGX.CXXStatictemplate.title.label"
+	description="%SGX.CXXStatictemplate.title.description" help="help.html">
+	<property-group id="enclaveSettings" label="%SGX.CXXStatictemplate.enclaveSettings.label"
+		description="%SGX.CXXStatictemplate.enclaveSettings.description" type="PAGES-ONLY"
+		help="help.html" branding-icon="SGX.gif">
+		<property id="GenerateEdl" label="%SGX.CXXStatictemplate.requiresEdl.label"
+			description="%SGX.CXXStatictemplate.requiresEdl.description"
+			type="boolean" default="false" pattern="" hidden="false" mandatory="false"
+			persist="false"> 
+		</property>
+	</property-group>
+	<process type="org.eclipse.cdt.managedbuilder.core.NewManagedProject">
+		<simple name="name" value="$(projectName)" />
+		<simple name="location" value="$(location)" />
+		<simple name="artifactExtension" value="exe" />
+		<simple name="isCProject" value="true" />
+	</process>
+	<process type="org.eclipse.cdt.core.CreateSourceFolder">
+		<simple name="projectName" value="$(projectName)" />
+		<simple name="path" value="src" />
+	</process>
+	<if condition="$(GenerateEdl)!=false">
+		<process type="org.eclipse.cdt.core.AddFiles">
+			<simple name="projectName" value="$(projectName)" />
+			<complex-array name="files">
+				<element>
+					<simple name="source" value="../source/Basename.edl" />
+					<simple name="target" value="src/$(baseName).edl" />
+					<simple name="replaceable" value="true" />
+				</element>
+				<element>
+					<simple name="source" value="../include/Basename_t.h" />
+					<simple name="target" value="sgx/$(baseName)/$(baseName)_t.h" />
+					<simple name="replaceable" value="true" />
+				</element>
+			</complex-array>
+		</process>
+	</if>
+	<process type="com.intel.sgx.SetStaticCCNature">
+		<simple name="projectName" value="$(projectName)" />
+	</process>	
+	<if condition="$(GenerateEdl)!=false">
+		<process type="org.eclipse.cdt.core.AddFiles">
+			<simple name="projectName" value="$(projectName)" />
+			<complex-array name="files">
+				<element>
+					<simple name="source" value="../source/Basename.edl" />
+					<simple name="target" value="src/$(baseName).edl" />
+					<simple name="replaceable" value="true" />
+				</element>
+				<element>
+					<simple name="source" value="../source/Basename.cpp" />
+					<simple name="target" value="src/$(baseName).cpp" />
+					<simple name="replaceable" value="true" />
+				</element>
+				<element>
+					<simple name="source" value="../include/Basename_t.h" />
+					<simple name="target" value="sgx/$(baseName)_trusted_stubs/$(baseName)_t.h" />
+					<simple name="replaceable" value="true" />
+				</element>
+				<element>
+					<simple name="source" value="../sgx/Enclave/SGXC++StaticLibLinuxMK/sgx.mk" />
+					<simple name="target" value="sgx/sgx.mk" />
+					<simple name="replaceable" value="true" />
+				</element>
+				<element>
+					<simple name="source" value="../sgx/Enclave/SGXC++StaticLibLinuxMK/Makefile" />
+					<simple name="target" value="sgx/Makefile" />
+					<simple name="replaceable" value="true" />
+				</element>
+			</complex-array>
+		</process>
+	</if>
+	<if condition="$(GenerateEdl)!=true">
+		<process type="org.eclipse.cdt.core.AddFiles">
+			<simple name="projectName" value="$(projectName)" />
+			<complex-array name="files">
+				<element>
+					<simple name="source" value="../source/Basename.cpp" />
+					<simple name="target" value="src/$(baseName).cpp" />
+					<simple name="replaceable" value="true" />
+				</element>
+				<element>
+					<simple name="source" value="../sgx/TrustedLibrary/C++StaticLibLinuxMK/sgx.mk" />
+					<simple name="target" value="sgx/sgx.mk" />
+					<simple name="replaceable" value="true" />
+				</element>
+				<element>
+					<simple name="source" value="../sgx/TrustedLibrary/C++StaticLibLinuxMK/Makefile" />
+					<simple name="target" value="sgx/Makefile" />
+					<simple name="replaceable" value="true" />
+				</element>
+			</complex-array>
+		</process>
+	</if>
+</template>

+ 44 - 44
Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/SGXtemplates/cxxtemplate.xml

@@ -1,44 +1,44 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--                                                                       -->
-<!-- Copyright (c) 2016 Intel Corporation.				   -->
-<!-- 									   -->
-<!-- All rights reserved. This program and the accompanying materials	   -->
-<!-- are made available under the terms of the Eclipse Public License v1.0 -->
-<!-- which accompanies this distribution, and is available at		   -->
-<!-- http://www.eclipse.org/legal/epl-v10.html				   -->
-<!-- 									   -->
-<!-- Contributors:							   -->
-<!--     Intel Corporation - initial implementation and documentation	   -->
-<!--                                                                       -->
-<template type="ProjTempl" version="1.0" supplier="Intel"
-	revision="1.0" author="Intel" id="%SGX.CXXtemplate.title.id" label="%SGX.CXXtemplate.title.label"
-	description="%SGX.CXXtemplate.title.description" help="help.html">
-	<process type="org.eclipse.cdt.managedbuilder.core.NewManagedProject">
-		<simple name="name" value="$(projectName)" />
-		<simple name="location" value="$(location)" />
-		<simple name="artifactExtension" value="exe" />
-		<simple name="isCProject" value="true" />
-	</process>
-	<process type="org.eclipse.cdt.core.CreateSourceFolder">
-		<simple name="projectName" value="$(projectName)" />
-		<simple name="path" value="src" />
-	</process>
-	<process type="org.eclipse.cdt.core.CreateFolder">
-		<simple name="projectName" value="$(projectName)" />
-		<simple name="path" value="resources" />
-	</process>
-	<process type="com.intel.sgx.SetCCNature">
-		<simple name="projectName" value="$(projectName)" />
-	</process>
-		<process type="org.eclipse.cdt.core.AddFiles">
-			<simple name="projectName" value="$(projectName)" />
-			<complex-array name="files">
-             <element>
-                <simple name="source" value="../sgx/SGXNative/Makefile"/>
-                <simple name="target" value="sgx/Makefile" />
-                <simple name="replaceable" value="true" />
-            </element>
-
-			</complex-array>
-		</process>
-</template>
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--                                                                       -->
+<!-- Copyright (c) 2016 Intel Corporation.				   -->
+<!-- 									   -->
+<!-- All rights reserved. This program and the accompanying materials	   -->
+<!-- are made available under the terms of the Eclipse Public License v1.0 -->
+<!-- which accompanies this distribution, and is available at		   -->
+<!-- http://www.eclipse.org/legal/epl-v10.html				   -->
+<!-- 									   -->
+<!-- Contributors:							   -->
+<!--     Intel Corporation - initial implementation and documentation	   -->
+<!--                                                                       -->
+<template type="ProjTempl" version="1.0" supplier="Intel"
+	revision="1.0" author="Intel" id="%SGX.CXXtemplate.title.id" label="%SGX.CXXtemplate.title.label"
+	description="%SGX.CXXtemplate.title.description" help="help.html">
+	<process type="org.eclipse.cdt.managedbuilder.core.NewManagedProject">
+		<simple name="name" value="$(projectName)" />
+		<simple name="location" value="$(location)" />
+		<simple name="artifactExtension" value="exe" />
+		<simple name="isCProject" value="true" />
+	</process>
+	<process type="org.eclipse.cdt.core.CreateSourceFolder">
+		<simple name="projectName" value="$(projectName)" />
+		<simple name="path" value="src" />
+	</process>
+	<process type="org.eclipse.cdt.core.CreateFolder">
+		<simple name="projectName" value="$(projectName)" />
+		<simple name="path" value="resources" />
+	</process>
+	<process type="com.intel.sgx.SetCCNature">
+		<simple name="projectName" value="$(projectName)" />
+	</process>
+		<process type="org.eclipse.cdt.core.AddFiles">
+			<simple name="projectName" value="$(projectName)" />
+			<complex-array name="files">
+             <element>
+                <simple name="source" value="../sgx/SGXNative/Makefile"/>
+                <simple name="target" value="sgx/Makefile" />
+                <simple name="replaceable" value="true" />
+            </element>
+
+			</complex-array>
+		</process>
+</template>

+ 9 - 9
Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/resources/Basename.config.xml

@@ -1,9 +1,9 @@
-<EnclaveConfiguration>
-  <ProdID>$(ProdID)</ProdID>
-  <ISVSVN>$(IsvSvn)</ISVSVN>
-  <StackMaxSize>$(ThreadStackSize)</StackMaxSize>
-  <HeapMaxSize>$(GlobalHeapSize)</HeapMaxSize>
-  <TCSNum>$(TcsNumber)</TCSNum>
-  <TCSPolicy>$(TcsPolicy)</TCSPolicy>
-  <DisableDebug>$(DisableDebug)</DisableDebug>
-</EnclaveConfiguration>
+<EnclaveConfiguration>
+  <ProdID>$(ProdID)</ProdID>
+  <ISVSVN>$(IsvSvn)</ISVSVN>
+  <StackMaxSize>$(ThreadStackSize)</StackMaxSize>
+  <HeapMaxSize>$(GlobalHeapSize)</HeapMaxSize>
+  <TCSNum>$(TcsNumber)</TCSNum>
+  <TCSPolicy>$(TcsPolicy)</TCSPolicy>
+  <DisableDebug>$(DisableDebug)</DisableDebug>
+</EnclaveConfiguration>

+ 23 - 23
Linux_SGXEclipsePlugin/build_directory/sites/site.xml

@@ -1,23 +1,23 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--                                                                       -->
-<!-- Copyright (c) 2016 Intel Corporation.				   -->
-<!-- 									   -->
-<!-- All rights reserved. This program and the accompanying materials	   -->
-<!-- are made available under the terms of the Eclipse Public License v1.0 -->
-<!-- which accompanies this distribution, and is available at		   -->
-<!-- http://www.eclipse.org/legal/epl-v10.html				   -->
-<!-- 									   -->
-<!-- Contributors:							   -->
-<!--     Intel Corporation - initial implementation and documentation	   -->
-<!--                                                                       -->
-<site>
-   <description name="Intel(R) Software Guard Extensions Plug-in" url="http://fso-dev-machine.rd.intel.com/sgx">
-      This website hosts an evaluation version of the Eclipse Plug-in developed for Secure Guard Extensions Application development for Linux platforms.
-   </description>
-   <feature url="features/com.intel.sgx.feature_1.0.1.qualifier.jar" id="com.intel.sgx.feature" version="1.0.1.qualifier">
-      <category name="com.intel.security.sgx"/>
-   </feature>
-   <category-def name="com.intel.security.sgx" label="Intel(R) SGX Eclipse Plugin">
-      <description>Intel(R) SGX Eclipse Plugin 1.0.1.qualifier</description>
-   </category-def>
-</site>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--                                                                       -->
+<!-- Copyright (c) 2016 Intel Corporation.				   -->
+<!-- 									   -->
+<!-- All rights reserved. This program and the accompanying materials	   -->
+<!-- are made available under the terms of the Eclipse Public License v1.0 -->
+<!-- which accompanies this distribution, and is available at		   -->
+<!-- http://www.eclipse.org/legal/epl-v10.html				   -->
+<!-- 									   -->
+<!-- Contributors:							   -->
+<!--     Intel Corporation - initial implementation and documentation	   -->
+<!--                                                                       -->
+<site>
+   <description name="Intel(R) Software Guard Extensions Plug-in" url="http://fso-dev-machine.rd.intel.com/sgx">
+      This website hosts an evaluation version of the Eclipse Plug-in developed for Secure Guard Extensions Application development for Linux platforms.
+   </description>
+   <feature url="features/com.intel.sgx.feature_1.0.1.qualifier.jar" id="com.intel.sgx.feature" version="1.0.1.qualifier">
+      <category name="com.intel.security.sgx"/>
+   </feature>
+   <category-def name="com.intel.security.sgx" label="Intel(R) SGX Eclipse Plugin">
+      <description>Intel(R) SGX Eclipse Plugin 1.0.1.qualifier</description>
+   </category-def>
+</site>

+ 22 - 22
Linux_SGXEclipsePlugin/readme.txt

@@ -1,22 +1,22 @@
-The eclipse plugin build from command line requires the following variables to be set.
-
-$ECLIPSE_HOME - Path to eclipse home. In order to build the plugin eclipse needs to be installed.
-$RELEASE_ID - The release id for the plugin. The release id should be changed for each source codes updates.
-$DELETE_CURRENT_ECLIPSE - Delete current eclipse or not. Generally this variable is set to false.
-
-The following plugins are pre-requisites to be installed in Eclipse before trying to build the plugin.
-
-1. Eclipse IDE for C/C++ Developers  4.5.1.20150917-1200 (tested_version)
-2. Eclipse PDE Plug-in Developer Resources   3.11.1.v20150904-0345 (tested_version)
-
-run ./build.sh from command line under current directory.
-Once the build script is run, the folder build_directory/updatesite/sgx-eclipse-plugin contains the update site. This is the path that needs to be provided to the eclipse while doing installation.
-
-If the Intel(R) Software Guard Extensions (Intel(R) SGX) eclipse plugin is already installed to eclipse and to build and install a newer version, uninstall the old version and start eclipse with the -clean option.
-Then try to build the new version of the plugin and install it in eclipse.
-
-http://wiki.eclipse.org/FAQ_How_do_I_remove_a_plug-in%3F
-
-The plugin has been tested with the following Eclipse ADT version
-
-Build: v22.3.0-887826
+The eclipse plugin build from command line requires the following variables to be set.
+
+$ECLIPSE_HOME - Path to eclipse home. In order to build the plugin eclipse needs to be installed.
+$RELEASE_ID - The release id for the plugin. The release id should be changed for each source codes updates.
+$DELETE_CURRENT_ECLIPSE - Delete current eclipse or not. Generally this variable is set to false.
+
+The following plugins are pre-requisites to be installed in Eclipse before trying to build the plugin.
+
+1. Eclipse IDE for C/C++ Developers  4.5.1.20150917-1200 (tested_version)
+2. Eclipse PDE Plug-in Developer Resources   3.11.1.v20150904-0345 (tested_version)
+
+run ./build.sh from command line under current directory.
+Once the build script is run, the folder build_directory/updatesite/sgx-eclipse-plugin contains the update site. This is the path that needs to be provided to the eclipse while doing installation.
+
+If the Intel(R) Software Guard Extensions (Intel(R) SGX) eclipse plugin is already installed to eclipse and to build and install a newer version, uninstall the old version and start eclipse with the -clean option.
+Then try to build the new version of the plugin and install it in eclipse.
+
+http://wiki.eclipse.org/FAQ_How_do_I_remove_a_plug-in%3F
+
+The plugin has been tested with the following Eclipse ADT version
+
+Build: v22.3.0-887826

+ 17 - 21
README.md

@@ -11,8 +11,6 @@ The Linux\* Intel(R) SGX software stack is comprised of the Intel(R) SGX driver,
 
 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](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](License.txt) for details.
@@ -35,7 +33,7 @@ Build the Intel(R) SGX SDK and Intel(R) SGX PSW Package
 ### Prerequisites:
 - Ensure that you have one of the following required operating systems:  
   * Ubuntu\* Desktop-16.04-LTS 64bits
-  * Red Hat Enterprise Linux Server release 7.3 64bits
+  * Red Hat Enterprise Linux Server release 7.4 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 +41,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.3 and CentOS 7.3:
+  * On Red Hat Enterprise Linux 7.4 and CentOS 7.3:
   ```
     $ sudo yum groupinstall 'Development Tools'
     $ sudo yum install ocaml wget python
@@ -53,9 +51,9 @@ 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.3 and CentOS 7.3:
+  * On Red Hat Enterprise Linux 7.4 and CentOS 7.3:
   ```
-    $ sudo yum install openssl-devel libcurl-devel protobuf-compiler protobuf-devel
+    $ sudo yum install openssl-devel libcurl-devel protobuf-devel
   ```
 - Use the script ``download_prebuilt.sh`` inside source code package to download prebuilt binaries to prebuilt folder  
   You may need set an https proxy for the `wget` tool used by the script (such as ``export https_proxy=http://test-proxy:test-port``)  
@@ -72,11 +70,14 @@ The following steps describe how to build the Intel(R) SGX SDK and PSW. You can
   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(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:
+- This repository supports to build the Intel(R) SGX SDK based on either precompiled optimized IPP/string/math libraries or open sourced version of SGXSSL/string/math libraries. 
+  The default build uses precompiled optimized libraries, which are downloaded by the script ``./download_prebuilt.sh``.
+  You can also use the open sourced version implementation instead by entering the following command:
 ```
   $ make USE_OPT_LIBS=0
 ```
+  **Note**: Building the Intel(R) SGX PSW with open sourced SGXSSL/string/math libraries is not supported. The above command builds Intel(R) SGX SDK only and the build of PSW part will be skipped.
+
 - To build Intel(R) SGX SDK and PSW with debug information, enter the following command:  
 ```
   $ make DEBUG=1
@@ -123,14 +124,14 @@ 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.3 64bits
+  * Red Hat Enterprise Linux Server release 7.4 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.3 and CentOS 7.3:
+  * On Red Hat Enterprise Linux 7.4 and CentOS 7.3:
   ```
      $ sudo yum groupinstall 'Development Tools'
      $ sudo yum install python 
@@ -142,10 +143,6 @@ To install the Intel(R) SGX SDK, invoke the installer, as follows:
 $ cd linux/installer/bin
 $ ./sgx_linux_x64_sdk_${version}.bin 
 ```
-NOTE: You need to set up the needed environment variables before compiling your code. To do so, run:
-```
-   $ source ${sgx-sdk-install-path}/environment
-```
 ### 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:    
 ```
@@ -154,13 +151,12 @@ NOTE: You need to set up the needed environment variables before compiling your
   $ ./app
 ```
    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 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:  
+- Compile and run each code sample in Hardware mode, Debug build, as follows:  
 ```
   $ cd SampleCode/LocalAttestation
   $ make
@@ -169,11 +165,11 @@ See the later topic, *Install Intel(R) SGX PSW*, for information on how to insta
    Use similar commands for other code samples.
 
 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.3 64bits
+  * Red Hat Enterprise Linux Server release 7.4 64bits
   * CentOS 7.3.1611 64bits
 - Ensure that you have a system with the following required hardware:  
   * 6th Generation Intel(R) Core(TM) Processor or newer
@@ -184,7 +180,7 @@ Install the Intel(R) SGX PSW
   ```
     $ sudo apt-get install libssl-dev libcurl4-openssl-dev libprotobuf-dev
   ```
-  * On Red Hat Enterprise Linux 7.3 and CentOS 7.3:  
+  * On Red Hat Enterprise Linux 7.4 and CentOS 7.3:  
   ```
     $ sudo yum install openssl-devel libcurl-devel protobuf-devel
   ```
@@ -197,7 +193,7 @@ Install the 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.3 and CentOS 7.3:  
+  * On Red Hat Enterprise Linux 7.4 and CentOS 7.3:  
   ```
     $ sudo yum install iclsClient-1.45.449.12-1.x86_64.rpm
   ```
@@ -207,7 +203,7 @@ Install the 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.3 and CentOS 7.3:  
+  * On Red Hat Enterprise Linux 7.4 and CentOS 7.3:  
   ```
     $ sudo yum install libuuid-devel libxml2-devel cmake pkgconfig
     $ cmake .;make;sudo make install;sudo ldconfig;sudo systemctl enable jhi

+ 1 - 1
SampleCode/Cxx11SGXDemo/Enclave/Enclave.edl

@@ -41,7 +41,7 @@ enclave {
      */
       
     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;
+    from "sgx_tstdc.edl" import *;
 
     /* 
      * ocall_print_string - invokes OCALL to display string buffer inside the enclave.

+ 3 - 3
SampleCode/Cxx11SGXDemo/Enclave/TrustedLibrary/Libcxx.cpp

@@ -330,7 +330,7 @@ void ecall_cxx11_algorithms_demo()
     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("[cxx11_algorithms] None elements in  { 0 1 2 3 4 5 } are even is  %s. \n", are_none_of ? "true" : "false");
 
     printf("\n"); // end of demo
 }
@@ -594,10 +594,10 @@ void ecall_new_container_classes_demo()
     const int searchVal = 3;
     std::unordered_set<int>::const_iterator got = set_of_numbers.find(searchVal);
 
-    if (got == set_of_numbers.end())
+    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");
+        printf("[new_container_classes] unordered_set { 0, 1, 2, 3, 4, 5} does not have value 3.\n");
 
     // unordered_multiset
     // container used for fast acces that groups non unique elements in buckets based on their hash

+ 3 - 5
SampleCode/Cxx11SGXDemo/README.txt

@@ -26,9 +26,7 @@ The project demonstrates serveral C++11 features inside the Enclave:
 How to Build/Execute the C++11 sample program
 ---------------------------------------------
 1. Install Intel(R) Software Guard Extensions (Intel(R) SGX) SDK for Linux* OS
-2. Make sure your environment is set:
-    $ source ${sgx-sdk-install-path}/environment
-3. Build the project with the prepared Makefile:
+2. Build the project with the prepared Makefile:
     a. Hardware Mode, Debug build:
         $ make
     b. Hardware Mode, Pre-release build:
@@ -41,6 +39,6 @@ How to Build/Execute the C++11 sample program
         $ make SGX_MODE=SIM SGX_PRERELEASE=1 SGX_DEBUG=0
     f. Simulation Mode, Release build:
         $ make SGX_MODE=SIM SGX_DEBUG=0
-4. Execute the binary directly:
+3. Execute the binary directly:
     $ ./app
-5. Remember to "make clean" before switching build mode
+4. Remember to "make clean" before switching build mode

+ 3 - 5
SampleCode/LocalAttestation/README.txt

@@ -9,9 +9,7 @@ The project demonstrates:
 How to Build/Execute the Sample Code
 ------------------------------------
 1. Install Intel(R) Software Guard Extensions (Intel(R) SGX) SDK for Linux* OS
-2. Make sure your environment is set:
-    $ source ${sgx-sdk-install-path}/environment
-3. Build the project with the prepared Makefile:
+2. Build the project with the prepared Makefile:
     a. Hardware Mode, Debug build:
         $ make
     b. Hardware Mode, Pre-release build:
@@ -24,6 +22,6 @@ How to Build/Execute the Sample Code
         $ make SGX_MODE=SIM SGX_PRERELEASE=1 SGX_DEBUG=0
     f. Simulation Mode, Release build:
         $ make SGX_MODE=SIM SGX_DEBUG=0
-4. Execute the binary directly:
+3. Execute the binary directly:
     $ ./app
-5. Remember to "make clean" before switching build mode
+4. Remember to "make clean" before switching build mode

+ 1 - 1
SampleCode/PowerTransition/Makefile

@@ -90,7 +90,7 @@ else
         App_Compile_CFlags += -DNDEBUG -UEDEBUG -UDEBUG
 endif
 
-App_Compile_CXXFlags := -std=c++0x $(App_Compile_CFlags)
+App_Compile_CXXFlags := -std=c++11 $(App_Compile_CFlags)
 App_Link_Flags := -L$(SGX_LIBRARY_PATH) -l$(Urts_Library_Name) -lpthread
 
 ifneq ($(SGX_MODE), HW)

+ 3 - 5
SampleCode/PowerTransition/README.txt

@@ -8,9 +8,7 @@ Software Guard Extensions projects development.
 How to Build/Execute the Sample Code
 ------------------------------------
 1. Install Intel(R) Software Guard Extensions (Intel(R) SGX) SDK for Linux* OS
-2. Make sure your environment is set:
-    $ source ${sgx-sdk-install-path}/environment
-3. Build the project with the prepared Makefile:
+2. Build the project with the prepared Makefile:
     a. Hardware Mode, Debug build:
         $ make
     b. Hardware Mode, Pre-release build:
@@ -23,6 +21,6 @@ How to Build/Execute the Sample Code
         $ make SGX_MODE=SIM SGX_PRERELEASE=1 SGX_DEBUG=0
     f. Simulation Mode, Release build:
         $ make SGX_MODE=SIM SGX_DEBUG=0
-4. Execute the binary directly:
+3. Execute the binary directly:
     $ ./app
-5. Remember to "make clean" before switching build mode
+4. Remember to "make clean" before switching build mode

+ 3 - 5
SampleCode/RemoteAttestation/README.txt

@@ -9,9 +9,7 @@ The project demonstrates:
 How to Build/Execute the Sample Code
 ------------------------------------
 1. Install Intel(R) Software Guard Extensions (Intel(R) SGX) SDK for Linux* OS
-2. Make sure your environment is set:
-    $ source ${sgx-sdk-install-path}/environment
-3. Build the project with the prepared Makefile:
+2. Build the project with the prepared Makefile:
     a. Hardware Mode, Debug build:
         $ make
     b. Hardware Mode, Pre-release build:
@@ -24,6 +22,6 @@ How to Build/Execute the Sample Code
         $ make SGX_MODE=SIM SGX_PRERELEASE=1 SGX_DEBUG=0
     f. Simulation Mode, Release build:
         $ make SGX_MODE=SIM SGX_DEBUG=0
-4. Execute the binary directly:
+3. Execute the binary directly:
     $ ./app
-5. Remember to "make clean" before switching build mode
+4. Remember to "make clean" before switching build mode

+ 1 - 1
SampleCode/SampleEnclave/App/App.cpp

@@ -146,7 +146,7 @@ void print_error_message(sgx_status_t ret)
     }
     
     if (idx == ttl)
-        printf("Error: Unexpected error occurred.\n");
+    	printf("Error code is 0x%X. Please refer to the \"Intel SGX SDK Developer Reference\" for more details.\n", ret);
 }
 
 /* Initialize the enclave:

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

@@ -44,7 +44,7 @@ void ecall_libc_functions(void)
     if (ret != SGX_SUCCESS)
         abort();
     
-    int cpuid[4] = {0x1, 0x0, 0x0, 0x0};
+    int cpuid[4] = {0x0, 0x0, 0x0, 0x0};
     ret = ecall_sgx_cpuid(global_eid, cpuid, 0x0);
     if (ret != SGX_SUCCESS)
         abort();

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

@@ -50,6 +50,6 @@ enclave {
         /*
          * Utilize SGX version __cpuid() in enclave.
          */
-        public void ecall_sgx_cpuid([in, out] int cpuinfo[4], int leaf);
+        public void ecall_sgx_cpuid([out] int cpuinfo[4], int leaf);
     };
 };

+ 28 - 0
SampleCode/SampleEnclave/Enclave/config.01.xml

@@ -0,0 +1,28 @@
+<EnclaveConfiguration>
+  <ProdID>0</ProdID>
+  <ISVSVN>0</ISVSVN>
+
+  <!-- If TCSMaxNum == TCSNum == TCSMinPool, there is no dynamic thread -->
+  <!-- If TCSMaxNum is omitted, it defaults to TCSNum -->
+  <!-- According to this setting, there are 10 static threads available -->
+  <TCSMaxNum>10</TCSMaxNum>
+  <TCSNum>10</TCSNum>
+  <TCSMinPool>10</TCSMinPool>
+
+  <TCSPolicy>1</TCSPolicy>
+
+  <!-- Since there's no dynamic thread, only StackMaxSize is relevant here -->
+  <StackMaxSize>0x40000</StackMaxSize>
+
+  <!-- When there's no gap between HeapMinSize and HeapInitSize, or between
+       HeapInitSize and HeapMaxSize, no dynamic heap expansion will occur. -->
+  <!-- In this case, the total available heap is 1 MB-->
+  <HeapMaxSize>0x100000</HeapMaxSize>
+  <HeapInitSize>0x100000</HeapInitSize>
+  <HeapMinSize>0x100000</HeapMinSize>
+
+  <!-- Recommend changing 'DisableDebug' to 1 to make the enclave undebuggable for enclave release -->
+  <DisableDebug>0</DisableDebug>
+  <MiscSelect>0</MiscSelect>
+  <MiscMask>0xFFFFFFFF</MiscMask>
+</EnclaveConfiguration>

+ 25 - 0
SampleCode/SampleEnclave/Enclave/config.02.xml

@@ -0,0 +1,25 @@
+<EnclaveConfiguration>
+  <ProdID>0</ProdID>
+  <ISVSVN>0</ISVSVN>
+  <StackMaxSize>0x40000</StackMaxSize>
+
+  <!-- On a system with SGX EDMM, the amount of available heap once the enclave
+       is initialized is HeapMinSize (0x1000 bytes). The gap between HeapMinSize
+       and HeapMaxSize will be expanded as necessary.
+ 
+       On a system without SGX EDMM, the amount of available heap once the enclave
+       is initialized is HeapInitSize (0x40000 bytes), and there is no heap expansion.
+   -->
+  <HeapMaxSize>0x100000</HeapMaxSize>
+  <HeapInitSize>0x40000</HeapInitSize>
+  <HeapMinSize>0x1000</HeapMinSize>
+
+  <TCSMaxNum>10</TCSMaxNum>
+  <TCSNum>10</TCSNum>
+  <TCSMinPool>10</TCSMinPool>
+  <TCSPolicy>1</TCSPolicy>
+  <!-- Recommend changing 'DisableDebug' to 1 to make the enclave undebuggable for enclave release -->
+  <DisableDebug>0</DisableDebug>
+  <MiscSelect>0</MiscSelect>
+  <MiscMask>0xFFFFFFFF</MiscMask>
+</EnclaveConfiguration>

+ 27 - 0
SampleCode/SampleEnclave/Enclave/config.03.xml

@@ -0,0 +1,27 @@
+<EnclaveConfiguration>
+  <ProdID>0</ProdID>
+  <ISVSVN>0</ISVSVN>
+
+  <!--In this case, there will be 3 static threads available and up to 7 threads
+      can be created dynamically as necessary.
+  -->
+  <TCSNum>10</TCSNum>
+  <TCSMinPool>3</TCSMinPool>
+  <TCSPolicy>1</TCSPolicy>
+
+  <!-- For a static thread, total stack available is 0x40000 bytes. -->
+  <!-- For a dynamic thread, once it is created, total stack available is
+       0x40000 bytes and no stack expansion will occur.
+  -->
+  <StackMaxSize>0x40000</StackMaxSize>
+  <StackMinSize>0x40000</StackMinSize>
+
+  <!-- HeapMinSize is omitted, defaults to 0x1000 -->
+  <!-- HeapInitSize is omitted, defaults to HeapMaxSize -->
+  <HeapMaxSize>0x100000</HeapMaxSize>
+
+  <!-- Recommend changing 'DisableDebug' to 1 to make the enclave undebuggable for enclave release -->
+  <DisableDebug>0</DisableDebug>
+  <MiscSelect>0</MiscSelect>
+  <MiscMask>0xFFFFFFFF</MiscMask>
+</EnclaveConfiguration>

+ 23 - 0
SampleCode/SampleEnclave/Enclave/config.04.xml

@@ -0,0 +1,23 @@
+<EnclaveConfiguration>
+  <ProdID>0</ProdID>
+  <ISVSVN>0</ISVSVN>
+
+  <TCSNum>10</TCSNum>
+  <TCSMinPool>3</TCSMinPool>
+  <TCSPolicy>1</TCSPolicy>
+
+  <!-- For a static thread, total available stack is 0x40000 -->
+  <!-- For a dynamic thread, once it is creted, available stack is
+       0x2000, the gap, that is 0x40000 - 0x2000, can be dynamically
+       expanded as necessary.
+  -->
+  <StackMaxSize>0x40000</StackMaxSize>
+  <StackMinSize>0x2000</StackMinSize>
+
+  <HeapMaxSize>0x100000</HeapMaxSize>
+
+  <!-- Recommend changing 'DisableDebug' to 1 to make the enclave undebuggable for enclave release -->
+  <DisableDebug>0</DisableDebug>
+  <MiscSelect>0</MiscSelect>
+  <MiscMask>0xFFFFFFFF</MiscMask>
+</EnclaveConfiguration>

+ 40 - 5
SampleCode/SampleEnclave/README.txt

@@ -11,9 +11,7 @@ Extensions (Intel(R) SGX) SDK:
 How to Build/Execute the Sample Code
 ------------------------------------
 1. Install Intel(R) SGX SDK for Linux* OS
-2. Make sure your environment is set:
-    $ source ${sgx-sdk-install-path}/environment
-3. Build the project with the prepared Makefile:
+2. Build the project with the prepared Makefile:
     a. Hardware Mode, Debug build:
         $ make
     b. Hardware Mode, Pre-release build:
@@ -26,7 +24,44 @@ How to Build/Execute the Sample Code
         $ make SGX_MODE=SIM SGX_PRERELEASE=1 SGX_DEBUG=0
     f. Simulation Mode, Release build:
         $ make SGX_MODE=SIM SGX_DEBUG=0
-4. Execute the binary directly:
+3. Execute the binary directly:
     $ ./app
-5. Remember to "make clean" before switching build mode
+4. Remember to "make clean" before switching build mode
 
+------------------------------------------
+Explanation about Configuration Parameters
+------------------------------------------
+TCSMaxNum, TCSNum, TCSMinPool
+
+    These three parameters will determine whether a thread will be created
+    dynamically  when there is no available thread to do the work.
+
+
+StackMaxSize, StackMinSize
+
+    For a dynamically created thread, StackMinSize is the amount of stack available
+    once the thread is created and StackMaxSize is the total amount of stack that
+    thread can use. The gap between StackMinSize and StackMaxSize is the stack
+    dynamically expanded as necessary at runtime.
+
+    For a static thread, only StackMaxSize is relevant which specifies the total
+    amount of stack available to the thread.
+
+
+HeapMaxSize, HeapInitSize, HeapMinSize
+
+    HeapMinSize is the amount of heap available once the enclave is initialized.
+
+    HeapMaxSize is the total amount of heap an enclave can use. The gap between
+    HeapMinSize and HeapMaxSize is the heap dynamically expanded as necessary
+    at runtime.
+
+    HeapInitSize is here for compatibility.
+
+-------------------------------------------------    
+Sample configuration files for the Sample Enclave
+-------------------------------------------------
+config.01.xml: There is no dynamic thread, no dynamic heap expansion.
+config.02.xml: There is no dynamic thread. But dynamic heap expansion can happen.
+config.03.xml: There are dynamic threads. For a dynamic thread, there's no stack expansion.
+config.04.xml: There are dynamic threads. For a dynamic thread, stack will expanded as necessary.

+ 4 - 4
SampleCode/SealedData/DRM_enclave/DRM_enclave.cpp

@@ -114,11 +114,11 @@ static uint32_t verify_sealed_data(
             break;
         case SGX_ERROR_INVALID_ISVSVN:
             /* Indicates isv_svn field of the sealed data is greater than
-            the enclaves ISVSVN. This is a downgraded enclave.*/
+            the enclave's ISVSVN. This is a downgraded enclave.*/
             break;
         case SGX_ERROR_INVALID_CPUSVN:
             /* Indicates cpu_svn field of the sealed data is greater than
-            the platforms cpu_svn. enclave is  on a downgraded platform.*/
+            the platform's cpu_svn. enclave is  on a downgraded platform.*/
             break;
         case SGX_ERROR_INVALID_KEYNAME:
             /*Indicates key_name field of the sealed data is incorrect.*/
@@ -504,11 +504,11 @@ uint32_t perform_time_based_policy(const uint8_t* sealed_log,
             break;
         case SGX_ERROR_INVALID_ISVSVN:
             /* Indicates isv_svn field of the sealed data is greater than the
-            enclaves ISVSVN. This is a downgraded enclave.*/
+            enclave's ISVSVN. This is a downgraded enclave.*/
             break;
         case SGX_ERROR_INVALID_CPUSVN:
             /* Indicates cpu_svn field of the sealed data is greater than the
-            platforms cpu_svn. enclave is  on a downgraded platform.*/
+            platform's cpu_svn. enclave is  on a downgraded platform.*/
             break;
         case SGX_ERROR_INVALID_KEYNAME:
             /*Indicates key_name field of the sealed data is incorrect.*/

+ 3 - 5
SampleCode/SealedData/README.txt

@@ -11,9 +11,7 @@ replay-protected policy, and Trusted Time to enforce time based policy
 How to Build/Execute the Sample Code
 ------------------------------------
 1. Install Intel(R) Software Guard Extensions (Intel(R) SGX) SDK for Linux* OS
-2. Make sure your environment is set:
-    $ source ${sgx-sdk-install-path}/environment
-3. Build the project with the prepared Makefile:
+2. Build the project with the prepared Makefile:
     a. Hardware Mode, Debug build:
         $ make
     b. Hardware Mode, Pre-release build:
@@ -26,6 +24,6 @@ How to Build/Execute the Sample Code
         $ make SGX_MODE=SIM SGX_PRERELEASE=1 SGX_DEBUG=0
     f. Simulation Mode, Release build:
         $ make SGX_MODE=SIM SGX_DEBUG=0
-4. Execute the binary directly:
+3. Execute the binary directly:
     $ ./app
-5. Remember to "make clean" before switching build mode
+4. Remember to "make clean" before switching build mode

+ 13 - 17
buildenv.mk

@@ -75,10 +75,10 @@ else
 endif
 
 ifdef DEBUG
-    COMMON_FLAGS += -ggdb -DDEBUG -UNDEBUG
+    COMMON_FLAGS += -O0 -ggdb -DDEBUG -UNDEBUG
     COMMON_FLAGS += -DSE_DEBUG_LEVEL=SE_TRACE_DEBUG
 else
-    COMMON_FLAGS += -O2   -UDEBUG -DNDEBUG
+    COMMON_FLAGS += -O2 -D_FORTIFY_SOURCE=2 -UDEBUG -DNDEBUG
 endif
 
 ifdef SE_SIM
@@ -99,8 +99,7 @@ CFLAGS += -Wjump-misses-init -Wstrict-prototypes -Wunsuffixed-float-constants
 # additional warnings flags for C++
 CXXFLAGS += -Wnon-virtual-dtor
 
-# for static_assert()
-CXXFLAGS += -std=c++0x
+CXXFLAGS += -std=c++11
 
 .DEFAULT_GOAL := all
 # this turns off the RCS / SCCS implicit rules of GNU Make
@@ -148,6 +147,9 @@ endif
 CFLAGS   += $(COMMON_FLAGS)
 CXXFLAGS += $(COMMON_FLAGS)
 
+# Enable the security flags
+COMMON_LDFLAGS := -Wl,-z,relro,-z,now,-z,noexecstack
+
 # Compiler and linker options for an Enclave
 #
 # We are using '--export-dynamic' so that `g_global_data_sim' etc.
@@ -158,31 +160,25 @@ CXXFLAGS += $(COMMON_FLAGS)
 # as `global' in the LD version script.
 ENCLAVE_CFLAGS   = -ffreestanding -nostdinc -fvisibility=hidden -fpie
 ENCLAVE_CXXFLAGS = $(ENCLAVE_CFLAGS) -nostdinc++
-ENCLAVE_LDFLAGS  = -Wl,-Bstatic -Wl,-Bsymbolic -Wl,--no-undefined \
+ENCLAVE_LDFLAGS  = $(COMMON_LDFLAGS) -Wl,-Bstatic -Wl,-Bsymbolic -Wl,--no-undefined \
                    -Wl,-pie,-eenclave_entry -Wl,--export-dynamic  \
                    -Wl,--defsym,__ImageBase=0
 
 
 # Choose to use the optimized libraries (IPP/String/Math) by default.
-# Users could also use the non-optimized source code version by
+# Users could also use the source code version (SGXSSL/String/Math) by
 # explicitly specifying 'USE_OPT_LIBS=0'
 USE_OPT_LIBS ?= 1
 
+
 ifeq ($(ARCH), x86_64)
 IPP_SUBDIR = intel64
 else
 IPP_SUBDIR = ia32
 endif
 
-ifneq ($(USE_OPT_LIBS), 0)
-    SGX_IPP_DIR     := $(ROOT_DIR)/external/ippcp_internal
-    SGX_IPP_INC     := $(SGX_IPP_DIR)/inc
-    IPP_LIBS_DIR    := $(SGX_IPP_DIR)/lib/linux/$(IPP_SUBDIR)
-    LD_IPP          := -lippcp -lippcore
-else
-    SGX_IPP_DIR     := $(ROOT_DIR)/external/crypto_px
-    SGX_IPP_INC     := $(SGX_IPP_DIR)/include
-    IPP_LIBS_DIR    := $(SGX_IPP_DIR)
-    LD_IPP          := -lcrypto_px
-endif
+SGX_IPP_DIR     := $(ROOT_DIR)/external/ippcp_internal
+SGX_IPP_INC     := $(SGX_IPP_DIR)/inc
+IPP_LIBS_DIR    := $(SGX_IPP_DIR)/lib/linux/$(IPP_SUBDIR)
+LD_IPP          := -lippcp -lippcore
 

+ 5 - 0
common/inc/internal/arch.h

@@ -158,6 +158,10 @@ typedef uint64_t si_flags_t;
 #define SI_FLAG_SECS                (0x00<<SI_FLAG_PT_LOW_BIT)      /* SECS */
 #define SI_FLAG_TCS                 (0x01<<SI_FLAG_PT_LOW_BIT)      /* TCS */
 #define SI_FLAG_REG                 (0x02<<SI_FLAG_PT_LOW_BIT)      /* Regular Page */
+#define SI_FLAG_TRIM                (0x04<<SI_FLAG_PT_LOW_BIT)      /* Trim Page */
+#define SI_FLAG_PENDING             0x8
+#define SI_FLAG_MODIFIED            0x10
+#define SI_FLAG_PR                  0x20
 
 #define SI_FLAGS_EXTERNAL           (SI_FLAG_PT_MASK | SI_FLAG_R | SI_FLAG_W | SI_FLAG_X)   /* Flags visible/usable by instructions */
 #define SI_FLAGS_R                  (SI_FLAG_R|SI_FLAG_REG)
@@ -189,6 +193,7 @@ typedef struct _page_info_t
 #define SE_KEY_SIZE         384         /* in bytes */
 #define SE_EXPONENT_SIZE    4           /* RSA public key exponent size in bytes */
 
+
 typedef struct _css_header_t {        /* 128 bytes */
     uint8_t  header[12];                /* (0) must be (06000000E100000000000100H) */
     uint32_t type;                      /* (12) bit 31: 0 = prod, 1 = debug; Bit 30-0: Must be zero */

+ 52 - 0
common/inc/internal/crypto_wrapper.h

@@ -0,0 +1,52 @@
+/*
+ * 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 _CRYPTO_WRAPPER_H
+#define _CRYPTO_WRAPPER_H
+
+#include <openssl/evp.h>
+#include "sgx_report.h"
+#include "sgx_error.h"
+
+#ifdef  __cplusplus
+extern "C" {
+#endif
+
+sgx_status_t sgx_EVP_Digest(const EVP_MD *type, const uint8_t *p_src, unsigned int src_len, uint8_t *digest, unsigned int *digest_len);
+sgx_status_t sgx_cmac128_msg(const sgx_key_128bit_t key, const uint8_t *p_src, unsigned int src_len, sgx_mac_t *p_mac);
+
+#ifdef  __cplusplus
+}
+#endif
+
+#endif
+
+

+ 9 - 0
common/inc/internal/enclave_creator.h

@@ -49,6 +49,8 @@
 #include "uncopyable.h"
 #include <string.h>
 #include "file.h"
+#include "isgx_user.h"
+
 
 // this is the interface to both hardware, simulation and signing mode
 class EnclaveCreator : private Uncopyable
@@ -68,12 +70,19 @@ public:
     virtual int destroy_enclave(sgx_enclave_id_t enclave_id, uint64_t enclave_size = 0) = 0;
     virtual int initialize(sgx_enclave_id_t enclave_id) = 0;
     virtual bool use_se_hw() const = 0;
+    virtual bool is_EDMM_supported(sgx_enclave_id_t enclave_id) = 0;
+    virtual bool is_driver_compatible() = 0;
 
     virtual int get_misc_attr(sgx_misc_attribute_t *sgx_misc_attr, metadata_t *metadata, SGXLaunchToken * const lc, uint32_t flag) = 0;
     virtual bool get_plat_cap(sgx_misc_attribute_t *se_attr) = 0;
 #ifdef SE_1P5_VERTICAL
     virtual uint32_t handle_page_fault(uint64_t pf_address) { UNUSED(pf_address); return (uint32_t)SGX_ERROR_UNEXPECTED; }
 #endif
+    virtual int emodpr(uint64_t addr, uint64_t size, uint64_t flag) = 0;
+    virtual int mktcs(uint64_t tcs_addr) = 0;
+    virtual int trim_range(uint64_t fromaddr, uint64_t toaddr) = 0;
+    virtual int trim_accept(uint64_t addr) = 0;
+    virtual int remove_range(uint64_t fromaddr, uint64_t numpages) = 0;
     // destructor
     virtual ~EnclaveCreator() {};
 };

+ 12 - 2
common/inc/internal/global_data.h

@@ -41,15 +41,21 @@
 
 #include "se_types.h"
 #include "thread_data.h"
+#include "metadata.h"
+#include "rts.h"
 
+#define LAYOUT_ENTRY_NUM 38
 typedef struct _global_data_t
 {
     sys_word_t     enclave_size;
     sys_word_t     heap_offset;
     sys_word_t     heap_size;
-    uint32_t       thread_policy;
-    uint32_t       reserved;
+    sys_word_t     thread_policy;
     thread_data_t  td_template;
+    uint8_t        tcs_template[TCS_TEMPLATE_SIZE];
+    uint32_t       layout_entry_num;
+    uint32_t       reserved;
+    layout_t       layout_table[LAYOUT_ENTRY_NUM];
 } global_data_t;
 
 #define ENCLAVE_INIT_NOT_STARTED  0
@@ -62,7 +68,11 @@ extern "C" {
 #endif
 extern SE_DECLSPEC_EXPORT global_data_t const volatile g_global_data;
 extern uint32_t g_enclave_state;
+extern sdk_version_t g_sdk_version;
+extern int EDMM_supported;
 extern uint8_t  __ImageBase;
+extern int g_xsave_enabled;
+
 
 #ifdef __cplusplus
 }

+ 1 - 0
common/inc/internal/global_init.h

@@ -40,6 +40,7 @@ extern "C" {
 #endif
 
 void init_global_object(void);
+void uninit_global_object(void);
 
 #ifdef __cplusplus
 }

+ 1 - 0
common/inc/internal/inst.h

@@ -45,6 +45,7 @@ typedef enum {
     SE_EENTER,
     SE_ERESUME,
     SE_EEXIT,
+    SE_EACCEPT,
     SE_LAST_RING3,
 
     SE_ECREATE = 0x0,

+ 3 - 0
common/inc/internal/linux/linux-regs.h

@@ -85,6 +85,9 @@
 #define SE_EGETKEY    1
 #define SE_EENTER     2
 #define SE_EEXIT      4
+#define SE_EACCEPT    5
+#define SE_EMODPE     6
+
 
 #define SE_ECREATE    0
 #define SE_EADD       1

+ 35 - 13
common/inc/internal/metadata.h

@@ -37,16 +37,22 @@
 #pragma pack(1)
 
  /* version of metadata */
-#define MAJOR_VERSION 1         /* MAJOR_VERSION should not larger than 0ffffffff */
-#define MINOR_VERSION 4         /* MINOR_VERSION should not larger than 0ffffffff */
+#define MAJOR_VERSION 2                 //MAJOR_VERSION should not larger than 0ffffffff
+#define MINOR_VERSION 1                 //MINOR_VERSION should not larger than 0ffffffff
+
+#define SGX_1_9_MAJOR_VERSION 1         //MAJOR_VERSION should not larger than 0ffffffff
+#define SGX_1_9_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)
 
 #define METADATA_MAGIC 0x86A80294635D0E4CULL
-#define METADATA_SIZE 0x1000
+#define METADATA_SIZE 0x3000
+#define TCS_TEMPLATE_SIZE 72
+
 /* TCS Policy bit masks */
 #define TCS_POLICY_BIND     0x00000000  /* If set, the TCS is bound to the application thread */
 #define TCS_POLICY_UNBIND   0x00000001
@@ -58,7 +64,9 @@
 #define SSA_FRAME_SIZE_MIN 1
 #define SSA_FRAME_SIZE_MAX 2
 #define STACK_SIZE_MIN 0x1000
-#define HEAP_SIZE_MIN 0
+#define STACK_SIZE_MAX 0x40000
+#define HEAP_SIZE_MIN 0x1000
+#define HEAP_SIZE_MAX 0x1000000
 #define DEFAULT_MISC_SELECT 0
 #define DEFAULT_MISC_MASK 0xFFFFFFFF
 
@@ -78,13 +86,27 @@ typedef enum
 #define GROUP_FLAG              (1<<12)
 #define GROUP_ID(x)             (GROUP_FLAG | x)
 #define IS_GROUP_ID(x)          !!((x) & GROUP_FLAG)
-#define LAYOUT_ID_HEAP          1
-#define LAYOUT_ID_TCS           2
-#define LAYOUT_ID_TD            3
-#define LAYOUT_ID_SSA           4
-#define LAYOUT_ID_STACK         5
-#define LAYOUT_ID_THREAD_GROUP  GROUP_ID(6)
-#define LAYOUT_ID_GUARD         7
+#define LAYOUT_ID_HEAP_MIN      1
+#define LAYOUT_ID_HEAP_INIT     2
+#define LAYOUT_ID_HEAP_MAX      3
+#define LAYOUT_ID_TCS           4
+#define LAYOUT_ID_TD            5
+#define LAYOUT_ID_SSA           6
+#define LAYOUT_ID_STACK_MAX     7
+#define LAYOUT_ID_STACK_MIN     8
+#define LAYOUT_ID_THREAD_GROUP  GROUP_ID(9)
+#define LAYOUT_ID_GUARD         10
+#define LAYOUT_ID_HEAP_DYN_MIN  11
+#define LAYOUT_ID_HEAP_DYN_INIT 12
+#define LAYOUT_ID_HEAP_DYN_MAX  13
+#define LAYOUT_ID_TCS_DYN       14
+#define LAYOUT_ID_TD_DYN        15
+#define LAYOUT_ID_SSA_DYN       16
+#define LAYOUT_ID_STACK_DYN_MAX 17
+#define LAYOUT_ID_STACK_DYN_MIN 18
+#define LAYOUT_ID_THREAD_GROUP_DYN GROUP_ID(19)
+
+
 
 /* 
 **    layout table example
@@ -138,12 +160,12 @@ typedef struct _metadata_t
     uint32_t            ssa_frame_size;        /* The size of SSA frame in page */
     uint32_t            max_save_buffer_size;  /* Max buffer size is 2632 */
     uint32_t            desired_misc_select;
-    uint32_t            reserved;
+    uint32_t            tcs_min_pool;          /* TCS min pool*/         
     uint64_t            enclave_size;          /* enclave virtual size */
     sgx_attributes_t    attributes;            /* XFeatureMask to be set in SECS. */
     enclave_css_t       enclave_css;           /* The enclave signature */
     data_directory_t    dirs[DIR_NUM];
-    uint8_t             data[2208];
+    uint8_t             data[10400];
 }metadata_t;
 
 se_static_assert(sizeof(metadata_t) == METADATA_SIZE);

+ 20 - 3
common/inc/internal/rts.h

@@ -63,12 +63,29 @@ typedef enum
     SDK_VERSION_2_0
 } sdk_version_t;
 
-typedef struct _cpu_feature_sdk_version
+typedef struct _system_features
 {
     uint64_t cpu_features;
     sdk_version_t version;
-}cpu_sdk_info_t;
+    /* system feature set array. MSb of each element indicates whether this is
+     * the last element. This will help tRTS to know when it can stop walking
+     * through the array searching for certain features.
+    */
+    uint64_t system_feature_set[1];
+}system_features_t;
+
+// current system_feature_set only contains one element of type uint64_t, the highest
+// bit is bit 63
+#define SYS_FEATURE_MSb     63
+
+#define OCALL_FLAG        0x4F434944
+
+typedef enum
+{
+    EDMM_TRIM = -2,
+    EDMM_TRIM_COMMIT = -3,
+    EDMM_MODPR = -4,
+}edmm_ocall_t;
 
-#define     OCALL_FLAG        0x4F434944
 
 #endif

+ 6 - 4
common/inc/internal/rts_cmd.h

@@ -30,10 +30,12 @@
  */
 
 /* ECALL command */
-#define ECMD_ECALL         0
-#define ECMD_INIT_ENCLAVE -1
-#define ECMD_ORET         -2
-#define ECMD_EXCEPT       -3
+#define ECMD_ECALL           0
+#define ECMD_INIT_ENCLAVE   -1
+#define ECMD_ORET           -2
+#define ECMD_EXCEPT         -3
+#define ECMD_MKTCS          -4
+#define ECMD_UNINIT_ENCLAVE -5
 
 /* OCALL command */
 #define OCMD_ERET         -1

+ 15 - 0
common/inc/internal/se_lock.hpp

@@ -49,6 +49,21 @@ private:
     se_mutex_t m_mutex;
 };
 
+class Cond: private Uncopyable
+{
+public:
+    Cond(){se_mutex_init(&m_mutex); se_thread_cond_init(&m_cond);}
+    ~Cond(){se_mutex_destroy(&m_mutex); se_thread_cond_destroy(&m_cond);}
+    void lock(){se_mutex_lock(&m_mutex);}
+    void unlock(){se_mutex_unlock(&m_mutex);}
+    void wait(){se_thread_cond_wait(&m_cond, &m_mutex);}
+    void signal(){se_thread_cond_signal(&m_cond);}
+    void broadcast(){se_thread_cond_broadcast(&m_cond);}
+private:
+    se_mutex_t m_mutex;
+    se_cond_t  m_cond;
+};
+
 class LockGuard: private Uncopyable
 {
 public:

+ 18 - 5
common/inc/internal/se_page_attr.h

@@ -32,16 +32,29 @@
 #ifndef _SE_PAGE_ATTR_H_
 #define _SE_PAGE_ATTR_H_
 
+// layout.entry.attribute is 16-bit length
 typedef enum
 {
     DoEADD = 0,
     DoEEXTEND,
+    DoEREMOVE,
+    DoPostADD,
+    DoPostREMOVE,
+    DynTHREAD,
+    GrowDOWN,
 } ATTRIBUTE_BITS_t;
 
-typedef enum
-{
-    ADD_PAGE_ONLY = 1<<DoEADD,
-    ADD_EXTEND_PAGE = 1<<DoEADD|1<<DoEEXTEND,
-} EADD_BUFFER_IN_ATTRIBUTE_t;
+#define PAGE_ATTR_EADD         (1<<DoEADD)
+#define PAGE_ATTR_EEXTEND      (1<<DoEEXTEND)
+#define PAGE_ATTR_EREMOVE      (1<<DoEREMOVE)
+#define PAGE_ATTR_POST_ADD     (1<<DoPostADD)
+#define PAGE_ATTR_POST_REMOVE  (1<<DoPostREMOVE)
+#define PAGE_ATTR_DYN_THREAD   (1<<DynTHREAD)
+#define PAGE_DIR_GROW_DOWN     (1<<GrowDOWN)
+#define ADD_PAGE_ONLY           PAGE_ATTR_EADD
+#define ADD_EXTEND_PAGE        (PAGE_ATTR_EADD | PAGE_ATTR_EEXTEND)
+#define PAGE_ATTR_MASK         ~(PAGE_ATTR_EADD | PAGE_ATTR_EEXTEND | PAGE_ATTR_EREMOVE | PAGE_ATTR_POST_ADD | PAGE_ATTR_POST_REMOVE | PAGE_ATTR_DYN_THREAD | PAGE_DIR_GROW_DOWN)
+
+
 
 #endif

+ 58 - 0
common/inc/internal/se_tcrypto_common.h

@@ -0,0 +1,58 @@
+/*
+ * 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 _SE_TCRYPTO_COMMON_H_
+#define _SE_TCRYPTO_COMMON_H_
+
+#ifdef USE_SGXSSL
+
+
+#ifdef DEBUG
+
+extern unsigned long openssl_last_err;
+
+#define CLEAR_OPENSSL_ERROR_QUEUE while ((openssl_last_err = ERR_get_error())) { } \
+    openssl_last_err = 0
+#define GET_LAST_OPENSSL_ERROR openssl_last_err = ERR_get_error()
+
+#else
+
+#define CLEAR_OPENSSL_ERROR_QUEUE {}
+#define GET_LAST_OPENSSL_ERROR {}
+
+
+#endif //DEBUG
+
+
+#endif //USE_SGXSSL
+
+#endif //_SE_TCRYPTO_COMMON_H_

+ 8 - 1
common/inc/internal/se_thread.h

@@ -42,7 +42,8 @@
 #include <unistd.h>
 #include <sys/syscall.h>
 #include <pthread.h>
-typedef pthread_mutex_t	se_mutex_t;
+typedef pthread_mutex_t se_mutex_t;
+typedef pthread_cond_t se_cond_t;
 typedef pid_t se_thread_id_t;
 typedef pthread_key_t se_tls_index_t;
 
@@ -58,6 +59,12 @@ int se_mutex_lock(se_mutex_t* mutex);
 int se_mutex_unlock(se_mutex_t* mutex);
 int se_mutex_destroy(se_mutex_t* mutex);
 
+void se_thread_cond_init(se_cond_t* cond);
+int se_thread_cond_wait(se_cond_t *cond, se_mutex_t *mutex);
+int se_thread_cond_signal(se_cond_t *cond);
+int se_thread_cond_broadcast(se_cond_t *cond);
+int se_thread_cond_destroy(se_cond_t* cond);
+
 unsigned int se_get_threadid(void);
 
 /* tls functions */

+ 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.9.100.39124"
+#define STRFILEVER      "2.0.40950"
 

+ 63 - 0
common/inc/internal/sgx_ecc256_internal.h

@@ -0,0 +1,63 @@
+/*
+ * 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 _SGX_ECC256_INTERNAL_H
+#define _SGX_ECC256_INTERNAL_H
+
+#include "sgx_tcrypto.h"
+
+typedef struct _sgx_ec256_shared_point_t
+{
+    uint8_t x[SGX_ECP256_KEY_SIZE];
+    uint8_t y[SGX_ECP256_KEY_SIZE];
+} sgx_ec256_shared_point_t;
+
+#ifdef __cplusplus
+extern "C"
+#endif
+
+/* NOTE: The function is for internal use ONLY
+ *
+ * Computes a point with scalar multiplication based on private B key (local) and remote public Ga Key 
+ * Parameters:
+ *   Return: sgx_status_t - SGX_SUCCESS or failure as defined in sgx_error.h
+ *   Inputs: sgx_ecc_state_handle_t ecc_handle - Handle to the ECC crypto system
+ *           sgx_ec256_private_t *p_private_b - Pointer to the local private key
+ *           sgx_ec256_public_t *p_public_ga - Pointer to the remote public key
+ *   Output: sgx_ec256_shared_point_t *p_shared_key - Pointer to the target shared point
+ */
+sgx_status_t SGXAPI sgx_ecc256_compute_shared_point(sgx_ec256_private_t *p_private_b,
+                                                     sgx_ec256_public_t *p_public_ga,
+                                                     sgx_ec256_shared_point_t *p_shared_key,
+                                                     sgx_ecc_state_handle_t ecc_handle);
+
+
+#endif

+ 3 - 2
common/inc/internal/thread_data.h

@@ -93,8 +93,8 @@ typedef struct _thread_data_t
     sys_word_t  first_ssa_gpr;      /* set by urts, relative to TCS */
     sys_word_t  stack_guard;        /* GCC expects start_guard at 0x14 on x86 and 0x28 on x64 */
 
-    sys_word_t reserved;
-    sys_word_t  ssa_frame_size;     /* set by urts, in pages (se_ptrace.c needs to know its offset). */
+    sys_word_t  reserved;
+    sys_word_t  xsave_size;         /* in bytes (se_ptrace.c needs to know its offset).*/
     sys_word_t  last_error;         /* init to be 0. Used by trts. */
 
 #ifdef TD_SUPPORT_MULTI_PLATFORM
@@ -110,6 +110,7 @@ typedef struct _thread_data_t
     intptr_t    exception_flag;
 #endif
     sys_word_t  cxx_thread_info[6];
+    sys_word_t  stack_commit_addr;
 } thread_data_t;
 
 #ifdef __cplusplus

+ 16 - 1
common/inc/internal/trts_inst.h

@@ -33,6 +33,7 @@
 #define _TRTS_INST_H_
 
 #include "sgx.h"
+#include "arch.h"
 
 /* Attention: 
   * if the following alignment requirement changes, go to selib to
@@ -55,14 +56,28 @@ typedef enum _egetkey_status_t
     EGETKEY_INVALID_KEYNAME   = BIT_ERROR(8),
 }  egetkey_status_t;
 
+struct ms_tcs
+{
+    void * ptcs;
+};
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+int sgx_accept_forward(si_flags_t sfl, size_t lo, size_t hi);
 void do_ereport(const sgx_target_info_t *target_info, const sgx_report_data_t *report_data, sgx_report_t *report);
 int do_egetkey(const sgx_key_request_t *key_request, sgx_key_128bit_t *key);
 uint32_t do_rdrand(uint32_t *rand);
-
+int do_eaccept(const sec_info_t *, size_t);
+int do_emodpe(const sec_info_t*, size_t);
+int apply_EPC_pages(void *start_address, size_t page_number);
+int apply_pages_within_exception(void *start_address, size_t page_count);
+int trim_EPC_pages(void *start_address, size_t page_number);
+sgx_status_t SGXAPI sgx_trts_mprotect(size_t start, size_t size, uint64_t perms);
+sgx_status_t do_add_thread(void *ms);
+int is_dynamic_thread(void *tcs);
+uint32_t get_dynamic_stack_max_page(void);
 #ifdef __cplusplus
 }
 #endif

+ 2 - 2
common/inc/internal/util.h

@@ -52,8 +52,8 @@
 #define SE_BULK_PAGE_FRAME_MASK (SE_BULK_PAGE_FRAME_SIZE-1)
 #define SE_BULK_PAGE_SHIFT	(SE_PAGE_SHIFT + SE_BULK_PAGE_FRAME_SHIFT)
 #define SE_BULK_PAGE_SIZE	(1 << SE_BULK_PAGE_SHIFT)
-#define SE_GUARD_PAGE_SHIFT SE_PAGE_SHIFT
-#define SE_GUARD_PAGE_SIZE SE_PAGE_SIZE
+#define SE_GUARD_PAGE_SHIFT 16
+#define SE_GUARD_PAGE_SIZE (1 << SE_GUARD_PAGE_SHIFT)
 
 #define	ROUND_TO(x, align)  (((x) + ((align)-1)) & ~((align)-1))
 #define	ROUND_TO_PAGE(x)    ROUND_TO(x, SE_PAGE_SIZE)

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

@@ -46,11 +46,8 @@
 extern "C" {
 #endif
 
-#include "linux/xsave_gnu.h"
+void init_xsave_info();
 
-/* implemented in urts_xsave.cpp/trts_xsave.cpp */
-void save_and_clean_xfeature_regs(uint8_t *buffer);
-void restore_xfeature_regs(const uint8_t *buffer);
 
 /* trts_xsave.cpp */
 uint64_t get_xfeature_state();

+ 29 - 34
common/inc/sgx_capable.h

@@ -1,33 +1,33 @@
 /*
-* Copyright 2011-2017 Intel Corporation
-* 
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following conditions
-* are met:
-* 
-* 1. Redistributions of source code must retain the above copyright notice,
-* this list of conditions and the following disclaimer.
-* 
-* 2. 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.
-* 
-* 3. Neither the name of the copyright holder 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
-* HOLDER 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.
-*/
+ * 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.
+ *
+ */
 
 #pragma once
 
@@ -37,10 +37,6 @@
 #include "sgx_error.h"
 #include "sgx_defs.h"
 
-#if defined(_MSC_VER)
-#include <Windows.h>
-#endif
-
 typedef enum _sgx_device_status_t {
     SGX_ENABLED,
     SGX_DISABLED_REBOOT_REQUIRED, /* A reboot is required to finish enabling SGX */
@@ -87,4 +83,3 @@ sgx_status_t SGXAPI sgx_cap_get_status(sgx_device_status_t* sgx_device_status);
 #endif
 
 #endif
-

+ 1 - 0
common/inc/sgx_error.h

@@ -65,6 +65,7 @@ typedef enum _status_t
     SGX_ERROR_MODE_INCOMPATIBLE  = SGX_MK_ERROR(0x200e),      /* The target enclave 32/64 bit mode or sim/hw mode is incompatible with the mode of current uRTS. */
     SGX_ERROR_ENCLAVE_FILE_ACCESS = SGX_MK_ERROR(0x200f),     /* Can't open enclave file. */
     SGX_ERROR_INVALID_MISC        = SGX_MK_ERROR(0x2010),     /* The MiscSelct/MiscMask settings are not correct.*/
+    SGX_ERROR_INVALID_LAUNCH_TOKEN = SGX_MK_ERROR(0x2011),    /* The launch token is not correct.*/
 
     SGX_ERROR_MAC_MISMATCH       = SGX_MK_ERROR(0x3001),      /* Indicates verification error for reports, sealed datas, etc */
     SGX_ERROR_INVALID_ATTRIBUTE  = SGX_MK_ERROR(0x3002),      /* The enclave is not authorized */

+ 20 - 31
common/inc/sgx_tcrypto.h

@@ -30,7 +30,7 @@
  */
 
 
-
+ 
 /**
 * File: sgx_tcrypto.h
 * Description:
@@ -61,12 +61,6 @@ typedef struct _sgx_ec256_dh_shared_t
     uint8_t s[SGX_ECP256_KEY_SIZE];
 } sgx_ec256_dh_shared_t;
 
-typedef struct _sgx_ec256_dh_shared512_t
-{
-    uint8_t x[SGX_ECP256_KEY_SIZE];
-    uint8_t y[SGX_ECP256_KEY_SIZE];
-} sgx_ec256_dh_shared512_t;
-
 typedef struct _sgx_ec256_private_t
 {
     uint8_t r[SGX_ECP256_KEY_SIZE];
@@ -90,11 +84,12 @@ typedef struct _sgx_rsa3072_public_key_t
     uint8_t exp[SGX_RSA3072_PUB_EXP_SIZE];
 } sgx_rsa3072_public_key_t;
 
-typedef struct _sgx_rsa3072_private_key_t
+typedef struct _sgx_rsa3072_key_t
 {
     uint8_t mod[SGX_RSA3072_KEY_SIZE];
-    uint8_t exp[SGX_RSA3072_PRI_EXP_SIZE];
-} sgx_rsa3072_private_key_t;
+    uint8_t d[SGX_RSA3072_PRI_EXP_SIZE];
+    uint8_t e[SGX_RSA3072_PUB_EXP_SIZE];
+} sgx_rsa3072_key_t;
 
 typedef uint8_t sgx_rsa3072_signature_t[SGX_RSA3072_KEY_SIZE];
 
@@ -310,8 +305,8 @@ extern "C" {
     * Parameters:
     *   Return: sgx_status_t  - SGX_SUCCESS or failure as defined in sgx_error.h
     *   Inputs: sgx_cmac_128bit_key_t *p_key - Pointer to the key used in encryption/decryption operation
-    *           uint8_t *p_src - Pointer to the input stream to be MACd
-    *           uint32_t src_len - Length of the input stream to be MACd
+    *           uint8_t *p_src - Pointer to the input stream to be MAC'd
+    *           uint32_t src_len - Length of the input stream to be MAC'd
     *   Output: sgx_cmac_gcm_128bit_tag_t *p_mac - Pointer to the resultant MAC
     */
     sgx_status_t SGXAPI sgx_rijndael128_cmac_msg(const sgx_cmac_128bit_key_t *p_key,
@@ -354,16 +349,17 @@ extern "C" {
     */
     sgx_status_t SGXAPI sgx_cmac128_close(sgx_cmac_state_handle_t cmac_handle);
 
-
    /** AES-CTR 128-bit - Only 128-bit key size is supported.
     *
     * These functions encrypt/decrypt the input data stream of a variable length according
     * to the CTR mode as specified in [NIST SP 800-38A].  The counter can be thought of as
-    * an IV which increments on successive encryption or decrytion calls. For a given
+    * an IV which increments on successive encryption or decryption calls. For a given
     * dataset or data stream the incremented counter block should be used on successive
     * calls of the encryption/decryption process for that given stream.  However for
     * new or different datasets/streams, the same counter should not be reused, instead
     * intialize the counter for the new data set.
+    * Note: SGXSSL based version doesn't support user given ctr_inc_bits. It use OpenSSL's implementation
+    * which divide the counter block into two parts ([IV][counter])
     *
     * sgx_aes_ctr_encrypt
     *      Return: If source, key, counter, or destination pointer is NULL,
@@ -393,7 +389,7 @@ extern "C" {
     *   Output:
     *     uint8_t *p_dst - Pointer to the cipher text.
     *                      Size of buffer should be >= src_len.
-   */
+    */
     sgx_status_t SGXAPI sgx_aes_ctr_encrypt(
                         const sgx_aes_ctr_128bit_key_t *p_key,
                         const uint8_t *p_src,
@@ -401,6 +397,7 @@ extern "C" {
                         uint8_t *p_ctr,
                         const uint32_t ctr_inc_bits,
                         uint8_t *p_dst);
+
     sgx_status_t SGXAPI sgx_aes_ctr_decrypt(
                         const sgx_aes_ctr_128bit_key_t *p_key,
                         const uint8_t *p_src,
@@ -410,6 +407,7 @@ extern "C" {
                         uint8_t *p_dst);
 
 
+
    /**
     * Elliptic Curve Cryptography based on GF(p), 256 bit.
     *
@@ -479,6 +477,7 @@ extern "C" {
                                                 sgx_ec256_public_t *p_public,
                                                 sgx_ecc_state_handle_t ecc_handle);
 
+
     /** Checks whether the input point is a valid point on the given elliptic curve.
      * Parameters:
      *  Return: sgx_status_t - SGX_SUCCESS or failure as defined sgx_error.h
@@ -490,6 +489,7 @@ extern "C" {
                                     const sgx_ecc_state_handle_t ecc_handle,
                                     int *p_valid);
 
+
    /** Computes DH shared key based on own (local) private key and remote public Ga Key.
     * NOTE: Caller code allocates memory for Shared key pointer to be populated
     *
@@ -543,20 +543,8 @@ extern "C" {
                                                     sgx_ec256_dh_shared_t *p_shared_key,
                                                     sgx_ecc_state_handle_t ecc_handle);
 
-   /* Computes 512-bit DH shared key based on private B key (local) and remote public Ga Key
-    * Parameters:
-    *   Return: sgx_status_t - SGX_SUCCESS or failure as defined in sgx_error.h
-    *   Inputs: sgx_ecc_state_handle_t ecc_handle - Handle to the ECC crypto system
-    *           sgx_ec256_private_t *p_private_b - Pointer to the local private key
-    *           sgx_ec256_public_t *p_public_ga - Pointer to the remote public key
-    *   Output: sgx_ec256_dh_shared512_t *p_shared_key - Pointer to the 512-bit shared DH key
-    */
-    sgx_status_t SGXAPI sgx_ecc256_compute_shared_dhkey512(sgx_ec256_private_t *p_private_b,
-                                                    sgx_ec256_public_t *p_public_ga,
-                                                    sgx_ec256_dh_shared512_t *p_shared_key,
-                                                    sgx_ecc_state_handle_t ecc_handle);
-
-   /** Computes signature for data based on private key.
+   
+    /** Computes signature for data based on private key.
     *
     * A message digest is a fixed size number derived from the original message with
     * an applied hash function over the binary code of the message. (SHA256 in this case)
@@ -634,12 +622,13 @@ extern "C" {
     *   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
+    *           sgx_rsa3072_key_t *p_key - Pointer to the RSA key. 
+    *				Note: In IPP based version p_key->e is unused, hence it can be NULL.
     *   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,
+        const sgx_rsa3072_key_t *p_key,
         sgx_rsa3072_signature_t *p_signature);
 
     /** Verifies the signature for the given data based on the RSA 3072 public key.

+ 1 - 1
common/inc/sgx_tstdc.edl

@@ -31,7 +31,7 @@
 
 enclave {
     untrusted {
-        [cdecl] void sgx_oc_cpuidex([in, out] int cpuinfo[4], int leaf, int subleaf);
+        [cdecl] void sgx_oc_cpuidex([out] int cpuinfo[4], int leaf, int subleaf);
         
         /* Go outside and wait on my untrusted event */
         [cdecl] int sgx_thread_wait_untrusted_event_ocall([user_check] const void *self);

+ 1 - 1
common/inc/stdc++/new

@@ -59,7 +59,7 @@ void* SGXAPI operator new (size_t, void*);
 void* SGXAPI operator new[] (size_t, const std::nothrow_t&);
 void* SGXAPI operator new[] (size_t, void*);
 
-void SGXAPI operator delete (void*) throw ();
+void SGXAPI operator delete (void*);
 void SGXAPI operator delete (void*, const std::nothrow_t&);
 void SGXAPI operator delete (void*, void*);
 void SGXAPI operator delete[] (void*);

+ 83 - 0
common/inc/tlibc/mbusafecrt.h

@@ -0,0 +1,83 @@
+//
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information. 
+//
+
+/***
+*   mbusafecrt.h - public declarations for SafeCRT lib
+*
+
+*
+*   Purpose:
+*       This file contains the public declarations SafeCRT
+*       functions ported to MacOS. These are the safe versions of
+*       functions standard functions banned by SWI
+*
+
+****/
+
+/* shields! */
+
+#ifndef MBUSAFECRT_H
+#define MBUSAFECRT_H
+#include <string.h>
+#include <stdarg.h>
+#include <wchar.h>
+typedef wchar_t WCHAR;
+
+#ifdef __cplusplus
+    extern "C" {
+#endif
+
+extern errno_t strcat_s( char* ioDest, size_t inDestBufferSize, const char* inSrc );
+extern errno_t wcscat_s( WCHAR* ioDest, size_t inDestBufferSize, const WCHAR* inSrc );
+
+extern errno_t strncat_s( char* ioDest, size_t inDestBufferSize, const char* inSrc, size_t inCount );
+extern errno_t wcsncat_s( WCHAR* ioDest, size_t inDestBufferSize, const WCHAR* inSrc, size_t inCount );
+
+extern errno_t strcpy_s( char* outDest, size_t inDestBufferSize, const char* inSrc );
+extern errno_t wcscpy_s( WCHAR* outDest, size_t inDestBufferSize, const WCHAR* inSrc );
+
+extern errno_t strncpy_s( char* outDest, size_t inDestBufferSize, const char* inSrc, size_t inCount );
+extern errno_t wcsncpy_s( WCHAR* outDest, size_t inDestBufferSize, const WCHAR* inSrc, size_t inCount );
+
+extern char* strtok_s( char* inString, const char* inControl, char** ioContext );
+extern WCHAR* wcstok_s( WCHAR* inString, const WCHAR* inControl, WCHAR** ioContext );
+
+extern size_t wcsnlen( const WCHAR* inString, size_t inMaxSize );
+
+extern errno_t _itoa_s( int inValue, char* outBuffer, size_t inDestBufferSize, int inRadix );
+extern errno_t _itow_s( int inValue, WCHAR* outBuffer, size_t inDestBufferSize, int inRadix );
+
+extern errno_t _ltoa_s( long inValue, char* outBuffer, size_t inDestBufferSize, int inRadix );
+extern errno_t _ltow_s( long inValue, WCHAR* outBuffer, size_t inDestBufferSize, int inRadix );
+
+extern errno_t _ultoa_s( unsigned long inValue, char* outBuffer, size_t inDestBufferSize, int inRadix );
+extern errno_t _ultow_s( unsigned long inValue, WCHAR* outBuffer, size_t inDestBufferSize, int inRadix );
+
+extern errno_t _i64toa_s( long long inValue, char* outBuffer, size_t inDestBufferSize, int inRadix );
+extern errno_t _i64tow_s( long long inValue, WCHAR* outBuffer, size_t inDestBufferSize, int inRadix );
+
+extern errno_t _ui64toa_s( unsigned long long inValue, char* outBuffer, size_t inDestBufferSize, int inRadix );
+extern errno_t _ui64tow_s( unsigned long long inValue, WCHAR* outBuffer, size_t inDestBufferSize, int inRadix );
+
+extern int sprintf_s( char *string, size_t sizeInBytes, const char *format, ... );
+extern int swprintf_s( WCHAR *string, size_t sizeInWords, const WCHAR *format, ... );
+
+extern int _snprintf_s( char *string, size_t sizeInBytes, size_t count, const char *format, ... );
+extern int _snwprintf_s( WCHAR *string, size_t sizeInWords, size_t count, const WCHAR *format, ... );
+
+extern int _vsprintf_s( char* string, size_t sizeInBytes, const char* format, va_list arglist );
+extern int _vsnprintf_s( char* string, size_t sizeInBytes, size_t count, const char* format, va_list arglist );
+
+extern int _vswprintf_s( WCHAR* string, size_t sizeInWords, const WCHAR* format, va_list arglist );
+extern int _vsnwprintf_s( WCHAR* string, size_t sizeInWords, size_t count, const WCHAR* format, va_list arglist );
+
+extern errno_t memcpy_s( void * dst, size_t sizeInBytes, const void * src, size_t count );
+extern errno_t memmove_s( void * dst, size_t sizeInBytes, const void * src, size_t count );
+
+#ifdef __cplusplus
+    }
+#endif
+
+#endif	/* MBUSAFECRT_H */

+ 1 - 0
common/inc/tlibc/stdlib.h

@@ -93,6 +93,7 @@ typedef struct {
 __BEGIN_DECLS
 
 _TLIBC_NORETURN_ void _TLIBC_CDECL_ abort(void);
+int     _TLIBC_CDECL_ atexit(void (*)(void));
 int     _TLIBC_CDECL_ abs(int);
 double  _TLIBC_CDECL_ atof(const char *);
 int     _TLIBC_CDECL_ atoi(const char *);

+ 71 - 0
common/src/crypto_cmac_128.cpp

@@ -0,0 +1,71 @@
+/*
+ * 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 "crypto_wrapper.h"
+#include <openssl/cmac.h>
+#include <openssl/evp.h>
+#include <stdint.h>
+#include <assert.h>
+#include <se_memcpy.h>
+
+sgx_status_t sgx_cmac128_msg(const sgx_key_128bit_t key, const uint8_t *p_src, unsigned int src_len, sgx_mac_t *p_mac)
+{
+    if(!key || !p_src || src_len == 0 || !p_mac)
+    {
+        return SGX_ERROR_INVALID_PARAMETER;
+    }
+    CMAC_CTX *cmac_ctx = NULL;
+    size_t mac_len;
+    
+    if(!(cmac_ctx = CMAC_CTX_new()))
+    {
+        return SGX_ERROR_OUT_OF_MEMORY;
+    }
+    if(!CMAC_Init(cmac_ctx, key, sizeof(sgx_key_128bit_t), EVP_aes_128_cbc(), NULL))
+    {
+        CMAC_CTX_free(cmac_ctx);
+        return SGX_ERROR_UNEXPECTED;
+    }
+    if(!CMAC_Update(cmac_ctx, p_src, src_len))
+    {
+        CMAC_CTX_free(cmac_ctx);
+        return SGX_ERROR_UNEXPECTED;
+    }
+       if(!CMAC_Final(cmac_ctx, (uint8_t *)p_mac, &mac_len))
+    {
+        CMAC_CTX_free(cmac_ctx);
+        return SGX_ERROR_UNEXPECTED;
+    }
+    CMAC_CTX_free(cmac_ctx);
+    assert(mac_len == sizeof(sgx_mac_t));
+    return SGX_SUCCESS;    
+
+}

+ 79 - 0
common/src/crypto_evp_digest.cpp

@@ -0,0 +1,79 @@
+/*
+ * 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 <openssl/evp.h>
+#include <stdint.h>
+#include <se_memcpy.h>
+#include "crypto_wrapper.h"
+
+
+sgx_status_t sgx_EVP_Digest(const EVP_MD *type, const uint8_t *p_src, unsigned int src_len, uint8_t *digest, unsigned int *digest_len)
+{
+    if(!type || !p_src || src_len == 0 || !digest || digest_len == 0)
+        return SGX_ERROR_INVALID_PARAMETER;
+
+    uint8_t tmp_digest[EVP_MAX_MD_SIZE];
+    memset(tmp_digest, 0, EVP_MAX_MD_SIZE);
+    unsigned int tmp_digest_len;
+
+    unsigned int digest_buf_len = *digest_len;
+
+    EVP_MD_CTX *ctx;
+    if(NULL == (ctx = EVP_MD_CTX_create()))
+        return SGX_ERROR_OUT_OF_MEMORY;
+
+    if(!EVP_DigestInit_ex(ctx, type, NULL))
+    {
+        EVP_MD_CTX_destroy(ctx);
+        return SGX_ERROR_UNEXPECTED;
+    }
+    if(!EVP_DigestUpdate(ctx, p_src, src_len))
+    {
+        EVP_MD_CTX_destroy(ctx);
+        return SGX_ERROR_UNEXPECTED;
+    }
+    if(!EVP_DigestFinal_ex(ctx, tmp_digest, &tmp_digest_len))
+    {
+        EVP_MD_CTX_destroy(ctx);
+        return SGX_ERROR_UNEXPECTED;
+    }
+    EVP_MD_CTX_destroy(ctx);
+
+    if(tmp_digest_len > digest_buf_len)
+    {
+        return SGX_ERROR_UNEXPECTED;
+    }
+    if(memcpy_s(digest, digest_buf_len, tmp_digest, tmp_digest_len))
+        return SGX_ERROR_UNEXPECTED;
+
+    *digest_len = tmp_digest_len;
+    return SGX_SUCCESS;
+}

+ 111 - 0
common/src/linux/xsave_gnu.S

@@ -0,0 +1,111 @@
+/*
+ * 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 "xsave_gnu.S"
+
+#include "linux/linux-regs.h"
+
+.macro DO_XSAVEC
+#if defined(LINUX64)
+    .byte   0x48, 0x0f, 0xc7, 0x21
+#else
+    .byte   0x0f, 0xc7, 0x21
+#endif
+.endm
+.macro DO_XRSTOR
+#if defined(LINUX64)
+    .byte   0x48, 0x0f, 0xae, 0x29
+#else
+    .byte   0x0f, 0xae, 0x29
+#endif
+.endm
+.macro DO_FXSAVE
+#if defined(LINUX64)
+    .byte   0x48, 0x0f, 0xae, 0x01
+#else
+    .byte   0x0f, 0xae, 0x01
+#endif
+.endm
+.macro DO_FXRSTOR
+#if defined(LINUX64)
+    .byte   0x48, 0x0f, 0xae, 0x09
+#else
+    .byte   0x0f, 0xae, 0x09
+#endif
+.endm
+
+.text
+DECLARE_LOCAL_FUNC restore_xregs
+#if defined(LINUX32)
+    mov     SE_WORDSIZE(%esp), %ecx
+    lea     g_xsave_enabled, %eax
+#else
+    mov     %rdi, %rcx
+    mov     g_xsave_enabled@GOTPCREL(%rip), %rax
+#endif
+    movl    (%xax), %eax
+    cmpl    $0, %eax
+    jz      1f
+    xor     %xax, %xax
+    xor     %xdx, %xdx
+    mov     $0xFFFFFFFF, %eax
+    mov     $0xFFFFFFFF, %edx
+    DO_XRSTOR
+    jmp     2f
+1:
+    DO_FXRSTOR
+2:
+    ret
+
+DECLARE_LOCAL_FUNC save_xregs
+#if defined(LINUX32)
+    mov     SE_WORDSIZE(%esp), %ecx
+    lea     g_xsave_enabled, %eax
+#else
+    mov     %rdi, %rcx
+    mov     g_xsave_enabled@GOTPCREL(%rip), %rax
+#endif
+    fwait
+    movl    (%xax), %eax
+    cmpl    $0, %eax
+    jz      1f
+    xor     %xax, %xax
+    xor     %xdx, %xdx
+    mov     $0xFFFFFFFF, %eax
+    mov     $0xFFFFFFFF, %edx
+    DO_XSAVEC
+    jmp     2f
+1:
+    DO_FXSAVE
+2:
+    ret
+

+ 11 - 0
common/src/se_thread.c

@@ -49,6 +49,17 @@ int se_mutex_lock(se_mutex_t* mutex) { return (0 == pthread_mutex_lock(mutex));
 int se_mutex_unlock(se_mutex_t* mutex) { return (0 == pthread_mutex_unlock(mutex)); }
 int se_mutex_destroy(se_mutex_t* mutex) { return (0 == pthread_mutex_destroy(mutex));}
 
+void se_thread_cond_init(se_cond_t* cond)
+{
+    se_cond_t tmp = PTHREAD_COND_INITIALIZER;
+    memcpy(cond, &tmp, sizeof(tmp));
+}
+
+int se_thread_cond_wait(se_cond_t *cond, se_mutex_t *mutex){return (0 == pthread_cond_wait(cond, mutex));}
+int se_thread_cond_signal(se_cond_t *cond){return (0 == pthread_cond_signal(cond));}
+int se_thread_cond_broadcast(se_cond_t *cond){return (0 == pthread_cond_broadcast(cond));}
+int se_thread_cond_destroy(se_cond_t* cond){return (0 == pthread_cond_destroy(cond));}
+
 unsigned int se_get_threadid(void) { return (unsigned)syscall(__NR_gettid);}
 /* tls functions */
 int se_tls_alloc(se_tls_index_t *tls_index) { return !pthread_key_create(tls_index, NULL); }

+ 4 - 4
download_prebuilt.sh

@@ -33,13 +33,13 @@
 
 top_dir=`dirname $0`
 out_dir=$top_dir
-optlib_name=optimized_libs-1.9.100.39124.tar
-ae_file_name=prebuilt-ae-1.9.100.39124.tar
-server_url_path=https://download.01.org/intel-sgx/linux-1.9/
+optlib_name=optimized_libs-2.0.tar
+ae_file_name=prebuilt-ae-2.0.tar
+server_url_path=https://download.01.org/intel-sgx/linux-2.0/
 server_optlib_url=$server_url_path/$optlib_name
 server_ae_url=$server_url_path/$ae_file_name
 optlib_sha256=239cae39f87934d56c4eb919a4702c6ac82c19957b9a8d56c02b10eb4e27f573
-ae_sha256=c2f86a1e8483b91c5517c99d196599492f3106d4b2f9f7523fd9eaf59b9ed37b
+ae_sha256=3dfac14590a74aa860ea88ca9d1e2e112efb300c622e9ea02b3fa4bd69c50b07
 rm -rf $out_dir/$optlib_name
 wget $server_optlib_url -P $out_dir 
 if [ $? -ne 0 ]; then

+ 1 - 1
external/DALSdk/JHI/linux/jhi.h

@@ -518,4 +518,4 @@ JHI_GetVersionInfo (
 #endif
 
 
-#endif
+#endif

+ 1 - 1
external/DALSdk/JHI/linux/typedefs.h

@@ -98,4 +98,4 @@ typedef char			FILECHAR;
 #endif
 #endif
 
-#endif // _TYPEDEFS_H
+#endif // _TYPEDEFS_H

+ 0 - 195
external/crypto_px/include/ippbase.h

@@ -1,195 +0,0 @@
-/*
-* Copyright (C) 2016 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 __IPPBASE_H__
-#define __IPPBASE_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if defined( _WIN32 ) || defined ( _WIN64 )
-  #define __STDCALL  __stdcall
-  #define __CDECL    __cdecl
-  #define __INT64    __int64
-  #define __UINT64    unsigned __int64
-#else
-  #define __STDCALL
-  #define __CDECL
-  #define __INT64    long long
-  #define __UINT64    unsigned long long
-#endif
-
-#define IPP_PI    ( 3.14159265358979323846 )  /* ANSI C does not support M_PI */
-#define IPP_2PI   ( 6.28318530717958647692 )  /* 2*pi                         */
-#define IPP_PI2   ( 1.57079632679489661923 )  /* pi/2                         */
-#define IPP_PI4   ( 0.78539816339744830961 )  /* pi/4                         */
-#define IPP_PI180 ( 0.01745329251994329577 )  /* pi/180                       */
-#define IPP_RPI   ( 0.31830988618379067154 )  /* 1/pi                         */
-#define IPP_SQRT2 ( 1.41421356237309504880 )  /* sqrt(2)                      */
-#define IPP_SQRT3 ( 1.73205080756887729353 )  /* sqrt(3)                      */
-#define IPP_LN2   ( 0.69314718055994530942 )  /* ln(2)                        */
-#define IPP_LN3   ( 1.09861228866810969139 )  /* ln(3)                        */
-#define IPP_E     ( 2.71828182845904523536 )  /* e                            */
-#define IPP_RE    ( 0.36787944117144232159 )  /* 1/e                          */
-#define IPP_EPS23 ( 1.19209289e-07f )
-#define IPP_EPS52 ( 2.2204460492503131e-016 )
-
-#define IPP_MAX_8U     ( 0xFF )
-#define IPP_MAX_16U    ( 0xFFFF )
-#define IPP_MAX_32U    ( 0xFFFFFFFF )
-#define IPP_MIN_8U     ( 0 )
-#define IPP_MIN_16U    ( 0 )
-#define IPP_MIN_32U    ( 0 )
-#define IPP_MIN_8S     (-128 )
-#define IPP_MAX_8S     ( 127 )
-#define IPP_MIN_16S    (-32768 )
-#define IPP_MAX_16S    ( 32767 )
-#define IPP_MIN_32S    (-2147483647 - 1 )
-#define IPP_MAX_32S    ( 2147483647 )
-#define IPP_MIN_64U    ( 0 )
-
-#if defined( _WIN32 ) || defined ( _WIN64 )
-  #define IPP_MAX_64S  ( 9223372036854775807i64 )
-  #define IPP_MIN_64S  (-9223372036854775807i64 - 1 )
-  #define IPP_MAX_64U  ( 0xffffffffffffffffL ) /* 18446744073709551615 */
-#else
-  #define IPP_MAX_64S  ( 9223372036854775807LL )
-  #define IPP_MIN_64S  (-9223372036854775807LL - 1 )
-  #define IPP_MAX_64U  ( 0xffffffffffffffffLL ) /* 18446744073709551615 */
-#endif
-
-#define IPP_MINABS_32F ( 1.175494351e-38f )
-#define IPP_MAXABS_32F ( 3.402823466e+38f )
-#define IPP_EPS_32F    ( 1.192092890e-07f )
-#define IPP_MINABS_64F ( 2.2250738585072014e-308 )
-#define IPP_MAXABS_64F ( 1.7976931348623158e+308 )
-#define IPP_EPS_64F    ( 2.2204460492503131e-016 )
-
-#define IPP_MAX( a, b ) ( ((a) > (b)) ? (a) : (b) )
-#define IPP_MIN( a, b ) ( ((a) < (b)) ? (a) : (b) )
-
-#define IPP_ABS( a ) ( ((a) < 0) ? (-(a)) : (a) )
-
-typedef struct {
-    int    major;                     /* e.g. 1                               */
-    int    minor;                     /* e.g. 2                               */
-    int    majorBuild;                /* e.g. 3                               */
-    int    build;                     /* e.g. 10, always >= majorBuild        */
-    char  targetCpu[4];               /* corresponding to Intel(R) processor  */
-    const char* Name;                 /* e.g. "ippsw7"                        */
-    const char* Version;              /* e.g. "v1.2 Beta"                     */
-    const char* BuildDate;            /* e.g. "Jul 20 99"                     */
-} IppLibraryVersion;
-
-typedef unsigned char  Ipp8u;
-typedef unsigned short Ipp16u;
-typedef unsigned int   Ipp32u;
-typedef signed char    Ipp8s;
-typedef signed short   Ipp16s;
-typedef signed int     Ipp32s;
-typedef float          Ipp32f;
-typedef __INT64        Ipp64s;
-typedef __UINT64       Ipp64u;
-typedef double         Ipp64f;
-typedef Ipp16s         Ipp16f;
-
-typedef struct {
-    Ipp8s  re;
-    Ipp8s  im;
-} Ipp8sc;
-
-typedef struct {
-    Ipp16s  re;
-    Ipp16s  im;
-} Ipp16sc;
-
-typedef struct {
-    Ipp16u  re;
-    Ipp16u  im;
-} Ipp16uc;
-
-typedef struct {
-    Ipp32s  re;
-    Ipp32s  im;
-} Ipp32sc;
-
-typedef struct {
-    Ipp32f  re;
-    Ipp32f  im;
-} Ipp32fc;
-
-typedef struct {
-    Ipp64s  re;
-    Ipp64s  im;
-} Ipp64sc;
-
-typedef struct {
-    Ipp64f  re;
-    Ipp64f  im;
-} Ipp64fc;
-
-typedef enum {
-   ippUndef = -1,
-   ipp1u    =  0,
-   ipp8u    =  1,
-   ipp8uc   =  2,
-   ipp8s    =  3,
-   ipp8sc   =  4,
-   ipp16u   =  5,
-   ipp16uc  =  6,
-   ipp16s   =  7,
-   ipp16sc  =  8,
-   ipp32u   =  9,
-   ipp32uc  = 10,
-   ipp32s   = 11,
-   ipp32sc  = 12,
-   ipp32f   = 13,
-   ipp32fc  = 14,
-   ipp64u   = 15,
-   ipp64uc  = 16,
-   ipp64s   = 17,
-   ipp64sc  = 18,
-   ipp64f   = 19,
-   ipp64fc  = 20
-} IppDataType;
-
-typedef enum { 
-    ippFalse = 0, 
-    ippTrue = 1 
-} IppBool;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __IPPBASE_H__ */
-

+ 0 - 395
external/crypto_px/include/ippcore.h

@@ -1,395 +0,0 @@
-/*
-* Copyright (C) 2016 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.
-*
-*/
-
-#if !defined( __IPPCORE_H__ ) || defined( _OWN_BLDPCS )
-#define __IPPCORE_H__
-
-#if defined (_WIN32_WCE) && defined (_M_IX86) && defined (__stdcall)
-  #define _IPP_STDCALL_CDECL
-  #undef __stdcall
-#endif
-
-#ifndef __IPPDEFS_H__
-  #include "ippdefs.h"
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-#if !defined( _IPP_NO_DEFAULT_LIB )
-  #if defined( _IPP_SEQUENTIAL_DYNAMIC )
-    #pragma comment( lib, __FILE__ "/../../lib/" _INTEL_PLATFORM "ippcore" )
-  #elif defined( _IPP_SEQUENTIAL_STATIC )
-    #pragma comment( lib, __FILE__ "/../../lib/" _INTEL_PLATFORM "ippcoremt" )
-  #elif defined( _IPP_PARALLEL_DYNAMIC )
-    #pragma comment( lib, __FILE__ "/../../lib/" _INTEL_PLATFORM "threaded/ippcore" )
-  #elif defined( _IPP_PARALLEL_STATIC )
-    #pragma comment( lib, __FILE__ "/../../lib/" _INTEL_PLATFORM "threaded/ippcoremt" )
-  #endif
-#endif
-
-/* /////////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////
-//                   Functions declarations
-////////////////////////////////////////////////////////////////////////////////
-///////////////////////////////////////////////////////////////////////////// */
-
-
-/* /////////////////////////////////////////////////////////////////////////////
-//  Name:       ippGetLibVersion
-//  Purpose:    getting of the library version
-//  Returns:    the structure of information about version
-//              of ippcore library
-//  Parameters:
-//
-//  Notes:      not necessary to release the returned structure
-*/
-IPPAPI( const IppLibraryVersion*, ippGetLibVersion, (void) )
-
-
-/* /////////////////////////////////////////////////////////////////////////////
-//  Name:       ippGetStatusString
-//  Purpose:    convert the library status code to a readable string
-//  Parameters:
-//    StsCode   IPP status code
-//  Returns:    pointer to string describing the library status code
-//
-//  Notes:      don't free the pointer
-*/
-IPPAPI( const char*, ippGetStatusString, ( IppStatus StsCode ) )
-
-
-
-/* /////////////////////////////////////////////////////////////////////////////
-//  Name:       ippGetCpuClocks
-//  Purpose:    reading of time stamp counter (TSC) register value
-//  Returns:    TSC value
-//
-//  Note:      An hardware exception is possible if TSC reading is not supported by
-/              the current chipset
-*/
-
-IPPAPI( Ipp64u, ippGetCpuClocks, (void) )
-
-
-/* ///////////////////////////////////////////////////////////////////////////
-//  Names:  ippSetFlushToZero,
-//          ippSetDenormAreZero.
-//
-//  Purpose: ippSetFlushToZero enables or disables the flush-to-zero mode,
-//           ippSetDenormAreZero enables or disables the denormals-are-zeros
-//           mode.
-//
-//  Arguments:
-//     value       - !0 or 0 - set or clear the corresponding bit of MXCSR
-//     pUMask      - pointer to user store current underflow exception mask
-//                   ( may be NULL if don't want to store )
-//
-//  Return:
-//   ippStsNoErr              - Ok
-//   ippStsCpuNotSupportedErr - the mode is not supported
-*/
-
-IPPAPI( IppStatus, ippSetFlushToZero, ( int value, unsigned int* pUMask ))
-IPPAPI( IppStatus, ippSetDenormAreZeros, ( int value ))
-
-
-
-/* /////////////////////////////////////////////////////////////////////////////
-//  Name:       ippAlignPtr
-//  Purpose:    pointer aligning
-//  Returns:    aligned pointer
-//
-//  Parameter:
-//    ptr        - pointer
-//    alignBytes - number of bytes to align
-//
-*/
-IPPAPI( void*, ippAlignPtr, ( void * ptr, int alignBytes ) )
-
-/* /////////////////////////////////////////////////////////////////////////////
-//                   Functions to allocate and free memory
-///////////////////////////////////////////////////////////////////////////// */
-/* /////////////////////////////////////////////////////////////////////////////
-//  Name:       ippMalloc
-//  Purpose:    64-byte aligned memory allocation
-//  Parameter:
-//    len       number of bytes
-//  Returns:    pointer to allocated memory
-//
-//  Notes:      the memory allocated by ippMalloc has to be free by ippFree
-//              function only.
-*/
-
-IPPAPI( void*, ippMalloc,  (int length) )
-
-
-/* /////////////////////////////////////////////////////////////////////////////
-//  Name:       ippFree
-//  Purpose:    free memory allocated by the ippMalloc function
-//  Parameter:
-//    ptr       pointer to the memory allocated by the ippMalloc function
-//
-//  Notes:      use the function to free memory allocated by ippMalloc
-*/
-IPPAPI( void, ippFree, (void* ptr) )
-
-
-
-/* /////////////////////////////////////////////////////////////////////////////
-//  Name:       ippInit
-//  Purpose:    Automatic switching to best for current cpu library code using.
-//  Returns:
-//   ippStsNoErr
-//
-//  Parameter:  nothing
-//
-//  Notes:      At the moment of this function execution no any other IPP function
-//              has to be working
-*/
-IPPAPI( IppStatus, ippInit, ( void ))
-
-
-/* ////////////////////////////////////////////////////////////////////////////
-//  Name:       ippGetCpuFreqMhz
-//
-//  Purpose:    the function estimates cpu frequency and returns
-//              its value in MHz as a integer
-//
-//  Return:
-//    ippStsNoErr              Ok
-//    ippStsNullPtrErr         null pointer to the freq value
-//    ippStsSizeErr            wrong num of tries, internal var
-//  Arguments:
-//    pMhz                     pointer to the integer to write
-//                             cpu freq value estimated
-//
-//  Notes:      no exact value is guaranteed, the value could
-//              vary with cpu workloading
-*/
-
-IPPAPI(IppStatus, ippGetCpuFreqMhz, ( int* pMhz ) )
-
-/* ////////////////////////////////////////////////////////////////////////////
-//  Name:       ippSetNumThreads
-//
-//  Purpose:
-//
-//  Return:
-//    ippStsNoErr              Ok
-//    ippStsNoOperation        For static library internal threading is not supported
-//    ippStsSizeErr            Desired number of threads less or equal zero
-//
-//  Arguments:
-//    numThr                   Desired number of threads
-*/
-IPPAPI( IppStatus, ippSetNumThreads, ( int numThr ) )
-
-/* ////////////////////////////////////////////////////////////////////////////
-//  Name:       ippGetNumThreads
-//
-//  Purpose:
-//
-//  Return:
-//    ippStsNoErr              Ok
-//    ippStsNullPtrErr         Pointer to numThr is Null
-//    ippStsNoOperation        For static library internal threading is not supported
-//                             and return value is always == 1
-//
-//  Arguments:
-//    pNumThr                  Pointer to memory location where to store current numThr
-*/
-IPPAPI( IppStatus, ippGetNumThreads, (int* pNumThr) )
-
-/* ////////////////////////////////////////////////////////////////////////////
-//  Name:       ippGetMaxCacheSizeB
-//
-//  Purpose:  Detects maximal from the sizes of L2 or L3 in bytes
-//
-//  Return:
-//    ippStsNullPtrErr         The result's pointer is NULL.
-//    ippStsNotSupportedCpu    The cpu is not supported.
-//    ippStsUnknownCacheSize   The cpu is supported, but the size of the cache is unknown.
-//    ippStsNoErr              Ok
-//
-//  Arguments:
-//    pSizeByte                Pointer to the result
-//
-//  Note:
-//    1). Intel(R) processors are supported only.
-//    2). Intel(R) Itanium(R) processors and platforms with Intel XScale(R) technology are unsupported
-//    3). For unsupported processors the result is "0",
-//        and the return status is "ippStsNotSupportedCpu".
-//    4). For supported processors the result is "0",
-//        and the return status is "ippStsUnknownCacheSize".
-//        if sizes of the cache is unknown.
-//
-*/
-IPPAPI( IppStatus, ippGetMaxCacheSizeB, ( int* pSizeByte ) )
-
-/*
-//  Name:       ippGetCpuFeatures
-//  Purpose:    Detects CPU features.
-//  Parameters:
-//    pFeaturesMask   Pointer to the features mask.
-//                    Nonzero value of bit means the corresponding feature is supported.
-//                    Features mask values are defined in the ippdefs.h
-//                      [ 0] - MMX        ( ippCPUID_MMX   )
-//                      [ 1] - SSE        ( ippCPUID_SSE   )
-//                      [ 2] - SSE2       ( ippCPUID_SSE2  )
-//                      [ 3] - SSE3       ( ippCPUID_SSE3  )
-//                      [ 4] - SSSE3      ( ippCPUID_SSSE3 )
-//                      [ 5] - MOVBE      ( ippCPUID_MOVBE )
-//                      [ 6] - SSE41      ( ippCPUID_SSE41 )
-//                      [ 7] - SSE42      ( ippCPUID_SSE42 )
-//                      [ 8] - AVX        ( ippCPUID_AVX   )
-//                      [ 9] - ENABLEDBYOS( ippAVX_ENABLEDBYOS )
-//                      [10] - AES        ( ippCPUID_AES   )
-//                      [11] - PCLMULQDQ  ( ippCPUID_CLMUL )
-//                      [12] - ABR        ( ippCPUID_ABR )
-//                      [13] - RDRAND     ( ippCPUID_RDRAND )
-//                      [14] - F16C       ( ippCPUID_F16C )
-//                      [15] - AVX2       ( ippCPUID_AVX2 )
-//                      [16] - ADOX/ADCX  ( ippCPUID_ADCOX )      ADCX and ADOX instructions
-//                      [17] - RDSEED     ( ippCPUID_RDSEED )     The RDSEED instruction
-//                      [18] - PREFETCHW  ( ippCPUID_PREFETCHW )  The PREFETCHW instruction
-//                      [19] - SHA        ( ippCPUID_SHA )        Intel (R) SHA Extensions
-//                      [20:63] - Reserved
-//
-//    pCpuidInfoRegs  Pointer to the 4-element vector.
-//                    Result of CPUID.1 are stored in this vector.
-//                      [0] - register EAX
-//                      [1] - register EBX
-//                      [2] - register ECX
-//                      [3] - register EDX
-//                    If pointer pCpuidInfoRegs is set to NULL, registers are not stored.
-//
-//  Returns:
-//    ippStsNullPtrErr         The pointer to the features mask (pFeaturesMask) is NULL.
-//    ippStsNotSupportedCpu    CPU is not supported.
-//    ippStsNoErr              Ok
-//
-//  Note: Only IA-32 and Intel(R) 64 are supported
-*/
-IPPAPI( IppStatus, ippGetCpuFeatures, ( Ipp64u* pFeaturesMask,
-                                        Ipp32u  pCpuidInfoRegs[4] ) )
-
-/*
-//  Name:       ippGetEnabledCpuFeatures
-//  Purpose:    Detects enabled features for loaded libraries
-//  Returns:    Features mask
-//                    Features mask values are defined in the ippdefs.h
-//                      [ 0] - ippCPUID_MMX
-//                      [ 1] - ippCPUID_SSE
-//                      [ 2] - ippCPUID_SSE2
-//                      [ 3] - ippCPUID_SSE3
-//                      [ 4] - ippCPUID_SSSE3
-//                      [ 5] - ippCPUID_MOVBE
-//                      [ 6] - ippCPUID_SSE41
-//                      [ 7] - ippCPUID_SSE42
-//                      [ 8] - ippCPUID_AVX
-//                      [ 9] - ippAVX_ENABLEDBYOS
-//                      [10] - ippCPUID_AES
-//                      [11] - ippCPUID_CLMUL
-//                      [12] - ippCPUID_ABR
-//                      [13] - ippCPUID_RDRAND
-//                      [14] - ippCPUID_F16C
-//                      [15] - ippCPUID_AVX2
-//                      [16] - ippCPUID_ADCOX
-//                      [17] - ippCPUID_RDSEED
-//                      [18] - ippCPUID_PREFETCHW
-//                      [19] - ippCPUID_SHA
-//                      [20:63] - Reserved
-//
-*/
-IPPAPI( Ipp64u, ippGetEnabledCpuFeatures, ( void ) )
-
-/* ////////////////////////////////////////////////////////////////////////////
-//  Name:       ippSetCpuFeatures
-//
-//  Purpose: Changes the set of enabled/disabled CPU features.
-//           This function sets the processor-specific code of the Intel IPP
-//           library according to the processor features specified in cpuFeatures.
-//
-//  Return:
-//    ippStsNoErr                 No errors.
-//    Warnings:
-//    ippStsFeatureNotSupported   Current CPU doesn't support at least 1 of the
-//                                desired features;
-//    ippStsUnknownFeature        At least one of the desired features is unknown;
-//    ippStsFeaturesCombination   Wrong combination of features;
-//    ippStsCpuMismatch           Indicates that the specified processor features
-//                                are not valid. Previously set code is used.
-//
-//  Arguments:
-//    cpuFeatures                 Desired features to support by the library
-//                                (see ippdefs.h for ippCPUID_XX definition)
-//
-//  NOTE:       this function can re-initializes dispatcher and after the
-//              call another library (letter) may work
-//  CAUTION:    At the moment of this function excecution no any other IPP
-//              function has to be working
-//
-//  The next pre-defined sets of features can be used:
-//  32-bit code:
-// #define PX_FM ( ippCPUID_MMX | ippCPUID_SSE )
-// #define W7_FM ( PX_FM | ippCPUID_SSE2 )
-// #define V8_FM ( W7_FM | ippCPUID_SSE3 | ippCPUID_SSSE3 )
-// #define S8_FM ( V8_FM | ippCPUID_MOVBE )
-// #define P8_FM ( V8_FM | ippCPUID_SSE41 | ippCPUID_SSE42 | ippCPUID_AES | ippCPUID_CLMUL | ippCPUID_SHA )
-// #define G9_FM ( P8_FM | ippCPUID_AVX | ippAVX_ENABLEDBYOS | ippCPUID_RDRAND | ippCPUID_F16C )
-// #define H9_FM ( G9_FM | ippCPUID_AVX2 | ippCPUID_MOVBE | ippCPUID_ADCOX | ippCPUID_RDSEED | ippCPUID_PREFETCHW )
-//
-// 64-bit code:
-// #define PX_FM ( ippCPUID_MMX | ippCPUID_SSE | ippCPUID_SSE2 )
-// #define M7_FM ( PX_FM | ippCPUID_SSE3 )
-// #define N8_FM ( S8_FM )
-// #define U8_FM ( V8_FM )
-// #define Y8_FM ( P8_FM )
-// #define E9_FM ( G9_FM )
-// #define L9_FM ( H9_FM )
-//
-*/
-
-IPPAPI( IppStatus, ippSetCpuFeatures,( Ipp64u cpuFeatures ))
-
-#if defined (_IPP_STDCALL_CDECL)
-  #undef  _IPP_STDCALL_CDECL
-  #define __stdcall __cdecl
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __IPPCORE_H__ */

+ 0 - 327
external/crypto_px/include/ippcp.h

@@ -1,327 +0,0 @@
-/*
-* Copyright (C) 2016 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.
-*
-*/
-
-#if !defined( __IPPCP_H__ ) || defined( _OWN_BLDPCS )
-#define __IPPCP_H__
-
-
-#if defined (_WIN32_WCE) && defined (_M_IX86) && defined (__stdcall)
-  #define _IPP_STDCALL_CDECL
-  #undef __stdcall
-#endif
-
-
-#ifndef __IPPDEFS_H__
-  #include "ippdefs.h"
-#endif
-
-#ifndef __IPPCPDEFS_H__
-  #include "ippcpdefs.h"
-#endif
-
-
-#ifdef  __cplusplus
-extern "C" {
-#endif
-
-
-/* /////////////////////////////////////////////////////////////////////////////
-//  Name:       ippcpGetLibVersion
-//  Purpose:    getting of the library version
-//  Returns:    the structure of information about version of ippCP library
-//  Parameters:
-//
-//  Notes:      not necessary to release the returned structure
-*/
-IPPAPI( const IppLibraryVersion*, ippcpGetLibVersion, (void) )
-
-
-/*
-// AES
-*/
-IPPAPI(IppStatus, ippsAESGetSize,(int *pSize))
-IPPAPI(IppStatus, ippsAESInit,(const Ipp8u* pKey, int keyLen, IppsAESSpec* pCtx, int ctxSize))
-
-/* AES-CTR */
-IPPAPI(IppStatus, ippsAESEncryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len,
-                                     const IppsAESSpec* pCtx,
-                                     Ipp8u* pCtrValue, int ctrNumBitSize))
-IPPAPI(IppStatus, ippsAESDecryptCTR,(const Ipp8u* pSrc, Ipp8u* pDst, int len,
-                                     const IppsAESSpec* pCtx,
-                                     Ipp8u* pCtrValue, int ctrNumBitSize))
-
-/* AES-GCM */
-IPPAPI(IppStatus, ippsAES_GCMGetSize,(int * pSize))
-IPPAPI(IppStatus, ippsAES_GCMInit,(const Ipp8u* pKey, int keyLen, IppsAES_GCMState* pState, int ctxSize))
-
-IPPAPI(IppStatus, ippsAES_GCMReset,(IppsAES_GCMState* pState))
-IPPAPI(IppStatus, ippsAES_GCMProcessIV,(const Ipp8u* pIV, int ivLen,
-                                        IppsAES_GCMState* pState))
-IPPAPI(IppStatus, ippsAES_GCMProcessAAD,(const Ipp8u* pAAD, int ivAAD,
-                                        IppsAES_GCMState* pState))
-IPPAPI(IppStatus, ippsAES_GCMStart,(const Ipp8u* pIV, int ivLen,
-                                    const Ipp8u* pAAD, int aadLen,
-                                    IppsAES_GCMState* pState))
-IPPAPI(IppStatus, ippsAES_GCMEncrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsAES_GCMState* pState))
-IPPAPI(IppStatus, ippsAES_GCMDecrypt,(const Ipp8u* pSrc, Ipp8u* pDst, int len, IppsAES_GCMState* pState))
-IPPAPI(IppStatus, ippsAES_GCMGetTag,(Ipp8u* pDstTag, int tagLen, const IppsAES_GCMState* pState))
-
-/* AES-CMAC */
-IPPAPI(IppStatus, ippsAES_CMACGetSize,(int* pSize))
-IPPAPI(IppStatus, ippsAES_CMACInit,(const Ipp8u* pKey, int keyLen, IppsAES_CMACState* pState, int ctxSize))
-
-IPPAPI(IppStatus, ippsAES_CMACUpdate,(const Ipp8u* pSrc, int len, IppsAES_CMACState* pState))
-IPPAPI(IppStatus, ippsAES_CMACFinal,(Ipp8u* pMD, int mdLen, IppsAES_CMACState* pState))
-IPPAPI(IppStatus, ippsAES_CMACGetTag,(Ipp8u* pMD, int mdLen, const IppsAES_CMACState* pState))
-
-/*
-// hash
-*/
-IPPAPI(IppStatus, ippsHashGetSize,(int* pSize))
-IPPAPI(IppStatus, ippsHashInit,(IppsHashState* pCtx, IppHashAlgId hashAlg))
-
-IPPAPI(IppStatus, ippsHashUpdate,(const Ipp8u* pSrc, int len, IppsHashState* pCtx))
-IPPAPI(IppStatus, ippsHashGetTag,(Ipp8u* pMD, int tagLen, const IppsHashState* pCtx))
-IPPAPI(IppStatus, ippsHashFinal,(Ipp8u* pMD, IppsHashState* pCtx))
-IPPAPI(IppStatus, ippsHashMessage,(const Ipp8u* pMsg, int len, Ipp8u* pMD, IppHashAlgId hashAlg))
-
-IPPAPI(IppStatus, ippsMGF,(const Ipp8u* pSeed, int seedLen, Ipp8u* pMask, int maskLen, IppHashAlgId hashAlg))
-
-IPPAPI(IppStatus, ippsHMAC_GetSize,(int* pSize))
-IPPAPI(IppStatus, ippsHMAC_Init,(const Ipp8u* pKey, int keyLen, IppsHMACState* pCtx, IppHashAlgId hashAlg))
-
-IPPAPI(IppStatus, ippsHMAC_Update,(const Ipp8u* pSrc, int len, IppsHMACState* pCtx))
-IPPAPI(IppStatus, ippsHMAC_Final,(Ipp8u* pMD, int mdLen, IppsHMACState* pCtx))
-IPPAPI(IppStatus, ippsHMAC_GetTag,(Ipp8u* pMD, int mdLen, const IppsHMACState* pCtx))
-IPPAPI(IppStatus, ippsHMAC_Message,(const Ipp8u* pMsg, int msgLen,
-                                    const Ipp8u* pKey, int keyLen,
-                                    Ipp8u* pMD, int mdLen,
-                                    IppHashAlgId hashAlg))
-
-/*
-// Big Number Integer Arithmetic
-*/
-IPPAPI(IppStatus, ippsBigNumGetSize,(int length, int* pSize))
-IPPAPI(IppStatus, ippsBigNumInit,(int length, IppsBigNumState* pBN))
-
-IPPAPI(IppStatus, ippsSet_BN,(IppsBigNumSGN sgn,
-                              int length, const Ipp32u* pData,
-                              IppsBigNumState* pBN))
-IPPAPI(IppStatus, ippsRef_BN,(IppsBigNumSGN* pSgn, int* bitSize, Ipp32u** const ppData,
-                              const IppsBigNumState* pBN))
-
-IPPAPI(IppStatus, ippsAdd_BN,   (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pR))
-IPPAPI(IppStatus, ippsSub_BN,   (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pR))
-IPPAPI(IppStatus, ippsMod_BN,   (IppsBigNumState* pA, IppsBigNumState* pM, IppsBigNumState* pR))
-IPPAPI(IppStatus, ippsModInv_BN,(IppsBigNumState* pA, IppsBigNumState* pM, IppsBigNumState* pInv))
-IPPAPI(IppStatus, ippsDiv_BN,   (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pQ, IppsBigNumState* pR))
-IPPAPI(IppStatus, ippsCmpZero_BN,(const IppsBigNumState* pBN, Ipp32u* pResult))
-IPPAPI(IppStatus, ippsCmp_BN,(const IppsBigNumState* pA, const IppsBigNumState* pB, Ipp32u* pResult))
-IPPAPI(IppStatus, ippsMul_BN,   (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pR))
-IPPAPI(IppStatus, ippsGcd_BN,   (IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pGCD))
-
-IPPAPI(IppStatus, ippsSetOctString_BN,(const Ipp8u* pStr, int strLen, IppsBigNumState* pBN))
-IPPAPI(IppStatus, ippsGetOctString_BN,(Ipp8u* pStr, int strLen, const IppsBigNumState* pBN))
-
-/*
-// Montgomery Operations
-*/
-IPPAPI(IppStatus, ippsMontGetSize,(IppsExpMethod method, int length, int* pSize))
-IPPAPI(IppStatus, ippsMontInit,(IppsExpMethod method, int length, IppsMontState* pCtx))
-IPPAPI(IppStatus, ippsMontSet,(const Ipp32u* pModulo, int size, IppsMontState* pCtx))
-IPPAPI(IppStatus, ippsMontMul, (const IppsBigNumState* pA, const IppsBigNumState* pB, IppsMontState* m, IppsBigNumState* pR))
-
-/*
-// PRNG
-*/
-IPPAPI(IppStatus, ippsPRNGGetSize,(int* pSize))
-IPPAPI(IppStatus, ippsPRNGInit,   (int seedBits, IppsPRNGState* pCtx))
-IPPAPI(IppStatus, ippsPRNGen,     (Ipp32u* pRand, int nBits, void* pCtx))
-
-/* 
-// Prime Number Generation
-*/
-IPPAPI(IppStatus, ippsPrimeGetSize,(int nMaxBits, int* pSize))
-IPPAPI(IppStatus, ippsPrimeInit,   (int nMaxBits, IppsPrimeState* pCtx))
-
-
-/*
-// RSA
-*/
-IPPAPI(IppStatus, ippsRSA_GetSizePublicKey,(int rsaModulusBitSize, int pubicExpBitSize, int* pKeySize))
-IPPAPI(IppStatus, ippsRSA_InitPublicKey,(int rsaModulusBitSize, int publicExpBitSize,
-                                         IppsRSAPublicKeyState* pKey, int keyCtxSize))
-IPPAPI(IppStatus, ippsRSA_SetPublicKey,(const IppsBigNumState* pModulus,
-                                        const IppsBigNumState* pPublicExp,
-                                        IppsRSAPublicKeyState* pKey))
-IPPAPI(IppStatus, ippsRSA_GetPublicKey,(IppsBigNumState* pModulus,
-                                        IppsBigNumState* pPublicExp,
-                                  const IppsRSAPublicKeyState* pKey))
-
-IPPAPI(IppStatus, ippsRSA_GetSizePrivateKeyType1,(int rsaModulusBitSize, int privateExpBitSize, int* pKeySize))
-IPPAPI(IppStatus, ippsRSA_InitPrivateKeyType1,(int rsaModulusBitSize, int privateExpBitSize,
-                                               IppsRSAPrivateKeyState* pKey, int keyCtxSize))
-IPPAPI(IppStatus, ippsRSA_SetPrivateKeyType1,(const IppsBigNumState* pModulus,
-                                              const IppsBigNumState* pPrivateExp,
-                                              IppsRSAPrivateKeyState* pKey))
-
-IPPAPI(IppStatus, ippsRSA_GetSizePrivateKeyType2,(int factorPbitSize, int factorQbitSize, int* pKeySize))
-IPPAPI(IppStatus, ippsRSA_InitPrivateKeyType2,(int factorPbitSize, int factorQbitSize,
-                                               IppsRSAPrivateKeyState* pKey, int keyCtxSize))
-IPPAPI(IppStatus, ippsRSA_SetPrivateKeyType2,(const IppsBigNumState* pFactorP,
-                                              const IppsBigNumState* pFactorQ,
-                                              const IppsBigNumState* pCrtExpP,
-                                              const IppsBigNumState* pCrtExpQ,
-                                              const IppsBigNumState* pInverseQ,
-                                              IppsRSAPrivateKeyState* pKey))
-
-IPPAPI(IppStatus, ippsRSA_GetBufferSizePublicKey,(int* pBufferSize, const IppsRSAPublicKeyState* pKey))
-IPPAPI(IppStatus, ippsRSA_GetBufferSizePrivateKey,(int* pBufferSize, const IppsRSAPrivateKeyState* pKey))
-
-IPPAPI(IppStatus, ippsRSA_Encrypt,(const IppsBigNumState* pPtxt,
-                                         IppsBigNumState* pCtxt,
-                                   const IppsRSAPublicKeyState* pKey,
-                                         Ipp8u* pScratchBuffer))
-IPPAPI(IppStatus, ippsRSA_Decrypt,(const IppsBigNumState* pCtxt,
-                                         IppsBigNumState* pPtxt,
-                                   const IppsRSAPrivateKeyState* pKey,
-                                         Ipp8u* pScratchBuffer))
-
-IPPAPI(IppStatus, ippsRSA_ValidateKeys,(int* pResult,
-                                 const IppsRSAPublicKeyState* pPublicKey,
-                                 const IppsRSAPrivateKeyState* pPrivateKeyType2,
-                                 const IppsRSAPrivateKeyState* pPrivateKeyType1,
-                                 Ipp8u* pScratchBuffer,
-                                 int nTrials,
-                                 IppsPrimeState* pPrimeGen,
-                                 IppBitSupplier rndFunc, void* pRndParam))
-
-/* encryption scheme: RSAES-OAEP */
-IPPAPI(IppStatus, ippsRSAEncrypt_OAEP,(const Ipp8u* pSrc, int srcLen,
-                                       const Ipp8u* pLabel, int labLen, 
-                                       const Ipp8u* pSeed,
-                                             Ipp8u* pDst,
-                                       const IppsRSAPublicKeyState* pKey,
-                                             IppHashAlgId hashAlg,
-                                             Ipp8u* pBuffer))
-IPPAPI(IppStatus, ippsRSA_OAEPEncrypt_SHA256,(const Ipp8u* pSrc, int srcLen,
-                                              const Ipp8u* pLabel, int labLen,
-                                              const Ipp8u* pSeed,
-                                              Ipp8u* pDst,
-                                              const IppsRSAPublicKeyState* pKey,
-                                              Ipp8u* pBuffer))
-
-/* signature scheme : RSA-SSA-PKCS1-v1_5 */
-IPPAPI(IppStatus, ippsRSASign_PKCS1v15,(const Ipp8u* pMsg, int msgLen,
-                                              Ipp8u* pSign,
-                                        const IppsRSAPrivateKeyState* pPrvKey,
-                                        const IppsRSAPublicKeyState*  pPubKey,
-                                              IppHashAlgId hashAlg,
-                                              Ipp8u* pBuffer))
-
-
-IPPAPI(IppStatus, ippsRSAVerify_PKCS1v15,(const Ipp8u* pMsg, int msgLen,
-                                          const Ipp8u* pSign, int* pIsValid,
-                                          const IppsRSAPublicKeyState* pKey,
-                                                IppHashAlgId hashAlg,
-                                                Ipp8u* pBuffer))
-
-
-/*
-// EC Cryptography
-*/
-IPPAPI(IppStatus, ippsECCPGetSize,(int feBitSize, int* pSize))
-IPPAPI(IppStatus, ippsECCPInit,(int feBitSize, IppsECCPState* pECC))
-
-IPPAPI(IppStatus, ippsECCPSet,(const IppsBigNumState* pPrime,
-                               const IppsBigNumState* pA, const IppsBigNumState* pB,
-                               const IppsBigNumState* pGX,const IppsBigNumState* pGY,const IppsBigNumState* pOrder,
-                               int cofactor,
-                               IppsECCPState* pECC))
-
-IPPAPI(IppStatus, ippsECCPSetStd,(IppECCType flag, IppsECCPState* pECC))
-
-
-IPPAPI(IppStatus, ippsECCPPointGetSize,(int feBitSize, int* pSize))
-IPPAPI(IppStatus, ippsECCPPointInit,(int feBitSize, IppsECCPPointState* pPoint))
-
-IPPAPI(IppStatus, ippsECCPSetPoint,(const IppsBigNumState* pX, const IppsBigNumState* pY,
-                                    IppsECCPPointState* pPoint, IppsECCPState* pECC))
-IPPAPI(IppStatus, ippsECCPSetPointAtInfinity,(IppsECCPPointState* pPoint, IppsECCPState* pECC))
-
-IPPAPI(IppStatus, ippsECCPGetPoint,(IppsBigNumState* pX, IppsBigNumState* pY,
-                                    const IppsECCPPointState* pPoint, IppsECCPState* pECC))
-
-IPPAPI(IppStatus, ippsECCPCheckPoint,(const IppsECCPPointState* pP,
-                                      IppECResult* pResult, IppsECCPState* pECC))
-IPPAPI(IppStatus, ippsECCPComparePoint,(const IppsECCPPointState* pP, const IppsECCPPointState* pQ,
-                                        IppECResult* pResult, IppsECCPState* pECC))
-IPPAPI(IppStatus, ippsECCPNegativePoint,(const IppsECCPPointState* pP,
-                                         IppsECCPPointState* pR, IppsECCPState* pECC))
-IPPAPI(IppStatus, ippsECCPAddPoint,(const IppsECCPPointState* pP, const IppsECCPPointState* pQ,
-                                    IppsECCPPointState* pR, IppsECCPState* pECC))
-IPPAPI(IppStatus, ippsECCPMulPointScalar,(const IppsECCPPointState* pP, const IppsBigNumState* pK,
-                                          IppsECCPPointState* pR, IppsECCPState* pECC))
-
-IPPAPI(IppStatus, ippsECCPGenKeyPair,(IppsBigNumState* pPrivate, IppsECCPPointState* pPublic,
-                                      IppsECCPState* pECC,
-                                      IppBitSupplier rndFunc, void* pRndParam))
-IPPAPI(IppStatus, ippsECCPPublicKey,(const IppsBigNumState* pPrivate,
-                                     IppsECCPPointState* pPublic,
-                                     IppsECCPState* pECC))
-IPPAPI(IppStatus, ippsECCPSetKeyPair,(const IppsBigNumState* pPrivate, const IppsECCPPointState* pPublic,
-                                      IppBool regular,
-                                      IppsECCPState* pECC))
-
-IPPAPI(IppStatus, ippsECCPSharedSecretDH,(const IppsBigNumState* pPrivateA,
-                                          const IppsECCPPointState* pPublicB,
-                                          IppsBigNumState* pShare,
-                                          IppsECCPState* pECC))
-
-IPPAPI(IppStatus, ippsECCPSignDSA,(const IppsBigNumState* pMsgDigest,
-                        const IppsBigNumState* pPrivate,
-                        IppsBigNumState* pSignX, IppsBigNumState* pSignY,
-                        IppsECCPState* pECC))
-IPPAPI(IppStatus, ippsECCPVerifyDSA,(const IppsBigNumState* pMsgDigest,
-                        const IppsBigNumState* pSignX, const IppsBigNumState* pSignY,
-                        IppECResult* pResult,
-                        IppsECCPState* pECC))
-
-#ifdef  __cplusplus
-}
-#endif
-
-#if defined (_IPP_STDCALL_CDECL)
-  #undef  _IPP_STDCALL_CDECL
-  #define __stdcall __cdecl
-#endif
-
-#endif /* __IPPCP_H__ */

+ 0 - 211
external/crypto_px/include/ippcpdefs.h

@@ -1,211 +0,0 @@
-/*
-* Copyright (C) 2016 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 __IPPCPDEFS_H__
-#define __IPPCPDEFS_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
-// AES
-*/
-#define IPP_AES_BLOCK_BITSIZE (128) /* cipher blocksizes (bits) */
-
-typedef enum {                      /* cipher keysizes (bits) */
-   ippRijndaelKey128 = 128, IppsRijndaelKey128 = 128, /* 128-bit key */
-   ippRijndaelKey192 = 192, IppsRijndaelKey192 = 192, /* 192-bit key */
-   ippRijndaelKey256 = 256, IppsRijndaelKey256 = 256  /* 256-bit key */
-} IppsRijndaelKeyLength;
-
-typedef struct _cpRijndael128 IppsAESSpec;
-typedef struct _cpAES_GCM     IppsAES_GCMState;
-typedef struct _cpAES_CMAC    IppsAES_CMACState;
-
-
-/*
-// hash
-*/
-typedef enum {
-   ippHashAlg_Unknown,
-   ippHashAlg_SHA1,
-   ippHashAlg_SHA256,
-   ippHashAlg_SHA224,
-   ippHashAlg_SHA512,
-   ippHashAlg_SHA384,
-   ippHashAlg_MD5,
-   ippHashAlg_SHA512_224,
-   ippHashAlg_SHA512_256,
-   ippHashAlg_MaxNo
-} IppHashAlgId;
-
-#define IPP_ALG_HASH_UNKNOWN     (ippHashAlg_Unknown) /* unknown  */
-#define IPP_ALG_HASH_SHA1        (ippHashAlg_SHA1)    /* SHA1     */
-#define IPP_ALG_HASH_SHA256      (ippHashAlg_SHA256)  /* SHA256   */
-#define IPP_ALG_HASH_SHA224      (ippHashAlg_SHA224)  /* SHA224 or SHA256/224 */
-#define IPP_ALG_HASH_SHA512      (ippHashAlg_SHA512)  /* SHA512   */
-#define IPP_ALG_HASH_SHA384      (ippHashAlg_SHA384)  /* SHA384 or SHA512/384 */
-#define IPP_ALG_HASH_MD5         (ippHashAlg_MD5)     /* MD5      */
-#define IPP_ALG_HASH_SHA512_224  (ippHashAlg_SHA512_224) /* SHA512/224 */
-#define IPP_ALG_HASH_SHA512_256  (ippHashAlg_SHA512_256) /* SHA512/256 */
-#define IPP_ALG_HASH_LIMIT       (ippHashAlg_MaxNo)   /* hash alg limiter*/
-
-#define IPP_SHA1_DIGEST_BITSIZE        160   /* digest size (bits) */
-#define IPP_SHA256_DIGEST_BITSIZE      256
-#define IPP_SHA224_DIGEST_BITSIZE      224
-#define IPP_SHA384_DIGEST_BITSIZE      384
-#define IPP_SHA512_DIGEST_BITSIZE      512
-#define IPP_MD5_DIGEST_BITSIZE         128
-#define IPP_SHA512_224_DIGEST_BITSIZE  224
-#define IPP_SHA512_256_DIGEST_BITSIZE  256
-
-typedef struct _cpHashCtx  IppsHashState;
-typedef struct _cpHMAC  IppsHMACState;
-
-
-/*
-// Big Number Integer Arithmetic
-*/
-#define BN_MAXBITSIZE      (16*1024)   /* bn max size (bits) */
-
-/* operation results */
-#define IPP_IS_EQ (0)
-#define IPP_IS_GT (1)
-#define IPP_IS_LT (2)
-#define IPP_IS_NE (3)
-#define IPP_IS_NA (4)
-
-#define IPP_IS_PRIME       (5)
-#define IPP_IS_COMPOSITE   (6)
-
-#define IPP_IS_VALID       (7)
-#define IPP_IS_INVALID     (8)
-#define IPP_IS_INCOMPLETE  (9)
-#define IPP_IS_ATINFINITY  (10)
-
-#define IS_ZERO            IPP_IS_EQ
-#define GREATER_THAN_ZERO  IPP_IS_GT
-#define LESS_THAN_ZERO     IPP_IS_LT
-#define IS_PRIME           IPP_IS_PRIME
-#define IS_COMPOSITE       IPP_IS_COMPOSITE
-#define IS_VALID_KEY       IPP_IS_VALID
-#define IS_INVALID_KEY     IPP_IS_INVALID
-#define IS_INCOMPLETED_KEY IPP_IS_INCOMPLETE
-
-typedef enum {
-   ippBigNumNEG = 0, IppsBigNumNEG = 0,
-   ippBigNumPOS = 1, IppsBigNumPOS = 1
-} IppsBigNumSGN;
-
-typedef enum {
-   ippBinaryMethod   = 0, IppsBinaryMethod = 0,
-   ippSlidingWindows = 1, IppsSlidingWindows = 1
-} IppsExpMethod;
-
-typedef struct _cpBigNum      IppsBigNumState;
-typedef struct _cpMontgomery  IppsMontState;
-typedef struct _cpPRNG        IppsPRNGState;
-typedef struct _cpPrime       IppsPrimeState;
-
-/*  External Bit Supplier */
-typedef IppStatus (__STDCALL *IppBitSupplier)(Ipp32u* pRand, int nBits, void* pEbsParams);
-
-
-/*
-// RSA
-*/
-#define MIN_RSA_SIZE (8)
-#define MAX_RSA_SIZE (4096)
-
-typedef struct _cpRSA               IppsRSAState;
-typedef struct _cpRSA_public_key    IppsRSAPublicKeyState;
-typedef struct _cpRSA_private_key   IppsRSAPrivateKeyState;
-
-
-/*
-// EC Cryptography
-*/
-#define EC_GFP_MAXBITSIZE   (1024)
-
-typedef struct _cpECCP      IppsECCPState;
-typedef struct _cpECCPPoint IppsECCPPointState;
-
-/* operation result */
-typedef enum {
-   ippECValid,             /* validation pass successfully     */
-
-   ippECCompositeBase,     /* field based on composite         */
-   ippECComplicatedBase,   /* number of non-zero terms in the polynomial (> PRIME_ARR_MAX) */
-   ippECIsZeroDiscriminant,/* zero discriminant */
-   ippECCompositeOrder,    /* composite order of base point    */
-   ippECInvalidOrder,      /* invalid base point order         */
-   ippECIsWeakMOV,         /* weak Meneze-Okamoto-Vanstone  reduction attack */
-   ippECIsWeakSSSA,        /* weak Semaev-Smart,Satoh-Araki reduction attack */
-   ippECIsSupersingular,   /* supersingular curve */
-
-   ippECInvalidPrivateKey, /* !(0 < Private < order) */
-   ippECInvalidPublicKey,  /* (order*PublicKey != Infinity)    */
-   ippECInvalidKeyPair,    /* (Private*BasePoint != PublicKey) */
-
-   ippECPointOutOfGroup,   /* out of group (order*P != Infinity)  */
-   ippECPointIsAtInfinite, /* point (P=(Px,Py)) at Infinity  */
-   ippECPointIsNotValid,   /* point (P=(Px,Py)) out-of EC    */
-
-   ippECPointIsEqual,      /* compared points are equal     */
-   ippECPointIsNotEqual,   /* compared points are different  */
-
-   ippECInvalidSignature   /* invalid signature */
-} IppECResult;
-
-typedef enum {
-   ippECarbitrary =0x00000,        IppECCArbitrary = 0x00000,       /* arbitrary ECC */
-
-   ippECPstd      = 0x10000,       IppECCPStd      = 0x10000,       /* random (recommended) EC over FG(p): */
-   ippECPstd112r1 = ippECPstd,     IppECCPStd112r1 = IppECCPStd,    /* secp112r1 curve */
-   ippECPstd112r2 = ippECPstd+1,   IppECCPStd112r2 = IppECCPStd+1,  /* secp112r2 curve */
-   ippECPstd128r1 = ippECPstd+2,   IppECCPStd128r1 = IppECCPStd+2,  /* secp128r1 curve */
-   ippECPstd128r2 = ippECPstd+3,   IppECCPStd128r2 = IppECCPStd+3,  /* secp128r2 curve */
-   ippECPstd160r1 = ippECPstd+4,   IppECCPStd160r1 = IppECCPStd+4,  /* secp160r1 curve */
-   ippECPstd160r2 = ippECPstd+5,   IppECCPStd160r2 = IppECCPStd+5,  /* secp160r2 curve */
-   ippECPstd192r1 = ippECPstd+6,   IppECCPStd192r1 = IppECCPStd+6,  /* secp192r1 curve */
-   ippECPstd224r1 = ippECPstd+7,   IppECCPStd224r1 = IppECCPStd+7,  /* secp224r1 curve */
-   ippECPstd256r1 = ippECPstd+8,   IppECCPStd256r1 = IppECCPStd+8,  /* secp256r1 curve */
-   ippECPstd384r1 = ippECPstd+9,   IppECCPStd384r1 = IppECCPStd+9,  /* secp384r1 curve */
-   ippECPstd521r1 = ippECPstd+10,  IppECCPStd521r1 = IppECCPStd+10, /* secp521r1 curve */
-} IppsECType, IppECCType;
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __IPPCPDEFS_H__ */

+ 0 - 129
external/crypto_px/include/ippdefs.h

@@ -1,129 +0,0 @@
-/*
-* Copyright (C) 2016 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 __IPPDEFS_H__
-#define __IPPDEFS_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-#if defined (_WIN64)
-#define _INTEL_PLATFORM "intel64/"
-#elif defined (_WIN32)
-#define _INTEL_PLATFORM "ia32/"
-#endif
-
-#if !defined( IPPAPI )
-
-  #if defined( IPP_W32DLL ) && (defined( _WIN32 ) || defined( _WIN64 ))
-    #if defined( _MSC_VER ) || defined( __ICL )
-      #define IPPAPI( type,name,arg ) \
-                     __declspec(dllimport)   type __STDCALL name arg;
-    #else
-      #define IPPAPI( type,name,arg )        type __STDCALL name arg;
-    #endif
-  #else
-    #define   IPPAPI( type,name,arg )        type __STDCALL name arg;
-  #endif
-
-#endif
-
-#if (defined( __ICL ) || defined( __ECL ) || defined(_MSC_VER)) && !defined( _PCS ) && !defined( _PCS_GENSTUBS )
-  #if( __INTEL_COMPILER >= 1100 ) /* icl 11.0 supports additional comment */
-    #if( _MSC_VER >= 1400 )
-      #define IPP_DEPRECATED( comment ) __declspec( deprecated ( comment ))
-    #else
-      #pragma message ("your icl version supports additional comment for deprecated functions but it can't be displayed")
-      #pragma message ("because internal _MSC_VER macro variable setting requires compatibility with MSVC7.1")
-      #pragma message ("use -Qvc8 switch for icl command line to see these additional comments")
-      #define IPP_DEPRECATED( comment ) __declspec( deprecated )
-    #endif
-  #elif( _MSC_FULL_VER >= 140050727 )&&( !defined( __INTEL_COMPILER )) /* VS2005 supports additional comment */
-    #define IPP_DEPRECATED( comment ) __declspec( deprecated ( comment ))
-  #elif( _MSC_VER <= 1200 )&&( !defined( __INTEL_COMPILER )) /* VS 6 doesn't support deprecation */
-    #define IPP_DEPRECATED( comment )
-  #else
-    #define IPP_DEPRECATED( comment ) __declspec( deprecated )
-  #endif
-#elif (defined(__ICC) || defined(__ECC) || defined( __GNUC__ )) && !defined( _PCS ) && !defined( _PCS_GENSTUBS )
-  #if defined( __GNUC__ )
-    #if __GNUC__ >= 4 && __GNUC_MINOR__ >= 5
-      #define IPP_DEPRECATED( message ) __attribute__(( deprecated( message )))
-    #else
-      #define IPP_DEPRECATED( message ) __attribute__(( deprecated ))
-    #endif
-  #else
-    #define IPP_DEPRECATED( comment ) __attribute__(( deprecated ))
-  #endif
-#else
-  #define IPP_DEPRECATED( comment )
-#endif
-
-#if (defined( __ICL ) || defined( __ECL ) || defined(_MSC_VER))
-  #if !defined( _IPP_NO_DEFAULT_LIB )
-    #if  (( defined( _IPP_PARALLEL_DYNAMIC ) && !defined( _IPP_PARALLEL_STATIC ) && !defined( _IPP_SEQUENTIAL_DYNAMIC ) && !defined( _IPP_SEQUENTIAL_STATIC )) || \
-          (!defined( _IPP_PARALLEL_DYNAMIC ) &&  defined( _IPP_PARALLEL_STATIC ) && !defined( _IPP_SEQUENTIAL_DYNAMIC ) && !defined( _IPP_SEQUENTIAL_STATIC )) || \
-          (!defined( _IPP_PARALLEL_DYNAMIC ) && !defined( _IPP_PARALLEL_STATIC ) &&  defined( _IPP_SEQUENTIAL_DYNAMIC ) && !defined( _IPP_SEQUENTIAL_STATIC )) || \
-          (!defined( _IPP_PARALLEL_DYNAMIC ) && !defined( _IPP_PARALLEL_STATIC ) && !defined( _IPP_SEQUENTIAL_DYNAMIC ) &&  defined( _IPP_SEQUENTIAL_STATIC )))
-    #elif (!defined( _IPP_PARALLEL_DYNAMIC ) && !defined( _IPP_PARALLEL_STATIC ) && !defined( _IPP_SEQUENTIAL_DYNAMIC ) && !defined( _IPP_SEQUENTIAL_STATIC ))
-      #define _IPP_NO_DEFAULT_LIB
-    #else
-      #error Illegal combination of _IPP_PARALLEL_DYNAMIC/_IPP_PARALLEL_STATIC/_IPP_SEQUENTIAL_DYNAMIC/_IPP_SEQUENTIAL_STATIC, only one definition can be defined
-    #endif
-  #endif
-#else
-  #define _IPP_NO_DEFAULT_LIB
-  #if (defined( _IPP_PARALLEL_DYNAMIC ) || defined( _IPP_PARALLEL_STATIC ) || defined(_IPP_SEQUENTIAL_DYNAMIC) || defined(_IPP_SEQUENTIAL_STATIC))
-    #pragma message ("defines _IPP_PARALLEL_DYNAMIC/_IPP_PARALLEL_STATIC/_IPP_SEQUENTIAL_DYNAMIC/_IPP_SEQUENTIAL_STATIC do not have any effect in current configuration")
-  #endif
-#endif
-
-#if !defined( _IPP_NO_DEFAULT_LIB )
-  #if defined( _IPP_PARALLEL_STATIC )
-    #pragma comment( lib, "libircmt" )
-    #pragma comment( lib, "libmmt" )
-    #pragma comment( lib, "svml_dispmt" )
-    #pragma comment( lib, "libiomp5md" )
-  #endif
-#endif
-
-#include "ippbase.h"
-#include "ipptypes.h"
-
-extern const IppiRect ippRectInfinite;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __IPPDEFS_H__ */

+ 0 - 1104
external/crypto_px/include/ipptypes.h

@@ -1,1104 +0,0 @@
-/*
-* Copyright (C) 2016 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 __IPPTYPES_H__
-#define __IPPTYPES_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*****************************************************************************/
-/*                   Below are ippCore domain specific definitions           */
-/*****************************************************************************/
-#if !defined( _OWN_BLDPCS )
-
-#define   ippCPUID_MMX        0x00000001   /* Intel Architecture MMX technology supported  */
-#define   ippCPUID_SSE        0x00000002   /* Streaming SIMD Extensions                    */
-#define   ippCPUID_SSE2       0x00000004   /* Streaming SIMD Extensions 2                  */
-#define   ippCPUID_SSE3       0x00000008   /* Streaming SIMD Extensions 3                  */
-#define   ippCPUID_SSSE3      0x00000010   /* Supplemental Streaming SIMD Extensions 3     */
-#define   ippCPUID_MOVBE      0x00000020   /* The processor supports MOVBE instruction     */
-#define   ippCPUID_SSE41      0x00000040   /* Streaming SIMD Extensions 4.1                */
-#define   ippCPUID_SSE42      0x00000080   /* Streaming SIMD Extensions 4.2                */
-#define   ippCPUID_AVX        0x00000100   /* Advanced Vector Extensions instruction set   */
-#define   ippAVX_ENABLEDBYOS  0x00000200   /* The operating system supports AVX            */
-#define   ippCPUID_AES        0x00000400   /* AES instruction                              */
-#define   ippCPUID_CLMUL      0x00000800   /* PCLMULQDQ instruction                        */
-#define   ippCPUID_ABR        0x00001000   /* Reserved                                     */
-#define   ippCPUID_RDRAND     0x00002000   /* Read Random Number instructions              */
-#define   ippCPUID_F16C       0x00004000   /* Float16 instructions                         */
-#define   ippCPUID_AVX2       0x00008000   /* Advanced Vector Extensions 2 instruction set */
-#define   ippCPUID_ADCOX      0x00010000   /* ADCX and ADOX instructions                   */
-#define   ippCPUID_RDSEED     0x00020000   /* The RDSEED instruction                       */
-#define   ippCPUID_PREFETCHW  0x00040000   /* The PREFETCHW instruction                    */
-#define   ippCPUID_SHA        0x00080000   /* Intel (R) SHA Extensions                     */
-#define   ippCPUID_AVX512F    0x00100000   /* AVX-512 Foundation instructions              */
-#define   ippCPUID_AVX512CD   0x00200000   /* AVX-512 Conflict Detection instructions      */
-#define   ippCPUID_AVX512ER   0x00400000   /* AVX-512 Exponential & Reciprocal instructions*/
-#define   ippCPUID_AVX512PF   0x00800000   /* AVX-512 Prefetch instructions                */
-#define   ippCPUID_AVX512BW   0x01000000   /* AVX-512 Byte & Word instructions             */
-#define   ippCPUID_AVX512DQ   0x02000000   /* AVX-512 DWord & QWord instructions           */
-#define   ippCPUID_AVX512VL   0x04000000   /* AVX-512 Vector Length extensions             */
-#define   ippCPUID_KNC        0x80000000   /* Intel(R) Xeon Phi(TM) Coprocessor            */
-#if defined( _WIN32 ) || defined ( _WIN64 )
-  #define   ippCPUID_NOCHECK    0x8000000000000000L   /* Force ippSetCpuFeatures to set CPU features without check */
-#else
-  #define   ippCPUID_NOCHECK    0x8000000000000000LL
-#endif
-
-#if defined( _WIN32 ) || defined ( _WIN64 )
-  #define   ippCPUID_GETINFO_A  0x616f666e69746567L   /* Force ipp_GetCpuFeatures to work as cpuid instruction */
-#else
-  #define   ippCPUID_GETINFO_A  0x616f666e69746567LL
-#endif
-
-#define IPP_COUNT_OF( obj )  (sizeof(obj)/sizeof(obj[0]))
-
-/*****************************************************************************/
-/*                   Below are ippSP domain specific definitions             */
-/*****************************************************************************/
-typedef enum {
-    ippRndZero,
-    ippRndNear,
-    ippRndFinancial,
-    ippRndHintAccurate=0x10
-} IppRoundMode;
-
-
-typedef enum {
-    ippAlgHintNone,
-    ippAlgHintFast,
-    ippAlgHintAccurate
-} IppHintAlgorithm;
-
-typedef enum {
-    ippCmpLess,
-    ippCmpLessEq,
-    ippCmpEq,
-    ippCmpGreaterEq,
-    ippCmpGreater
-} IppCmpOp;
-
-typedef enum {
-    ippAlgAuto    = 0x00000000,
-    ippAlgDirect  = 0x00000001,
-    ippAlgFFT     = 0x00000002,
-    ippAlgMask    = 0x000000FF
-} IppAlgType;
-
-typedef enum {
-    ippsNormNone  = 0x00000000, /* default */
-    ippsNormA     = 0x00000100, /* biased normalization */
-    ippsNormB     = 0x00000200, /* unbiased normalization */
-    ippsNormMask  = 0x0000FF00
-} IppsNormOp;
-
-typedef enum {
-    ippNormInf  =   0x00000001,
-    ippNormL1   =   0x00000002,
-    ippNormL2   =   0x00000004
-} IppNormType;
-
-enum {
-    IPP_FFT_DIV_FWD_BY_N = 1,
-    IPP_FFT_DIV_INV_BY_N = 2,
-    IPP_FFT_DIV_BY_SQRTN = 4,
-    IPP_FFT_NODIV_BY_ANY = 8
-};
-
-enum {
-    IPP_DIV_FWD_BY_N = 1,
-    IPP_DIV_INV_BY_N = 2,
-    IPP_DIV_BY_SQRTN = 4,
-    IPP_NODIV_BY_ANY = 8
-};
-
-typedef struct {
-    Ipp32f rho;
-    Ipp32f theta;
-} IppPointPolar;
-
-typedef enum {ippWinBartlett,ippWinBlackman,ippWinHamming,ippWinHann,ippWinRect} IppWinType;
-
-typedef enum { ippButterworth, ippChebyshev1 } IppsIIRFilterType;
-
-typedef enum  { ippZCR=0,   ippZCXor,   ippZCC } IppsZCType;
-
-#if !defined( _OWN_BLDPCS )
-
-typedef struct {
-    int left;
-    int right;
-} IppsROI;
-
-typedef struct RandUniState_8u IppsRandUniState_8u;
-typedef struct RandUniState_16s IppsRandUniState_16s;
-typedef struct RandUniState_32f IppsRandUniState_32f;
-typedef struct RandUniState_64f IppsRandUniState_64f;
-
-typedef struct RandGaussState_8u IppsRandGaussState_8u;
-typedef struct RandGaussState_16s IppsRandGaussState_16s;
-typedef struct RandGaussState_32f IppsRandGaussState_32f;
-typedef struct RandGaussState_64f IppsRandGaussState_64f;
-
-typedef struct FFTSpec_C_32fc   IppsFFTSpec_C_32fc;
-typedef struct FFTSpec_C_32f    IppsFFTSpec_C_32f;
-typedef struct FFTSpec_R_32f    IppsFFTSpec_R_32f;
-
-typedef struct FFTSpec_C_64fc   IppsFFTSpec_C_64fc;
-typedef struct FFTSpec_C_64f    IppsFFTSpec_C_64f;
-typedef struct FFTSpec_R_64f    IppsFFTSpec_R_64f;
-
-typedef struct DFTSpec_C_32fc       IppsDFTSpec_C_32fc;
-typedef struct DFTSpec_C_32f        IppsDFTSpec_C_32f;
-typedef struct DFTSpec_R_32f        IppsDFTSpec_R_32f;
-
-typedef struct DFTSpec_C_64fc       IppsDFTSpec_C_64fc;
-typedef struct DFTSpec_C_64f        IppsDFTSpec_C_64f;
-typedef struct DFTSpec_R_64f        IppsDFTSpec_R_64f;
-
-typedef struct DCTFwdSpec_32f IppsDCTFwdSpec_32f;
-typedef struct DCTInvSpec_32f IppsDCTInvSpec_32f;
-
-typedef struct DCTFwdSpec_64f IppsDCTFwdSpec_64f;
-typedef struct DCTInvSpec_64f IppsDCTInvSpec_64f;
-
-typedef struct sWTFwdState_32f    IppsWTFwdState_32f;
-typedef struct sWTFwdState_8u32f  IppsWTFwdState_8u32f;
-typedef struct sWTFwdState_16s32f IppsWTFwdState_16s32f;
-typedef struct sWTFwdState_16u32f IppsWTFwdState_16u32f;
-typedef struct sWTInvState_32f    IppsWTInvState_32f;
-typedef struct sWTInvState_32f8u  IppsWTInvState_32f8u;
-typedef struct sWTInvState_32f16s IppsWTInvState_32f16s;
-typedef struct sWTInvState_32f16u IppsWTInvState_32f16u;
-
-typedef struct IIRState_32f      IppsIIRState_32f;
-typedef struct IIRState_32fc     IppsIIRState_32fc;
-typedef struct IIRState32f_16s   IppsIIRState32f_16s;
-typedef struct IIRState32fc_16sc IppsIIRState32fc_16sc;
-typedef struct IIRState_64f      IppsIIRState_64f;
-typedef struct IIRState_64fc     IppsIIRState_64fc;
-typedef struct IIRState64f_32f   IppsIIRState64f_32f;
-typedef struct IIRState64fc_32fc IppsIIRState64fc_32fc;
-typedef struct IIRState64f_32s   IppsIIRState64f_32s;
-typedef struct IIRState64fc_32sc IppsIIRState64fc_32sc;
-typedef struct IIRState64f_16s   IppsIIRState64f_16s;
-typedef struct IIRState64fc_16sc IppsIIRState64fc_16sc;
-
-typedef struct FIRSpec_32f        IppsFIRSpec_32f;
-typedef struct FIRSpec_64f        IppsFIRSpec_64f;
-typedef struct FIRSpec_32fc       IppsFIRSpec_32fc;
-typedef struct FIRSpec_64fc       IppsFIRSpec_64fc;
-
-typedef struct FIRLMSState_32f    IppsFIRLMSState_32f;
-typedef struct FIRLMSState32f_16s IppsFIRLMSState32f_16s;
-
-typedef struct HilbertSpec IppsHilbertSpec;
-
-typedef struct FIRSparseState_32f IppsFIRSparseState_32f;
-typedef struct IIRSparseState_32f IppsIIRSparseState_32f;
-
-typedef struct ResamplingPolyphase_16s      IppsResamplingPolyphase_16s;
-typedef struct ResamplingPolyphaseFixed_16s IppsResamplingPolyphaseFixed_16s;
-typedef struct ResamplingPolyphase_32f      IppsResamplingPolyphase_32f;
-typedef struct ResamplingPolyphaseFixed_32f IppsResamplingPolyphaseFixed_32f;
-
-#endif /* _OWN_BLDPCS */
-
-/*****************************************************************************/
-/*                   Below are ippIP domain specific definitions             */
-/*****************************************************************************/
-#define IPP_TEMPORAL_COPY      0x0
-#define IPP_NONTEMPORAL_STORE  0x01
-#define IPP_NONTEMPORAL_LOAD   0x02
-
-typedef int IppEnum;
-
-#define IPP_DEG_TO_RAD( deg ) ( (deg)/180.0 * IPP_PI )
-
-typedef enum {
-    ippiNormNone        = 0x00000000, /* default */
-    ippiNorm            = 0x00000100, /* normalized form */
-    ippiNormCoefficient = 0x00000200, /* correlation coefficient in the range [-1.0 ... 1.0] */
-    ippiNormMask        = 0x0000FF00
-} IppiNormOp;
-
-typedef enum {
-   ippiROIFull   = 0x00000000,
-   ippiROIValid  = 0x00010000,
-   ippiROISame   = 0x00020000,
-   ippiROIMask   = 0x00FF0000
-} IppiROIShape;
-
-typedef enum {
-   ippC0    =  0,
-   ippC1    =  1,
-   ippC2    =  2,
-   ippC3    =  3,
-   ippC4    =  4,
-   ippP2    =  5,
-   ippP3    =  6,
-   ippP4    =  7,
-   ippAC1   =  8,
-   ippAC4   =  9,
-   ippA0C4  = 10,
-   ippAP4   = 11
-} IppChannels;
-
-typedef enum _IppiBorderType {
-    ippBorderConst     =  0,
-    ippBorderRepl      =  1,
-    ippBorderWrap      =  2,
-    ippBorderMirror    =  3, /* left border: 012... -> 21012... */
-    ippBorderMirrorR   =  4, /* left border: 012... -> 210012... */
-    ippBorderInMem     =  6,
-    ippBorderTransp    =  7,
-    ippBorderInMemTop     =  0x0010,
-    ippBorderInMemBottom  =  0x0020,
-    ippBorderInMemLeft    =  0x0040,
-    ippBorderInMemRight   =  0x0080
-} IppiBorderType;
-
-typedef enum {
-    ippAxsHorizontal,
-    ippAxsVertical,
-    ippAxsBoth,
-    ippAxs45,
-    ippAxs135
-} IppiAxis;
-
-typedef struct {
-    int x;
-    int y;
-    int width;
-    int height;
-} IppiRect;
-
-typedef struct {
-    int x;
-    int y;
-} IppiPoint;
-
-typedef struct {
-    int width;
-    int height;
-} IppiSize;
-
-typedef struct {
-    Ipp32f x;
-    Ipp32f y;
-} IppiPoint_32f;
-
-typedef enum  _IppiMaskSize {
-    ippMskSize1x3 = 13,
-    ippMskSize1x5 = 15,
-    ippMskSize3x1 = 31,
-    ippMskSize3x3 = 33,
-    ippMskSize5x1 = 51,
-    ippMskSize5x5 = 55
-} IppiMaskSize;
-
-enum {
-    IPPI_INTER_NN     = 1,
-    IPPI_INTER_LINEAR = 2,
-    IPPI_INTER_CUBIC  = 4,
-    IPPI_INTER_CUBIC2P_BSPLINE,     /* two-parameter cubic filter (B=1, C=0) */
-    IPPI_INTER_CUBIC2P_CATMULLROM,  /* two-parameter cubic filter (B=0, C=1/2) */
-    IPPI_INTER_CUBIC2P_B05C03,      /* two-parameter cubic filter (B=1/2, C=3/10) */
-    IPPI_INTER_SUPER  = 8,
-    IPPI_INTER_LANCZOS = 16,
-    IPPI_ANTIALIASING  = (1 << 29),
-    IPPI_SUBPIXEL_EDGE = (1 << 30),
-    IPPI_SMOOTH_EDGE   = (1 << 31)
-};
-
-typedef enum {
-    ippNearest = IPPI_INTER_NN,
-    ippLinear = IPPI_INTER_LINEAR,
-    ippCubic = IPPI_INTER_CUBIC2P_CATMULLROM,
-    ippLanczos = IPPI_INTER_LANCZOS,
-    ippHahn = 0,
-    ippSuper = IPPI_INTER_SUPER
-} IppiInterpolationType;
-
-typedef enum {
-    ippPolyphase_1_2,
-    ippPolyphase_3_5,
-    ippPolyphase_2_3,
-    ippPolyphase_7_10,
-    ippPolyphase_3_4
-} IppiFraction;
-
-enum {
-    IPP_FASTN_ORIENTATION = 0x0001,
-    IPP_FASTN_NMS         = 0x0002,
-    IPP_FASTN_CIRCLE      = 0X0004,
-    IPP_FASTN_SCORE_MODE0 = 0X0020
-};
-
-#if !defined( _OWN_BLDPCS )
-
-typedef enum {
-    ippAlphaOver,
-    ippAlphaIn,
-    ippAlphaOut,
-    ippAlphaATop,
-    ippAlphaXor,
-    ippAlphaPlus,
-    ippAlphaOverPremul,
-    ippAlphaInPremul,
-    ippAlphaOutPremul,
-    ippAlphaATopPremul,
-    ippAlphaXorPremul,
-    ippAlphaPlusPremul
-} IppiAlphaType;
-
-typedef struct DeconvFFTState_32f_C1R IppiDeconvFFTState_32f_C1R;
-typedef struct DeconvFFTState_32f_C3R IppiDeconvFFTState_32f_C3R;
-typedef struct DeconvLR_32f_C1R IppiDeconvLR_32f_C1R;
-typedef struct DeconvLR_32f_C3R IppiDeconvLR_32f_C3R;
-
-typedef enum {
-    ippiFilterBilateralGauss = 100,
-    ippiFilterBilateralGaussFast = 101
-} IppiFilterBilateralType;
-
-typedef struct FilterBilateralSpec IppiFilterBilateralSpec;
-
-typedef enum {
-    ippDistNormL1   =   0x00000002
-} IppiDistanceMethodType;
-
-typedef enum {
-    ippResizeFilterHann,
-    ippResizeFilterLanczos
-} IppiResizeFilterType;
-
-typedef struct ResizeFilterState IppiResizeFilterState;
-
-typedef struct {
-    Ipp32u borderLeft;
-    Ipp32u borderTop;
-    Ipp32u borderRight;
-    Ipp32u borderBottom;
-} IppiBorderSize;
-
-typedef enum {
-    ippWarpForward,
-    ippWarpBackward,
-} IppiWarpDirection;
-
-typedef enum {
-    ippWarpAffine,
-    ippWarpPerspective,
-    ippWarpBilinear,
-} IppiWarpTransformType;
-
-
-typedef struct ResizeSpec_32f   IppiResizeSpec_32f;
-typedef struct ResizeYUV422Spec IppiResizeYUV422Spec;
-typedef struct ResizeYUV420Spec IppiResizeYUV420Spec;
-
-typedef struct ResizeSpec_64f   IppiResizeSpec_64f;
-
-typedef struct IppiWarpSpec     IppiWarpSpec;
-
-typedef struct FilterBorderSpec IppiFilterBorderSpec;
-
-typedef struct ThresholdAdaptiveSpec IppiThresholdAdaptiveSpec;
-
-typedef struct HistogramSpec IppiHistogramSpec;
-
-typedef struct {
-   int   cvCompatible;  /* openCV compatible output format */
-   int   cellSize;      /* squre cell size (pixels) */
-   int   blockSize;     /* square block size (pixels) */
-   int   blockStride;   /* block displacement (the same for x- and y- directions) */
-   int   nbins;         /* required number of bins */
-   Ipp32f   sigma;      /* gaussian factor of HOG block weights */
-   Ipp32f   l2thresh;   /* normalization factor */
-   IppiSize winSize;    /* detection window size (pixels) */
-} IppiHOGConfig;
-
-typedef struct FFT2DSpec_C_32fc IppiFFTSpec_C_32fc;
-typedef struct FFT2DSpec_R_32f IppiFFTSpec_R_32f;
-
-typedef struct DFT2DSpec_C_32fc IppiDFTSpec_C_32fc;
-typedef struct DFT2DSpec_R_32f IppiDFTSpec_R_32f;
-
-typedef struct DCT2DFwdSpec_32f IppiDCTFwdSpec_32f;
-typedef struct DCT2DInvSpec_32f IppiDCTInvSpec_32f;
-
-typedef struct iWTFwdSpec_32f_C1R IppiWTFwdSpec_32f_C1R;
-typedef struct iWTInvSpec_32f_C1R IppiWTInvSpec_32f_C1R;
-typedef struct iWTFwdSpec_32f_C3R IppiWTFwdSpec_32f_C3R;
-typedef struct iWTInvSpec_32f_C3R IppiWTInvSpec_32f_C3R;
-
-typedef struct MomentState64f IppiMomentState_64f;
-typedef Ipp64f IppiHuMoment_64f[7];
-
-typedef struct LUT_Spec IppiLUT_Spec;
-
-#define IPP_HOG_MAX_CELL   (16)  /* max size of CELL */
-#define IPP_HOG_MAX_BLOCK  (64)  /* max size of BLOCK */
-#define IPP_HOG_MAX_BINS   (16)  /* max number of BINS */
-
-typedef struct _ipHOG   IppiHOGSpec;
-
-#endif /* _OWN_BLDPCS */
-
-
-         /**** Below are 3D Image (Volume) Processing specific definitions ****/
-
-typedef struct {
-    int width;
-    int height;
-    int depth;
-} IpprVolume;
-
-typedef struct {
-    int x;
-    int y;
-    int z;
-    int width;
-    int height;
-    int depth;
-} IpprCuboid;
-
-typedef struct {
-    int x;
-    int y;
-    int z;
-} IpprPoint;
-
-/*****************************************************************************/
-/*                   Below are ippCV domain specific definitions             */
-/*****************************************************************************/
-
-typedef enum _IppiDifferentialKernel
-{
-    ippFilterSobelVert,
-    ippFilterSobelHoriz,
-    ippFilterSobel,
-    ippFilterScharrVert,
-    ippFilterScharrHoriz,
-    ippFilterScharr,
-    ippFilterCentralDiffVert,
-    ippFilterCentralDiffHoriz,
-    ippFilterCentralDiff,
-}IppiDifferentialKernel;
-
-#if !defined( _OWN_BLDPCS )
-
-typedef enum _IppiKernelType {
-    ippKernelSobel     =  0,
-    ippKernelScharr    =  1,
-    ippKernelSobelNeg  =  2
-} IppiKernelType;
-
-typedef enum _IppiNorm {
-    ippiNormInf = 0,
-    ippiNormL1 = 1,
-    ippiNormL2 = 2,
-    ippiNormFM = 3
-} IppiNorm;
-
-typedef struct ipcvMorphState IppiMorphState;
-typedef struct ipcvMorphAdvState IppiMorphAdvState;
-typedef struct ipcvMorphGrayState_8u IppiMorphGrayState_8u;
-typedef struct ipcvMorphGrayState_32f IppiMorphGrayState_32f;
-
-typedef struct ipcvConvState IppiConvState;
-
-typedef struct _IppiConnectedComp {
-    Ipp64f   area;    /*  area of the segmented component  */
-    Ipp64f   value[3];/*  gray scale value of the segmented component  */
-    IppiRect rect;    /*  bounding rectangle of the segmented component  */
-} IppiConnectedComp;
-
-typedef struct PyramidState IppiPyramidState;
-
-typedef IppiPyramidState IppiPyramidDownState_8u_C1R;
-typedef IppiPyramidState IppiPyramidDownState_16u_C1R;
-typedef IppiPyramidState IppiPyramidDownState_32f_C1R;
-typedef IppiPyramidState IppiPyramidDownState_8u_C3R;
-typedef IppiPyramidState IppiPyramidDownState_16u_C3R;
-typedef IppiPyramidState IppiPyramidDownState_32f_C3R;
-typedef IppiPyramidState IppiPyramidUpState_8u_C1R;
-typedef IppiPyramidState IppiPyramidUpState_16u_C1R;
-typedef IppiPyramidState IppiPyramidUpState_32f_C1R;
-typedef IppiPyramidState IppiPyramidUpState_8u_C3R;
-typedef IppiPyramidState IppiPyramidUpState_16u_C3R;
-typedef IppiPyramidState IppiPyramidUpState_32f_C3R;
-
-
-typedef struct _IppiPyramid {
-    Ipp8u         **pImage;
-    IppiSize      *pRoi;
-    Ipp64f        *pRate;
-    int           *pStep;
-    Ipp8u         *pState;
-    int            level;
-} IppiPyramid;
-
-typedef struct OptFlowPyrLK IppiOptFlowPyrLK;
-
-typedef IppiOptFlowPyrLK IppiOptFlowPyrLK_8u_C1R;
-typedef IppiOptFlowPyrLK IppiOptFlowPyrLK_16u_C1R;
-typedef IppiOptFlowPyrLK IppiOptFlowPyrLK_32f_C1R;
-
-typedef struct ipcvHaarClassifier_32f IppiHaarClassifier_32f;
-typedef struct ipcvHaarClassifier_32s IppiHaarClassifier_32s;
-
-typedef struct ipcvFGHistogramState_8u_C1R IppFGHistogramState_8u_C1R;
-typedef struct ipcvFGHistogramState_8u_C3R IppFGHistogramState_8u_C3R;
-
-typedef struct ipcvFGGaussianState_8u_C1R IppFGGaussianState_8u_C1R;
-typedef struct ipcvFGGaussianState_8u_C3R IppFGGaussianState_8u_C3R;
-
-typedef enum _IppiInpaintFlag {
-    IPP_INPAINT_TELEA    =  0,
-    IPP_INPAINT_NS       =  1
-} IppiInpaintFlag;
-
-typedef struct ippcvFilterGaussianSpec IppFilterGaussianSpec;
-
-typedef struct ipcvInpaintState_8u IppiInpaintState_8u_C1R;
-typedef struct ipcvInpaintState_8u IppiInpaintState_8u_C3R;
-
-typedef struct HoughProbSpec IppiHoughProbSpec;
-
-typedef struct FastNSpec IppiFastNSpec;
-
-typedef struct _IppiCornerFastN {
-    int     x;
-    int     y;
-    int     cornerType;
-    int     orientation;
-    float   angle;
-    float   score;
-} IppiCornerFastN;
-
-typedef struct FGMMState_8u_C3R IppFGMMState_8u_C3R;
-
-typedef struct
-{
-  unsigned int numFrames;
-  unsigned int maxNGauss;
-  Ipp32f       varInit;
-  Ipp32f       varMin;
-  Ipp32f       varMax;
-  Ipp32f       varWBRatio;
-  Ipp32f       bckgThr;
-  Ipp32f       varNGRatio;
-  Ipp32f       reduction;
-  Ipp8u        shadowValue;
-  char         shadowFlag;
-  Ipp32f       shadowRatio;
-} IppFGMModel;
-
-#endif /* _OWN_BLDPCS */
-
-#define IPP_SEGMENT_QUEUE     0x01
-#define IPP_SEGMENT_DISTANCE  0x02
-#define IPP_SEGMENT_BORDER_4  0x40
-#define IPP_SEGMENT_BORDER_8  0x80
-
-#define IPP_TRUNC(a,b) ((a)&~((b)-1))
-#define IPP_APPEND(a,b) (((a)+(b)-1)&~((b)-1))
-
-/*****************************************************************************/
-/*                   Below are ippCC domain specific definitions             */
-/*****************************************************************************/
-enum {
-     IPP_UPPER        = 1,
-     IPP_LEFT         = 2,
-     IPP_CENTER       = 4,
-     IPP_RIGHT        = 8,
-     IPP_LOWER        = 16,
-     IPP_UPPER_LEFT   = 32,
-     IPP_UPPER_RIGHT  = 64,
-     IPP_LOWER_LEFT   = 128,
-     IPP_LOWER_RIGHT  = 256
-};
-
-#if !defined( _OWN_BLDPCS )
-
-typedef enum {
-    ippDitherNone,
-    ippDitherFS,
-    ippDitherJJN,
-    ippDitherStucki,
-    ippDitherBayer
-} IppiDitherType;
-
-#endif /* _OWN_BLDPCS */
-
-/*****************************************************************************/
-/*                   Below are ippCH domain specific definitions             */
-/*****************************************************************************/
-
-#if !defined( _OWN_BLDPCS )
-
-typedef struct {
- void *pFind;
- int lenFind;
-} IppRegExpFind;
-
-typedef struct RegExpState IppRegExpState;
-
-typedef enum {
-    ippFmtASCII = 0,
-    ippFmtUTF8
-} IppRegExpFormat;
-
-typedef struct RegExpReplaceState IppRegExpReplaceState;
-
-#endif /* _OWN_BLDPCS */
-
-/*****************************************************************************/
-/*                   Below are ippDC domain specific definitions             */
-/*****************************************************************************/
-
-#if !defined ( _OWN_BLDPCS )
-
-typedef struct MTFState_8u IppMTFState_8u;
-
-typedef enum {
-    ippBWTItohTanakaLimSort,
-    ippBWTItohTanakaUnlimSort,
-    ippBWTSuffixSort,
-    ippBWTAutoSort
-} IppBWTSortAlgorithmHint;
-
-typedef struct LZSSState_8u IppLZSSState_8u;
-
-typedef struct LZ77State_8u IppLZ77State_8u;
-typedef enum{
-   IppLZ77FastCompr,
-   IppLZ77AverageCompr,
-   IppLZ77BestCompr
-} IppLZ77ComprLevel;
-typedef enum{
-   IppLZ77NoChcksm,
-   IppLZ77Adler32,
-   IppLZ77CRC32
-} IppLZ77Chcksm;
-typedef enum {
-   IppLZ77NoFlush,
-   IppLZ77SyncFlush,
-   IppLZ77FullFlush,
-   IppLZ77FinishFlush
-} IppLZ77Flush;
-typedef struct IppLZ77Pairs_16u {
-   Ipp16u length;
-   Ipp16u offset;
-} IppLZ77Pair;
-typedef enum {
-   IppLZ77StatusInit,
-   IppLZ77StatusLZ77Process,
-   IppLZ77StatusHuffProcess,
-   IppLZ77StatusFinal
-} IppLZ77DeflateStatus;
-typedef enum {
-  IppLZ77UseFixed,
-  IppLZ77UseDynamic,
-  IppLZ77UseStored
-} IppLZ77HuffMode;
-typedef enum {
-  IppLZ77InflateStatusInit,
-  IppLZ77InflateStatusHuffProcess,
-  IppLZ77InflateStatusLZ77Process,
-  IppLZ77InflateStatusFinal
-} IppLZ77InflateStatus;
-
-typedef struct IppInflateState {
-  const Ipp8u* pWindow;          /* pointer to the sliding window
-                                    (the dictionary for the LZ77 algorithm) */
-  unsigned int winSize;          /* size of the sliding window */
-  unsigned int tableType;        /* type of Huffman code tables
-                                    (for example, 0 - tables for Fixed Huffman codes) */
-  unsigned int tableBufferSize;  /* (ENOUGH = 2048) * (sizeof(code) = 4) -
-                                    sizeof(IppInflateState) */
-} IppInflateState;
-
-typedef enum { /* this type is used as a translator of the inflate_mode type from zlib */
-  ippTYPE,
-  ippLEN,
-  ippLENEXT
-} IppInflateMode;
-
-typedef struct {
-  Ipp16u freq;
-  Ipp16u code;
-} IppDeflateFreqTable;
-
-typedef struct {
-  Ipp16u code;
-  Ipp16u len;
-} IppDeflateHuffCode;
-
-typedef struct RLEState_BZ2 IppRLEState_BZ2;
-
-typedef struct EncodeHuffState_BZ2 IppEncodeHuffState_BZ2;
-
-typedef struct DecodeHuffState_BZ2 IppDecodeHuffState_BZ2;
-
-typedef enum {
-    IppLZO1XST,      /* Single-threaded, generic LZO-compatible*/
-    IppLZO1XMT      /* Multi-threaded */
-} IppLZOMethod ;
-
-typedef struct LZOState_8u IppLZOState_8u;
-
-#endif /* _OWN_BLDPCS */
-
-/* /////////////////////////////////////////////////////////////////////////////
-//        The following enumerator defines a status of IPP operations
-//                     negative value means error
-*/
-typedef enum {
-    /* errors */
-    ippStsNotSupportedModeErr    = -9999,/* The requested mode is currently not supported.  */
-    ippStsCpuNotSupportedErr     = -9998,/* The target CPU is not supported. */
-    ippStsInplaceModeNotSupportedErr = -9997,/* The inplace operation is currently not supported. */
-
-    ippStsIIRIIRLengthErr        = -234, /* Vector length for IIRIIR function is less than 3*(IIR order) */
-    ippStsWarpTransformTypeErr   = -233, /* The warp transform type is illegal */
-    ippStsExceededSizeErr        = -232, /* Requested size exceeded the maximum supported ROI size */
-    ippStsWarpDirectionErr       = -231, /* The warp transform direction is illegal */
-
-    ippStsFilterTypeErr          = -230, /* The filter type is incorrect or not supported */
-
-    ippStsNormErr                = -229, /* The norm is incorrect or not supported */
-
-    ippStsAlgTypeErr             = -228, /* Algorithm type is not supported.        */
-    ippStsMisalignedOffsetErr    = -227, /* The offset is not aligned with an element. */
-
-    ippStsQuadraticNonResidueErr = -226, /* SQRT operation on quadratic non-residue value. */
-
-    ippStsBorderErr              = -225, /* Illegal value for border type.*/
-
-    ippStsDitherTypeErr          = -224, /* Dithering type is not supported. */
-    ippStsH264BufferFullErr      = -223, /* Buffer for the output bitstream is full. */
-    ippStsWrongAffinitySettingErr= -222, /* An affinity setting does not correspond to the affinity setting that was set by f.ippSetAffinity(). */
-    ippStsLoadDynErr             = -221, /* Error when loading the dynamic library. */
-
-    ippStsPointAtInfinity        = -220, /* Point at infinity is detected.  */
-
-    ippStsUnknownStatusCodeErr   = -216, /* Unknown status code. */
-
-    ippStsOFBSizeErr             = -215, /* Incorrect value for crypto OFB block size. */
-    ippStsLzoBrokenStreamErr     = -214, /* LZO safe decompression function cannot decode LZO stream. */
-
-    ippStsRoundModeNotSupportedErr  = -213, /* Rounding mode is not supported. */
-    ippStsDecimateFractionErr    = -212, /* Fraction in Decimate is not supported. */
-    ippStsWeightErr              = -211, /* Incorrect value for weight. */
-
-    ippStsQualityIndexErr        = -210, /* Cannot calculate the quality index for an image filled with a constant. */
-    ippStsIIRPassbandRippleErr   = -209, /* Ripple in passband for Chebyshev1 design is less than zero, equal to zero, or greater than 29. */
-    ippStsFilterFrequencyErr     = -208, /* Cutoff frequency of filter is less than zero, equal to zero, or greater than 0.5. */
-    ippStsFIRGenOrderErr         = -207, /* Order of the FIR filter for design is less than 1.                    */
-    ippStsIIRGenOrderErr         = -206, /* Order of the IIR filter for design is less than 1, or greater than 12. */
-
-    ippStsConvergeErr            = -205, /* The algorithm does not converge. */
-    ippStsSizeMatchMatrixErr     = -204, /* The sizes of the source matrices are unsuitable. */
-    ippStsCountMatrixErr         = -203, /* Count value is less than, or equal to zero. */
-    ippStsRoiShiftMatrixErr      = -202, /* RoiShift value is negative or not divisible by the size of the data type. */
-
-    ippStsResizeNoOperationErr   = -201, /* One of the output image dimensions is less than 1 pixel. */
-    ippStsSrcDataErr             = -200, /* The source buffer contains unsupported data. */
-    ippStsMaxLenHuffCodeErr      = -199, /* Huff: Max length of Huffman code is more than the expected one. */
-    ippStsCodeLenTableErr        = -198, /* Huff: Invalid codeLenTable. */
-    ippStsFreqTableErr           = -197, /* Huff: Invalid freqTable. */
-
-    ippStsIncompleteContextErr   = -196, /* Crypto: set up of context is not complete. */
-
-    ippStsSingularErr            = -195, /* Matrix is singular. */
-    ippStsSparseErr              = -194, /* Positions of taps are not in ascending order, or are negative, or repetitive. */
-    ippStsBitOffsetErr           = -193, /* Incorrect bit offset value. */
-    ippStsQPErr                  = -192, /* Incorrect quantization parameter value. */
-    ippStsVLCErr                 = -191, /* Illegal VLC or FLC is detected during stream decoding. */
-    ippStsRegExpOptionsErr       = -190, /* RegExp: Options for the pattern are incorrect. */
-    ippStsRegExpErr              = -189, /* RegExp: The structure pRegExpState contains incorrect data. */
-    ippStsRegExpMatchLimitErr    = -188, /* RegExp: The match limit is exhausted. */
-    ippStsRegExpQuantifierErr    = -187, /* RegExp: Incorrect quantifier. */
-    ippStsRegExpGroupingErr      = -186, /* RegExp: Incorrect grouping. */
-    ippStsRegExpBackRefErr       = -185, /* RegExp: Incorrect back reference. */
-    ippStsRegExpChClassErr       = -184, /* RegExp: Incorrect character class. */
-    ippStsRegExpMetaChErr        = -183, /* RegExp: Incorrect metacharacter. */
-    ippStsStrideMatrixErr        = -182,  /* Stride value is not positive or not divisible by the size of the data type. */
-    ippStsCTRSizeErr             = -181,  /* Incorrect value for crypto CTR block size. */
-    ippStsJPEG2KCodeBlockIsNotAttached =-180, /* Codeblock parameters are not attached to the state structure. */
-    ippStsNotPosDefErr           = -179,      /* Matrix is not positive definite. */
-
-    ippStsEphemeralKeyErr        = -178, /* ECC: Invalid ephemeral key.   */
-    ippStsMessageErr             = -177, /* ECC: Invalid message digest.  */
-    ippStsShareKeyErr            = -176, /* ECC: Invalid share key.   */
-    ippStsIvalidPublicKey        = -175, /* ECC: Invalid public key.  */
-    ippStsIvalidPrivateKey       = -174, /* ECC: Invalid private key. */
-    ippStsOutOfECErr             = -173, /* ECC: Point out of EC.     */
-    ippStsECCInvalidFlagErr      = -172, /* ECC: Invalid Flag.        */
-
-    ippStsMP3FrameHeaderErr      = -171,  /* Error in fields of the IppMP3FrameHeader structure. */
-    ippStsMP3SideInfoErr         = -170,  /* Error in fields of the IppMP3SideInfo structure. */
-
-    ippStsBlockStepErr           = -169,  /* Step for Block is less than 8. */
-    ippStsMBStepErr              = -168,  /* Step for MB is less than 16. */
-
-    ippStsAacPrgNumErr           = -167,  /* AAC: Invalid number of elements for one program.   */
-    ippStsAacSectCbErr           = -166,  /* AAC: Invalid section codebook.                     */
-    ippStsAacSfValErr            = -164,  /* AAC: Invalid scalefactor value.                    */
-    ippStsAacCoefValErr          = -163,  /* AAC: Invalid quantized coefficient value.          */
-    ippStsAacMaxSfbErr           = -162,  /* AAC: Invalid coefficient index.  */
-    ippStsAacPredSfbErr          = -161,  /* AAC: Invalid predicted coefficient index.  */
-    ippStsAacPlsDataErr          = -160,  /* AAC: Invalid pulse data attributes.  */
-    ippStsAacGainCtrErr          = -159,  /* AAC: Gain control is not supported.  */
-    ippStsAacSectErr             = -158,  /* AAC: Invalid number of sections.  */
-    ippStsAacTnsNumFiltErr       = -157,  /* AAC: Invalid number of TNS filters.  */
-    ippStsAacTnsLenErr           = -156,  /* AAC: Invalid length of TNS region.  */
-    ippStsAacTnsOrderErr         = -155,  /* AAC: Invalid order of TNS filter.  */
-    ippStsAacTnsCoefResErr       = -154,  /* AAC: Invalid bit-resolution for TNS filter coefficients.  */
-    ippStsAacTnsCoefErr          = -153,  /* AAC: Invalid coefficients of TNS filter. */
-    ippStsAacTnsDirectErr        = -152,  /* AAC: Invalid direction TNS filter.  */
-    ippStsAacTnsProfileErr       = -151,  /* AAC: Invalid TNS profile.  */
-    ippStsAacErr                 = -150,  /* AAC: Internal error.  */
-    ippStsAacBitOffsetErr        = -149,  /* AAC: Invalid current bit offset in bitstream.  */
-    ippStsAacAdtsSyncWordErr     = -148,  /* AAC: Invalid ADTS syncword.  */
-    ippStsAacSmplRateIdxErr      = -147,  /* AAC: Invalid sample rate index.  */
-    ippStsAacWinLenErr           = -146,  /* AAC: Invalid window length (not short or long).  */
-    ippStsAacWinGrpErr           = -145,  /* AAC: Invalid number of groups for current window length.  */
-    ippStsAacWinSeqErr           = -144,  /* AAC: Invalid window sequence range.  */
-    ippStsAacComWinErr           = -143,  /* AAC: Invalid common window flag.  */
-    ippStsAacStereoMaskErr       = -142,  /* AAC: Invalid stereo mask.  */
-    ippStsAacChanErr             = -141,  /* AAC: Invalid channel number.  */
-    ippStsAacMonoStereoErr       = -140,  /* AAC: Invalid mono-stereo flag.  */
-    ippStsAacStereoLayerErr      = -139,  /* AAC: Invalid this Stereo Layer flag.  */
-    ippStsAacMonoLayerErr        = -138,  /* AAC: Invalid this Mono Layer flag.  */
-    ippStsAacScalableErr         = -137,  /* AAC: Invalid scalable object flag.  */
-    ippStsAacObjTypeErr          = -136,  /* AAC: Invalid audio object type.  */
-    ippStsAacWinShapeErr         = -135,  /* AAC: Invalid window shape.  */
-    ippStsAacPcmModeErr          = -134,  /* AAC: Invalid PCM output interleaving indicator.  */
-    ippStsVLCUsrTblHeaderErr          = -133,  /* VLC: Invalid header inside table. */
-    ippStsVLCUsrTblUnsupportedFmtErr  = -132,  /* VLC: Table format is not supported.  */
-    ippStsVLCUsrTblEscAlgTypeErr      = -131,  /* VLC: Ecs-algorithm is not supported. */
-    ippStsVLCUsrTblEscCodeLengthErr   = -130,  /* VLC: Esc-code length inside table header is incorrect. */
-    ippStsVLCUsrTblCodeLengthErr      = -129,  /* VLC: Code length inside table is incorrect.  */
-    ippStsVLCInternalTblErr           = -128,  /* VLC: Invalid internal table. */
-    ippStsVLCInputDataErr             = -127,  /* VLC: Invalid input data. */
-    ippStsVLCAACEscCodeLengthErr      = -126,  /* VLC: Invalid AAC-Esc code length. */
-    ippStsNoiseRangeErr         = -125,  /* Noise value for Wiener Filter is out of range. */
-    ippStsUnderRunErr           = -124,  /* Error in data under run. */
-    ippStsPaddingErr            = -123,  /* Detected padding error indicates the possible data corruption. */
-    ippStsCFBSizeErr            = -122,  /* Incorrect value for crypto CFB block size. */
-    ippStsPaddingSchemeErr      = -121,  /* Invalid padding scheme.  */
-    ippStsInvalidCryptoKeyErr   = -120,  /* A compromised key causes suspansion of the requested cryptographic operation.  */
-    ippStsLengthErr             = -119,  /* Incorrect value for string length. */
-    ippStsBadModulusErr         = -118,  /* Bad modulus caused a failure in module inversion. */
-    ippStsLPCCalcErr            = -117,  /* Cannot evaluate linear prediction. */
-    ippStsRCCalcErr             = -116,  /* Cannot compute reflection coefficients. */
-    ippStsIncorrectLSPErr       = -115,  /* Incorrect values for Linear Spectral Pair. */
-    ippStsNoRootFoundErr        = -114,  /* No roots are found for equation. */
-    ippStsJPEG2KBadPassNumber   = -113,  /* Pass number exceeds allowed boundaries [0,nOfPasses-1]. */
-    ippStsJPEG2KDamagedCodeBlock= -112,  /* Codeblock for decoding contains damaged data. */
-    ippStsH263CBPYCodeErr       = -111,  /* Illegal Huffman code is detected through CBPY stream processing. */
-    ippStsH263MCBPCInterCodeErr = -110,  /* Illegal Huffman code is detected through MCBPC Inter stream processing. */
-    ippStsH263MCBPCIntraCodeErr = -109,  /* Illegal Huffman code is detected through MCBPC Intra stream processing. */
-    ippStsNotEvenStepErr        = -108,  /* Step value is not pixel multiple. */
-    ippStsHistoNofLevelsErr     = -107,  /* Number of levels for histogram is less than 2. */
-    ippStsLUTNofLevelsErr       = -106,  /* Number of levels for LUT is less than 2. */
-    ippStsMP4BitOffsetErr       = -105,  /* Incorrect bit offset value. */
-    ippStsMP4QPErr              = -104,  /* Incorrect quantization parameter. */
-    ippStsMP4BlockIdxErr        = -103,  /* Incorrect block index. */
-    ippStsMP4BlockTypeErr       = -102,  /* Incorrect block type. */
-    ippStsMP4MVCodeErr          = -101,  /* Illegal Huffman code is detected during MV stream processing. */
-    ippStsMP4VLCCodeErr         = -100,  /* Illegal Huffman code is detected during VLC stream processing. */
-    ippStsMP4DCCodeErr          = -99,   /* Illegal code is detected during DC stream processing. */
-    ippStsMP4FcodeErr           = -98,   /* Incorrect fcode value. */
-    ippStsMP4AlignErr           = -97,   /* Incorrect buffer alignment .           */
-    ippStsMP4TempDiffErr        = -96,   /* Incorrect temporal difference.         */
-    ippStsMP4BlockSizeErr       = -95,   /* Incorrect size of a block or macroblock. */
-    ippStsMP4ZeroBABErr         = -94,   /* All BAB values are equal to zero.             */
-    ippStsMP4PredDirErr         = -93,   /* Incorrect prediction direction.        */
-    ippStsMP4BitsPerPixelErr    = -92,   /* Incorrect number of bits per pixel.    */
-    ippStsMP4VideoCompModeErr   = -91,   /* Incorrect video component mode.       */
-    ippStsMP4LinearModeErr      = -90,   /* Incorrect DC linear mode. */
-    ippStsH263PredModeErr       = -83,   /* Incorrect Prediction Mode value.                                       */
-    ippStsH263BlockStepErr      = -82,   /* The step value is less than 8.                                         */
-    ippStsH263MBStepErr         = -81,   /* The step value is less than 16.                                        */
-    ippStsH263FrameWidthErr     = -80,   /* The frame width is less than 8.                                        */
-    ippStsH263FrameHeightErr    = -79,   /* The frame height is less than, or equal to zero.                        */
-    ippStsH263ExpandPelsErr     = -78,   /* Expand pixels number is less than 8.                               */
-    ippStsH263PlaneStepErr      = -77,   /* Step value is less than the plane width.                           */
-    ippStsH263QuantErr          = -76,   /* Quantizer value is less than, or equal to zero, or greater than 31. */
-    ippStsH263MVCodeErr         = -75,   /* Illegal Huffman code is detected during MV stream processing.                  */
-    ippStsH263VLCCodeErr        = -74,   /* Illegal Huffman code is detected during VLC stream processing.                 */
-    ippStsH263DCCodeErr         = -73,   /* Illegal code is detected during DC stream processing.                          */
-    ippStsH263ZigzagLenErr      = -72,   /* Zigzag compact length is more than 64.                             */
-    ippStsFBankFreqErr          = -71,   /* Incorrect value for the filter bank frequency parameter. */
-    ippStsFBankFlagErr          = -70,   /* Incorrect value for the filter bank parameter.           */
-    ippStsFBankErr              = -69,   /* Filter bank is not correctly initialized.              */
-    ippStsNegOccErr             = -67,   /* Occupation count is negative.                     */
-    ippStsCdbkFlagErr           = -66,   /* Incorrect value for the codebook flag parameter. */
-    ippStsSVDCnvgErr            = -65,   /* SVD algorithm does not converge.               */
-    ippStsJPEGHuffTableErr      = -64,   /* JPEG Huffman table is destroyed.        */
-    ippStsJPEGDCTRangeErr       = -63,   /* JPEG DCT coefficient is out of range. */
-    ippStsJPEGOutOfBufErr       = -62,   /* Attempt to access out of the buffer limits.   */
-    ippStsDrawTextErr           = -61,   /* System error in the draw text operation. */
-    ippStsChannelOrderErr       = -60,   /* Incorrect order of the destination channels. */
-    ippStsZeroMaskValuesErr     = -59,   /* All values of the mask are equal to zero. */
-    ippStsQuadErr               = -58,   /* The quadrangle is nonconvex or degenerates into triangle, line, or point */
-    ippStsRectErr               = -57,   /* Size of the rectangle region is less than, or equal to 1. */
-    ippStsCoeffErr              = -56,   /* Incorrect values for transformation coefficients.   */
-    ippStsNoiseValErr           = -55,   /* Incorrect value for noise amplitude for dithering.             */
-    ippStsDitherLevelsErr       = -54,   /* Number of dithering levels is out of range.             */
-    ippStsNumChannelsErr        = -53,   /* Number of channels is incorrect, or not supported.                  */
-    ippStsCOIErr                = -52,   /* COI is out of range. */
-    ippStsDivisorErr            = -51,   /* Divisor is equal to zero, function is aborted. */
-    ippStsAlphaTypeErr          = -50,   /* Illegal type of image compositing operation.                           */
-    ippStsGammaRangeErr         = -49,   /* Gamma range bounds is less than, or equal to zero.                      */
-    ippStsGrayCoefSumErr        = -48,   /* Sum of the conversion coefficients must be less than, or equal to 1.    */
-    ippStsChannelErr            = -47,   /* Illegal channel number.                                                */
-    ippStsToneMagnErr           = -46,   /* Tone magnitude is less than, or equal to zero.                          */
-    ippStsToneFreqErr           = -45,   /* Tone frequency is negative, or greater than, or equal to 0.5.           */
-    ippStsTonePhaseErr          = -44,   /* Tone phase is negative, or greater than, or equal to 2*PI.              */
-    ippStsTrnglMagnErr          = -43,   /* Triangle magnitude is less than, or equal to zero.                      */
-    ippStsTrnglFreqErr          = -42,   /* Triangle frequency is negative, or greater than, or equal to 0.5.       */
-    ippStsTrnglPhaseErr         = -41,   /* Triangle phase is negative, or greater than, or equal to 2*PI.          */
-    ippStsTrnglAsymErr          = -40,   /* Triangle asymmetry is less than -PI, or greater than, or equal to PI.   */
-    ippStsHugeWinErr            = -39,   /* Kaiser window is too big.                                             */
-    ippStsJaehneErr             = -38,   /* Magnitude value is negative.                                           */
-    ippStsStrideErr             = -37,   /* Stride value is less than the length of the row. */
-    ippStsEpsValErr             = -36,   /* Negative epsilon value.             */
-    ippStsWtOffsetErr           = -35,   /* Invalid offset value for wavelet filter.                                       */
-    ippStsAnchorErr             = -34,   /* Anchor point is outside the mask.                                             */
-    ippStsMaskSizeErr           = -33,   /* Invalid mask size.                                                           */
-    ippStsShiftErr              = -32,   /* Shift value is less than zero.                                                */
-    ippStsSampleFactorErr       = -31,   /* Sampling factor is less than, or equal to zero.                                */
-    ippStsSamplePhaseErr        = -30,   /* Phase value is out of range: 0 <= phase < factor.                             */
-    ippStsFIRMRFactorErr        = -29,   /* MR FIR sampling factor is less than, or equal to zero.                         */
-    ippStsFIRMRPhaseErr         = -28,   /* MR FIR sampling phase is negative, or greater than, or equal to the sampling factor. */
-    ippStsRelFreqErr            = -27,   /* Relative frequency value is out of range.                                     */
-    ippStsFIRLenErr             = -26,   /* Length of a FIR filter is less than, or equal to zero.                         */
-    ippStsIIROrderErr           = -25,   /* Order of an IIR filter is not valid. */
-    ippStsDlyLineIndexErr       = -24,   /* Invalid value for the delay line sample index. */
-    ippStsResizeFactorErr       = -23,   /* Resize factor(s) is less than, or equal to zero. */
-    ippStsInterpolationErr      = -22,   /* Invalid interpolation mode. */
-    ippStsMirrorFlipErr         = -21,   /* Invalid flip mode.                                         */
-    ippStsMoment00ZeroErr       = -20,   /* Moment value M(0,0) is too small to continue calculations. */
-    ippStsThreshNegLevelErr     = -19,   /* Negative value of the level in the threshold operation.    */
-    ippStsThresholdErr          = -18,   /* Invalid threshold bounds. */
-    ippStsContextMatchErr       = -17,   /* Context parameter does not match the operation. */
-    ippStsFftFlagErr            = -16,   /* Invalid value for the FFT flag parameter. */
-    ippStsFftOrderErr           = -15,   /* Invalid value for the FFT order parameter. */
-    ippStsStepErr               = -14,   /* Step value is not valid. */
-    ippStsScaleRangeErr         = -13,   /* Scale bounds are out of range. */
-    ippStsDataTypeErr           = -12,   /* Data type is incorrect or not supported. */
-    ippStsOutOfRangeErr         = -11,   /* Argument is out of range, or point is outside the image. */
-    ippStsDivByZeroErr          = -10,   /* An attempt to divide by zero. */
-    ippStsMemAllocErr           = -9,    /* Memory allocated for the operation is not enough.*/
-    ippStsNullPtrErr            = -8,    /* Null pointer error. */
-    ippStsRangeErr              = -7,    /* Incorrect values for bounds: the lower bound is greater than the upper bound. */
-    ippStsSizeErr               = -6,    /* Incorrect value for data size. */
-    ippStsBadArgErr             = -5,    /* Incorrect arg/param of the function.  */
-    ippStsNoMemErr              = -4,    /* Not enough memory for the operation. */
-    ippStsSAReservedErr3        = -3,    /* Unknown/unspecified error, -3. */
-    ippStsErr                   = -2,    /* Unknown/unspecified error, -2. */
-    ippStsSAReservedErr1        = -1,    /* Unknown/unspecified error, -1. */
-
-     /* no errors */
-    ippStsNoErr                 =   0,   /* No errors. */
-
-     /* warnings  */
-    ippStsNoOperation       =   1,       /* No operation has been executed. */
-    ippStsMisalignedBuf     =   2,       /* Misaligned pointer in operation in which it must be aligned. */
-    ippStsSqrtNegArg        =   3,       /* Negative value(s) for the argument in the Sqrt function. */
-    ippStsInvZero           =   4,       /* INF result. Zero value was met by InvThresh with zero level. */
-    ippStsEvenMedianMaskSize=   5,       /* Even size of the Median Filter mask was replaced with the odd one. */
-    ippStsDivByZero         =   6,       /* Zero value(s) for the divisor in the Div function. */
-    ippStsLnZeroArg         =   7,       /* Zero value(s) for the argument in the Ln function.     */
-    ippStsLnNegArg          =   8,       /* Negative value(s) for the argument in the Ln function. */
-    ippStsNanArg            =   9,       /* Argument value is not a number.                  */
-    ippStsJPEGMarker        =   10,      /* JPEG marker in the bitstream.                 */
-    ippStsResFloor          =   11,      /* All result values are floored.                        */
-    ippStsOverflow          =   12,      /* Overflow in the operation.                   */
-    ippStsLSFLow            =   13,      /* Quantized LP synthesis filter stability check is applied at the low boundary of [0,pi]. */
-    ippStsLSFHigh           =   14,      /* Quantized LP synthesis filter stability check is applied at the high boundary of [0,pi]. */
-    ippStsLSFLowAndHigh     =   15,      /* Quantized LP synthesis filter stability check is applied at both boundaries of [0,pi]. */
-    ippStsZeroOcc           =   16,      /* Zero occupation count. */
-    ippStsUnderflow         =   17,      /* Underflow in the operation. */
-    ippStsSingularity       =   18,      /* Singularity in the operation.                                       */
-    ippStsDomain            =   19,      /* Argument is out of the function domain.                                      */
-    ippStsNonIntelCpu       =   20,      /* The target CPU is not Genuine Intel.                                         */
-    ippStsCpuMismatch       =   21,      /* Cannot set the library for the given CPU.                                     */
-    ippStsNoIppFunctionFound =  22,      /* Application does not contain Intel IPP function calls.                            */
-    ippStsDllNotFoundBestUsed = 23,      /* Dispatcher cannot find the newest version of the Intel IPP dll.                  */
-    ippStsNoOperationInDll  =   24,      /* The function does nothing in the dynamic version of the library.             */
-    ippStsInsufficientEntropy=  25,      /* Generation of the prime/key failed due to insufficient entropy in the random seed and stimulus bit string. */
-    ippStsOvermuchStrings   =   26,      /* Number of destination strings is more than expected.                         */
-    ippStsOverlongString    =   27,      /* Length of one of the destination strings is more than expected.              */
-    ippStsAffineQuadChanged =   28,      /* 4th vertex of destination quad is not equal to customer's one.               */
-    ippStsWrongIntersectROI =   29,      /* ROI has no intersection with the source or destination ROI. No operation. */
-    ippStsWrongIntersectQuad =  30,      /* Quadrangle has no intersection with the source or destination ROI. No operation. */
-    ippStsSmallerCodebook   =   31,      /* Size of created codebook is less than the cdbkSize argument. */
-    ippStsSrcSizeLessExpected = 32,      /* DC: Size of the source buffer is less than the expected one. */
-    ippStsDstSizeLessExpected = 33,      /* DC: Size of the destination buffer is less than the expected one. */
-    ippStsStreamEnd           = 34,      /* DC: The end of stream processed. */
-    ippStsDoubleSize        =   35,      /* Width or height of image is odd. */
-    ippStsNotSupportedCpu   =   36,      /* The CPU is not supported. */
-    ippStsUnknownCacheSize  =   37,      /* The CPU is supported, but the size of the cache is unknown. */
-    ippStsSymKernelExpected =   38,      /* The Kernel is not symmetric. */
-    ippStsEvenMedianWeight  =   39,      /* Even weight of the Weighted Median Filter is replaced with the odd one. */
-    ippStsWrongIntersectVOI =   40,      /* VOI has no intersection with the source or destination volume. No operation.                            */
-    ippStsI18nMsgCatalogInvalid=41,      /* Message Catalog is invalid, English message returned.                                                    */
-    ippStsI18nGetMessageFail  = 42,      /* Failed to fetch a localized message, English message returned. For more information use errno on Linux* OS and GetLastError on Windows* OS. */
-    ippStsWaterfall           = 43,      /* Cannot load required library, waterfall is used. */
-    ippStsPrevLibraryUsed     = 44,      /* Cannot load required library, previous dynamic library is used. */
-    ippStsLLADisabled         = 45,      /* OpenMP* Low Level Affinity is disabled. */
-    ippStsNoAntialiasing      = 46,      /* The mode does not support antialiasing. */
-    ippStsRepetitiveSrcData   = 47,      /* DC: The source data is too repetitive. */
-    ippStsSizeWrn             = 48,      /* The size does not allow to perform full operation. */
-    ippStsFeatureNotSupported = 49,      /* Current CPU doesn't support at least 1 of the desired features. */
-    ippStsUnknownFeature      = 50,      /* At least one of the desired features is unknown. */
-    ippStsFeaturesCombination = 51,      /* Wrong combination of features. */
-    ippStsAccurateModeNotSupported = 52  /* Accurate mode is not supported. */
-} IppStatus;
-
-#define ippStsOk ippStsNoErr
-
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __IPPTYPES_H__ */

+ 0 - 41
external/crypto_px/include/ippversion.h

@@ -1,41 +0,0 @@
-/*
-* Copyright (C) 2016 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.
-*
-*/
-
-#if !defined( __IPPVERSION_H__ )
-#define __IPPVERSION_H__
-
-#define IPP_VERSION_MAJOR  9
-#define IPP_VERSION_MINOR  0
-#define IPP_VERSION_UPDATE 2
-
-#define IPP_VERSION_STR "9.0.2"
-
-#endif /* __IPPVERSION_H__ */

+ 0 - 264
external/crypto_px/sources/include/cpudef.h

@@ -1,264 +0,0 @@
-/*
-* Copyright (C) 2016 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 __CPUDEF_H__
-#define __CPUDEF_H__
-
-#include "ippcore.h"
-
-#if defined( __cplusplus )
-extern "C" {
-#endif
-
-#undef __CDECL
-#if defined( _WIN32 ) || defined ( _WIN64 )
-  #define __CDECL    __cdecl
-#else
-  #define __CDECL
-#endif
-
-
-/* Intel CPU informator */
-
-typedef struct {
-   int family;
-   int stepping;
-   int model;
-   int type;
-   int feature;
-   int tlb;
-   int cache;
-   int mmx;
-   int freq;
-   int ssx;
-   int wni;
-   int htt;
-   int pni;
-   int em64t;
-   int mni;
-   int phcores;
-   int sse41;
-   int sse42;
-   int ext_family;
-   int ext_model;
-   int movbe_instr;
-   int avx;
-   int xsavexgetbv;
-} ippIntelCpuId;
-
-int __CDECL ownGetMaskFeatures( Ipp64u* pFeaturesMask );
-int __CDECL ownGetFeature( Ipp64u MaskOfFeature );
-int __CDECL ipp_is_avx_extension( void );
-
-__INT64  __CDECL ipp_get_pentium_counter (void);
-int __CDECL ipp_is_mmx_extension (void);
-int __CDECL ipp_is_ssx_extension (void);
-int __CDECL ipp_is_wni_extension (void);
-int __CDECL ipp_is_htt_extension( void );
-int __CDECL ipp_is_pni_extension( void );
-int __CDECL ipp_is_mni_extension( void );
-int __CDECL ipp_is_sse41_extension( void );
-int __CDECL ipp_is_sse42_extension( void );
-int __CDECL ipp_is_movbe( void );
-int __CDECL ipp_get_cores_on_die( void );
-int __CDECL ipp_is_em64t_extension( void );
-int __CDECL ipp_has_cpuid ( void );
-int __CDECL ipp_has_rdtsc( void );
-
-void __CDECL ipp_get_pentium_ident ( ippIntelCpuId* cpuid );
-int  __CDECL ipp_is_GenuineIntel ( void );
-int  __CDECL ipp_max_cpuid_input( void );
-int  __CDECL ipp_get_cpuid( int regs[4], int valEAX, int valECX );
-void __CDECL ipp_get_cache_line_size( int* szCacheLine );
-
-int  __CDECL  ipp_isnan( double x );
-int  __CDECL  ipp_finite( double x );
-int  __CDECL  ipp_isnan_32f( float x );
-int  __CDECL  ipp_finite_32f( float x );
-#define ipp_isfinite ipp_finite
-
-unsigned int __CDECL  ipp_control87 ( unsigned int newcw, unsigned int mask );
-unsigned int __CDECL  ipp_status87 ( void );
-unsigned int __CDECL  ipp_clear87 ( void );
-
-unsigned int  __CDECL  ipp_clear_ssx (void);
-/* topology/affinity */
-
-/* here are definitions of the CW bits exactly as x87 and ssx have */
-
-#define IPP_FPU_MASK_RC     0x0c00
-#define IPP_FPU_MASK_PC     0x0300
-#define IPP_FPU_MASK_RCPC   0x0f00
-
-#define IPP_FPU_RC_NEAR     0x0000
-#define IPP_FPU_RC_DOWN     0x0400
-#define IPP_FPU_RC_UP       0x0800
-#define IPP_FPU_RC_ZERO     0x0c00
-
-#define IPP_FPU_PC_24       0x0000
-#define IPP_FPU_PC_53       0x0200
-#define IPP_FPU_PC_64       0x0300
-
-
-unsigned int __CDECL ipp_set_rcpc_fpu( unsigned int newrcpc, unsigned int mask);
-void __CDECL ipp_set_cw_fpu( unsigned int cw );
-
-#define IPP_SSX_RC_NEAR     0x0000
-#define IPP_SSX_RC_DOWN     0x2000
-#define IPP_SSX_RC_UP       0x4000
-#define IPP_SSX_RC_ZERO     0x6000
-#define IPP_SSX_MASK_RC     0x6000
-
-
-unsigned int __CDECL ipp_set_rc_ssx( unsigned int newrc );
-void __CDECL ipp_set_cw_ssx( unsigned int cw );
-
-/* ================= FPU section ===================== */
-
-/*  Control bits - disable exceptions   */
-#define FPU_EXC_MSK         0x003f  /* Exception Masks Mask         */
-#define FPU_MSK_INVALID     0x0001  /*  invalid operation           */
-#define FPU_MSK_DENORMAL    0x0002  /*  denormalized operand        */
-#define FPU_MSK_ZERODIV     0x0004  /*  zero divide                 */
-#define FPU_MSK_OVERFLOW    0x0008  /*  overflow                    */
-#define FPU_MSK_UNDERFLOW   0x0010  /*  underflow                   */
-#define FPU_MSK_INEXACT     0x0020  /*  inexact (precision)         */
-
-/*  Status bits - exceptions    */
-#define FPU_EXC_FLG         0x003f  /* Exception Flags Mask         */
-#define FPU_FLG_INVALID     0x0001  /*  invalid operation           */
-#define FPU_FLG_DENORMAL    0x0002  /*  denormalized operand        */
-#define FPU_FLG_ZERODIV     0x0004  /*  zero divide                 */
-#define FPU_FLG_OVERFLOW    0x0008  /*  overflow                    */
-#define FPU_FLG_UNDERFLOW   0x0010  /*  underflow                   */
-#define FPU_FLG_INEXACT     0x0020  /*  inexact (precision)         */
-
-/*  Control bits - rounding control */
-#define FPU_RND             0x0c00  /* Rounding Control Mask        */
-#define FPU_RND_NEAR        0x0000  /*  near                        */
-#define FPU_RND_DOWN        0x0400  /*  down                        */
-#define FPU_RND_UP          0x0800  /*  up                          */
-#define FPU_RND_CHOP        0x0c00  /*  chop                        */
-
-/*  Control bits - precision control    */
-#define FPU_PRC             0x0300  /* Precision Control Mask       */
-#define FPU_PRC_64          0x0300  /*  64 bits                     */
-#define FPU_PRC_53          0x0200  /*  53 bits                     */
-#define FPU_PRC_24          0x0000  /*  24 bits                     */
-
-/*  Control bits - all masks    */
-#define FPU_ALL             0x0f3f  /* all masks                    */
-
-/* ============= definition for control/status world ============== */
-
-#define FPU_SET_EXC_MASK(mask) ps_set_cw_fpu(mask,FPU_EXC_MSK)
-#define FPU_GET_EXC_MASK()     (ps_set_cw_fpu(0,0) & FPU_EXC_MSK)
-
-#define FPU_GET_EXC_FLAG()     (ps_get_sw_fpu() & FPU_EXC_FLG)
-
-#define FPU_SET_RND_MODE(mode) ps_set_cw_fpu(mode,FPU_RND)
-#define FPU_GET_RND_MODE()     (ps_set_cw_fpu(0,0) & FPU_RND)
-
-#define FPU_SET_PRC_MODE(mode) ps_set_cw_fpu(mode,FPU_PRC)
-#define FPU_GET_PRC_MODE()     (ps_set_cw_fpu(0,0) & FPU_PRC)
-
-unsigned int __CDECL ps_set_cw_fpu( unsigned int newcw, unsigned int msk);
-unsigned int __CDECL ps_get_cw_fpu(void);
-unsigned int __CDECL ps_get_sw_fpu(void);
-unsigned int __CDECL ps_clear_fpu(void);
-
-/* ======================= SSX section ============================ */
-
-/*  Control bits - disable exceptions   */
-#define SSX_EXC_MSK             0x1f80  /* Disabling exception mask     */
-#define SSX_MSK_INEXACT         0x1000  /*  precision (inexact)         */
-#define SSX_MSK_UNDERFLOW       0x0800  /*  underflow                   */
-#define SSX_MSK_OVERFLOW        0x0400  /*  overflow                    */
-#define SSX_MSK_ZERODIV         0x0200  /*  divide by zero              */
-#define SSX_MSK_DENORMAL        0x0100  /*  denormalized                */
-#define SSX_MSK_INVALID         0x0080  /*  invalid operation           */
-
-/*  Status bits - exceptions    */
-#define SSX_EXC_FLG             0x003f  /* Exception flags mask         */
-#define SSX_FLG_INEXACT         0x0020  /*  precision (inexact)         */
-#define SSX_FLG_UNDERFLOW       0x0010  /*  underflow                   */
-#define SSX_FLG_OVERFLOW        0x0008  /*  overflow                    */
-#define SSX_FLG_ZERODIV         0x0004  /*  divide by zero              */
-#define SSX_FLG_DENORMAL        0x0002  /*  denormalized                */
-#define SSX_FLG_INVALID         0x0001  /*  invalid operation           */
-
-/*  Control bits - rounding control */
-#define SSX_RND                 0x6000  /* Rounding control mask        */
-#define SSX_RND_NEAR            0x0000  /*  near                        */
-#define SSX_RND_DOWN            0x2000  /*  down                        */
-#define SSX_RND_UP              0x4000  /*  up                          */
-#define SSX_RND_CHOP            0x6000  /*  chop                        */
-
-/*  Control bits - flush to zero mode   */
-#define SSX_FZ                  0x8000  /* Flush to zero mask           */
-#define SSX_FZ_ENABLE           0x8000  /*  flush to zero               */
-#define SSX_FZ_DISABLE          0x0000  /*  not flush to zero           */
-
-/*  Control bits - denormals are zero mode   */
-#define SSX_DAZ                 0x0040  /* denorm. are zero mask        */
-#define SSX_DAZ_ENABLE          0x0040  /* denorm. are zero             */
-#define SSX_DAZ_DISABLE         0x0000  /* denorm. are not zero         */
-
-#define SSX_ALL                 0xffbf  /* All masks                    */
-
-/* ==================== definition for SSX register =============== */
-
-#define SSX_SET_EXC_MASK(mask) ps_set_ssx(mask,SSX_EXC_MSK)
-#define SSX_GET_EXC_MASK()     (ps_get_ssx() & SSX_EXC_MSK)
-
-#define SSX_SET_EXC_FLAG(flag) ps_set_ssx(flag,SSX_EXC_FLG)
-#define SSX_GET_EXC_FLAG()     (ps_get_ssx() & SSX_EXC_FLG)
-
-#define SSX_SET_RND_MODE(mode) ps_set_ssx(mode,SSX_RND)
-#define SSX_GET_RND_MODE()     (ps_get_ssx() & SSX_RND)
-
-#define SSX_SET_FZ_MODE(mode)  ps_set_ssx(mode,SSX_FZ)
-#define SSX_GET_FZ_MODE()      (ps_get_ssx() & SSX_FZ)
-
-#define SSX_SET_DAZ_MODE(mode) ps_set_ssx(mode,SSX_DAZ)
-#define SSX_GET_DAZ_MODE()     (ps_get_ssx() & SSX_DAZ)
-
-unsigned int __CDECL ps_set_ssx(unsigned int newssx, unsigned int msk);
-unsigned int __CDECL ps_get_ssx(void);
-unsigned int __CDECL ipp_tst_daz_ssx(void);
-
-#if defined( __cplusplus )
-}
-#endif
-
-#endif /* __CPUDEF_H__ */
-
-/* ////////////////////////// End of file "cpudef.h" //////////////////////// */

+ 0 - 56
external/crypto_px/sources/include/ippver.gen

@@ -1,56 +0,0 @@
-/*
-* Copyright (C) 2016 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.
-*
-*/
-
-#if !defined(_IPP_DYNAMIC) || defined(_CORE)
-#include "owndefs.h"
-
-#ifndef _IPP_VERSION
-#define _IPP_VERSION ""
-#endif
-
-#define GET_LIB_NAME01(pref) pref ## GetLibVersion
-
-#define GET_LIB_NAME(pref) GET_LIB_NAME01(pref)
-
-#define LIBVERNAME   s_libVer
-
-#define SLIBVERNAME LIBVERNAME
-#include "ippverstr.gen"
-
-#include "cpudef.h"
-
-extern int ippJumpIndexForMergedDLL;
-
-IPPFUN( const IppLibraryVersion*, GET_LIB_NAME(LIB_PREFIX), (void) )
-{
-     return &LIBVERNAME;
-}
-#endif

+ 0 - 46
external/crypto_px/sources/include/ippver.h

@@ -1,46 +0,0 @@
-/*
-* Copyright (C) 2016 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 "ippversion.h"
-#ifndef BASE_VERSION
-#define BASE_VERSION() IPP_VERSION_MAJOR,IPP_VERSION_MINOR,IPP_VERSION_UPDATE
-#endif
-
-#ifndef STR_VERSION
- #ifdef IPP_REVISION
-  #define STR_VERSION() IPP_VERSION_STR " (r" STR( IPP_REVISION ) ")"
- #else
-  #define STR_VERSION() IPP_VERSION_STR " (-)"
- #endif
-#endif
-
-
-/* ////////////////////////////// End of file /////////////////////////////// */

+ 0 - 120
external/crypto_px/sources/include/ippverstr.gen

@@ -1,120 +0,0 @@
-/*
-* Copyright (C) 2016 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.
-*
-*/
-
-#ifdef _IPP_OMP_STATIC
-#define LIB_THREADS " threaded"
-#define CORE_THREADS " (threaded)"
-#else 
-#define LIB_THREADS ""
-#define CORE_THREADS ""
-#endif
-
-#define GET_LIBRARY_NAME( cpu, is ) #cpu, IPP_LIB_SHORTNAME() " " is " (" #cpu LIB_THREADS ")"
-
-static const IppLibraryVersion SLIBVERNAME = {
-
-/* major, minor, update (ex-majorBuild) */
-    BASE_VERSION(),
-
-#if defined IPP_REVISION
-    IPP_REVISION,
-#else
-    -1,
-#endif /* IPP_REVISION */
-
-#if defined( _CORE )
-    /*GET_LIBRARY_NAME( core )*/
-    "core",
-    "ippCore" CORE_THREADS
-
-#elif ( _IPP_ARCH == _IPP_ARCH_IA32 ) || ( _IPP_ARCH == _IPP_ARCH_LP32 )
-    #if ( _IPP == _IPP_M5 )
-        GET_LIBRARY_NAME( m5, "586" )
-    #elif ( _IPP == _IPP_H9 )
-        GET_LIBRARY_NAME( h9, "AVX2" )
-    #elif ( _IPP == _IPP_G9 )
-        GET_LIBRARY_NAME( g9, "AVX" )
-    #elif ( _IPP == _IPP_P8 )
-        GET_LIBRARY_NAME( p8, "SSE4.2" )
-    #elif ( _IPPLP32 == _IPPLP32_S8 )
-        GET_LIBRARY_NAME( s8, "Atom" )
-    #elif ( _IPP == _IPP_V8 )
-        GET_LIBRARY_NAME( v8, "SSSE3" )
-    #elif ( _IPP == _IPP_W7 )
-        GET_LIBRARY_NAME( w7, "SSE2" )
-    #else
-        GET_LIBRARY_NAME( px, "PX" )
-    #endif
-
-#elif ( _IPP_ARCH == _IPP_ARCH_EM64T ) || ( _IPP_ARCH == _IPP_ARCH_LP64 )
-    #if ( _IPP32E == _IPP32E_K0 )
-        GET_LIBRARY_NAME( k0, "AVX-512F/CD/BW/DQ/VL" )
-    #elif ( _IPP32E == _IPP32E_N0 )
-        GET_LIBRARY_NAME( n0, "AVX-512F/CD/ER/PF" )
-    #elif ( _IPP32E == _IPP32E_E9 )
-        GET_LIBRARY_NAME( e9, "AVX" )
-    #elif ( _IPP32E == _IPP32E_L9 )
-        GET_LIBRARY_NAME( l9, "AVX2" )
-    #elif ( _IPP32E == _IPP32E_Y8 )
-        GET_LIBRARY_NAME( y8, "SSE4.2" )
-    #elif ( _IPPLP64 == _IPPLP64_N8 )
-        GET_LIBRARY_NAME( n8, "Atom" )
-    #elif ( _IPP32E == _IPP32E_U8 )
-        GET_LIBRARY_NAME( u8, "SSSE3" )
-    #elif ( _IPP32E == _IPP32E_M7 )
-        GET_LIBRARY_NAME( m7, "SSE3" )
-    #else
-        GET_LIBRARY_NAME( mx, "PX" )
-    #endif
-
-#elif ( _IPP_ARCH == _IPP_ARCH_LRB2 )
-    #if ( _IPPLRB == _IPPLRB_BX )
-        GET_LIBRARY_NAME( bx, "PX" )
-    #elif ( _IPPLRB == _IPPLRB_B2 )
-        GET_LIBRARY_NAME( b2, "KNC" )
-    #endif
-
-#else
-    #error ARCH not supported
-
-#endif
-
-#if defined( TICKTOCK )
-  "+"
-#endif
-
-/* release Version (by Manager)    */
-   ,STR_VERSION()
-
-/* BuildDate (by QA person)        */
-   ,__DATE__
-
-};

+ 0 - 944
external/crypto_px/sources/include/owndefs.h

@@ -1,944 +0,0 @@
-/*
-* Copyright (C) 2016 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 __OWNDEFS_H__
-#define __OWNDEFS_H__
-
-#if defined( _VXWORKS )
-  #include <vxWorks.h>
-  #undef NONE
-#endif
-
-#include "ippdefs.h"
-
-#if defined(__INTEL_COMPILER) || defined(_MSC_VER)
-  #define __INLINE static __inline
-#elif defined( __GNUC__ )
-  #define __INLINE static __inline__
-#else
-  #define __INLINE static
-#endif
-
-#if defined(__INTEL_COMPILER)
- #define __RESTRICT restrict
-#elif !defined( __RESTRICT )
- #define __RESTRICT
-#endif
-
-#if defined( IPP_W32DLL )
-  #if defined( _MSC_VER ) || defined( __INTEL_COMPILER )
-    #define IPPFUN(type,name,arg) __declspec(dllexport) type __STDCALL name arg
-  #else
-    #define IPPFUN(type,name,arg)                extern type __STDCALL name arg
-  #endif
-#else
-  #define   IPPFUN(type,name,arg)                extern type __STDCALL name arg
-#endif
-
-
-/* structure represeting 128 bit unsigned integer type */
-
-typedef struct{
-  Ipp64u low;
-  Ipp64u high;
-}Ipp128u;
-
-#define _IPP_PX 0    /* pure C-code ia32                              */
-#define _IPP_M5 1    /* Quark (Pentium) - x86+x87 ia32                */
-#define _IPP_M6 2    /* Pentium MMX - MMX ia32                        */
-#define _IPP_A6 4    /* Pentium III - SSE ia32                        */
-#define _IPP_W7 8    /* Pentium 4 - SSE2 ia32                         */
-#define _IPP_T7 16   /* Pentium with x64 support (Nocona) - SSE3 ia32 */
-#define _IPP_V8 32   /* Merom - SSSE3 ia32                            */
-#define _IPP_P8 64   /* Penryn - SSE4.1 + tick for SSE4.2 ia32        */
-#define _IPP_G9 128  /* SandyBridge (GSSE) - AVX ia32                 */
-#define _IPP_H9 256  /* Haswell (AVX2) ia32                           */
-#define _IPP_I0 512  /* KNL (AVX-512) ia32                            */
-#define _IPP_S0 1024 /* SkyLake Xeon (AVX-512) ia32                   */
-
-#define _IPPXSC_PX 0
-#define _IPPXSC_S1 1
-#define _IPPXSC_S2 2
-#define _IPPXSC_C2 4
-
-#define _IPPLRB_PX 0
-#define _IPPLRB_B1 1
-#define _IPPLRB_B2 2
-
-#define _IPP64_PX  _IPP_PX
-#define _IPP64_I7 64
-
-#define _IPP32E_PX _IPP_PX /* pure C-code x64                              */
-#define _IPP32E_M7 32      /* Pentium with x64 support (Nocona) - SSE3 x64 */
-#define _IPP32E_U8 64      /* Merom - SSSE3 x64                            */
-#define _IPP32E_Y8 128     /* Penryn - SSE4.1 + tick for SSE4.2 x64        */
-#define _IPP32E_E9 256     /* SandyBridge (GSSE) - AVX x64                 */
-#define _IPP32E_L9 512     /* Haswell (AVX2) x64                           */
-#define _IPP32E_N0 1024    /* KNL (AVX-512) x64                            */
-#define _IPP32E_K0 2048    /* SkyLake Xeon (AVX-512) x64                   */
-
-#define _IPPLP32_PX _IPP_PX
-#define _IPPLP32_S8 1      /* old Atom (SSSE3+movbe) (Silverthorne) ia32   */
-
-#define _IPPLP64_PX _IPP_PX
-#define _IPPLP64_N8 1      /* old Atom (SSSE3+movbe) (Silverthorne) x64    */
-
-#if defined(__INTEL_COMPILER) || (_MSC_VER >= 1300)
-    #define __ALIGN8  __declspec (align(8))
-    #define __ALIGN16 __declspec (align(16))
-#if !defined( OSX32 )
-    #define __ALIGN32 __declspec (align(32))
-#else
-    #define __ALIGN32 __declspec (align(16))
-#endif
-    #define __ALIGN64 __declspec (align(64))
-#elif defined (__GNUC__)
-    #define __ALIGN8  __attribute((aligned(8)))
-    #define __ALIGN16 __attribute((aligned(16)))
-    #define __ALIGN32 __attribute((aligned(32)))
-    #define __ALIGN64 __attribute((aligned(64)))
-#else
-    #define __ALIGN8
-    #define __ALIGN16
-    #define __ALIGN32
-    #define __ALIGN64
-#endif
-
-#if defined ( _M5 ) /* Quark (Pentium) - x86+x87 ia32                */
-  #define _IPP    _IPP_M5
-  #define _IPP32E _IPP32E_PX
-  #define _IPPLRB _IPPLRB_PX
-  #define _IPPLP32 _IPPLP32_PX
-  #define _IPPLP64 _IPPLP64_PX
-
-#elif defined ( _M6 ) /* Pentium MMX - MMX ia32                        */
-  #define _IPP    _IPP_M6
-  #define _IPP32E _IPP32E_PX
-  #define _IPPLRB _IPPLRB_PX
-  #define _IPPLP32 _IPPLP32_PX
-  #define _IPPLP64 _IPPLP64_PX
-
-#elif defined( _A6 ) /* Pentium III - SSE ia32                        */
-  #define _IPP    _IPP_A6
-  #define _IPP32E _IPP32E_PX
-  #define _IPPLRB _IPPLRB_PX
-  #define _IPPLP32 _IPPLP32_PX
-  #define _IPPLP64 _IPPLP64_PX
-
-#elif defined( _W7 ) /* Pentium 4 - SSE2 ia32                         */
-  #define _IPP    _IPP_W7
-  #define _IPP32E _IPP32E_PX
-  #define _IPPLRB _IPPLRB_PX
-  #define _IPPLP32 _IPPLP32_PX
-  #define _IPPLP64 _IPPLP64_PX
-
-#elif defined( _T7 ) /* Pentium with x64 support (Nocona) - SSE3 ia32 */
-  #define _IPP    _IPP_T7
-  #define _IPP32E _IPP32E_PX
-  #define _IPPLRB _IPPLRB_PX
-  #define _IPPLP32 _IPPLP32_PX
-  #define _IPPLP64 _IPPLP64_PX
-
-#elif defined( _V8 ) /* Merom - SSSE3 ia32                            */
-  #define _IPP    _IPP_V8
-  #define _IPP32E _IPP32E_PX
-  #define _IPPLRB _IPPLRB_PX
-  #define _IPPLP32 _IPPLP32_PX
-  #define _IPPLP64 _IPPLP64_PX
-
-#elif defined( _P8 ) /* Penryn - SSE4.1 + tick for SSE4.2 ia32        */
-  #define _IPP    _IPP_P8
-  #define _IPP32E _IPP32E_PX
-  #define _IPPLRB _IPPLRB_PX
-  #define _IPPLP32 _IPPLP32_PX
-  #define _IPPLP64 _IPPLP64_PX
-
-#elif defined( _G9 ) /* SandyBridge (GSSE) - AVX ia32                 */
-  #define _IPP    _IPP_G9
-  #define _IPP32E _IPP32E_PX
-  #define _IPPLRB _IPPLRB_PX
-  #define _IPPLP32 _IPPLP32_PX
-  #define _IPPLP64 _IPPLP64_PX
-
-#elif defined( _H9 ) /* Haswell (AVX2) ia32                           */
-  #define _IPP    _IPP_H9
-  #define _IPP32E _IPP32E_PX
-  #define _IPPLRB _IPPLRB_PX
-  #define _IPPLP32 _IPPLP32_PX
-  #define _IPPLP64 _IPPLP64_PX
-
-#elif defined( _M7 ) /* Pentium with x64 support (Nocona) - SSE3 x64 */
-  #define _IPP    _IPP_PX
-  #define _IPP32E _IPP32E_M7
-  #define _IPPLRB _IPPLRB_PX
-  #define _IPPLP32 _IPPLP32_PX
-  #define _IPPLP64 _IPPLP64_PX
-
-#elif defined( _U8 ) /* Merom - SSSE3 x64                            */
-  #define _IPP    _IPP_PX
-  #define _IPP32E _IPP32E_U8
-  #define _IPPLRB _IPPLRB_PX
-  #define _IPPLP32 _IPPLP32_PX
-  #define _IPPLP64 _IPPLP64_PX
-
-#elif defined( _Y8 ) /* Penryn - SSE4.1 + tick for SSE4.2 x64        */
-  #define _IPP    _IPP_PX
-  #define _IPP32E _IPP32E_Y8
-  #define _IPPLRB _IPPLRB_PX
-  #define _IPPLP32 _IPPLP32_PX
-  #define _IPPLP64 _IPPLP64_PX
-
-#elif defined( _E9 ) /* SandyBridge (GSSE) - AVX x64                 */
-  #define _IPP    _IPP_PX
-  #define _IPP32E _IPP32E_E9
-  #define _IPPLRB _IPPLRB_PX
-  #define _IPPLP32 _IPPLP32_PX
-  #define _IPPLP64 _IPPLP64_PX
-
-#elif defined( _L9 ) /* Haswell (AVX2) x64                           */
-  #define _IPP    _IPP_PX
-  #define _IPP32E _IPP32E_L9
-  #define _IPPLRB _IPPLRB_PX
-  #define _IPPLP32 _IPPLP32_PX
-  #define _IPPLP64 _IPPLP64_PX
-
-#elif defined( _N0 ) /* KNL (AVX-512) x64                            */
-  #define _IPP    _IPP_PX
-  #define _IPP32E _IPP32E_N0
-  #define _IPPLRB _IPPLRB_PX
-  #define _IPPLP32 _IPPLP32_PX
-  #define _IPPLP64 _IPPLP64_PX
-
-#elif defined( _K0 ) /* SkyLake Xeon (AVX-512) x64                   */
-  #define _IPP    _IPP_PX
-  #define _IPP32E _IPP32E_K0
-  #define _IPPLRB _IPPLRB_PX
-  #define _IPPLP32 _IPPLP32_PX
-  #define _IPPLP64 _IPPLP64_PX
-
-#elif defined( _B2 ) /* KNC (MIC)                                    */
-  #define _IPP    _IPP_PX
-  #define _IPP32E _IPP32E_PX
-  #define _IPPLRB _IPPLRB_B2
-  #define _IPPLP32 _IPPLP32_PX
-  #define _IPPLP64 _IPPLP64_PX
-
-#elif defined( _S8 ) /* old Atom (SSSE3+movbe) (Silverthorne) ia32   */
-  #define _IPP    _IPP_V8
-  #define _IPP32E _IPP32E_PX
-  #define _IPPLRB _IPPLRB_PX
-  #define _IPPLP32 _IPPLP32_S8
-  #define _IPPLP64 _IPPLP64_PX
-
-#elif defined( _N8 ) /* old Atom (SSSE3+movbe) (Silverthorne) x64    */
-  #define _IPP    _IPP_PX
-  #define _IPP32E _IPP32E_U8
-  #define _IPPLRB _IPPLRB_PX
-  #define _IPPLP32 _IPPLP32_PX
-  #define _IPPLP64 _IPPLP64_N8
-
-#else
-  #define _IPP    _IPP_PX
-  #define _IPP32E _IPP32E_PX
-  #define _IPPLRB _IPPLRB_PX
-  #define _IPPLP32 _IPPLP32_PX
-  #define _IPPLP64 _IPPLP64_PX
-
-#endif
-
-
-#define _IPP_ARCH_IA32    1
-#define _IPP_ARCH_IA64    2
-#define _IPP_ARCH_EM64T   4
-#define _IPP_ARCH_XSC     8
-#define _IPP_ARCH_LRB     16
-#define _IPP_ARCH_LP32    32
-#define _IPP_ARCH_LP64    64
-#define _IPP_ARCH_LRB2    128
-
-#if defined ( _ARCH_IA32 )
-  #define _IPP_ARCH    _IPP_ARCH_IA32
-
-#elif defined( _ARCH_EM64T )
-  #define _IPP_ARCH    _IPP_ARCH_EM64T
-
-#elif defined( _ARCH_LRB2 )
-  #define _IPP_ARCH    _IPP_ARCH_LRB2
-
-#elif defined( _ARCH_LP32 )
-  #define _IPP_ARCH    _IPP_ARCH_LP32
-
-#elif defined( _ARCH_LP64 )
-  #define _IPP_ARCH    _IPP_ARCH_LP64
-
-#else
-  #if defined(_M_AMD64) || defined(__x86_64) || defined(__x86_64__)
-    #define _IPP_ARCH    _IPP_ARCH_EM64T
-
-  #else
-    #define _IPP_ARCH    _IPP_ARCH_IA32
-
-  #endif
-#endif
-
-#if ((_IPP_ARCH == _IPP_ARCH_IA32) || (_IPP_ARCH == _IPP_ARCH_LP32))
-__INLINE
-Ipp32s IPP_INT_PTR( const void* ptr )  {
-    union {
-        void*   Ptr;
-        Ipp32s  Int;
-    } dd;
-    dd.Ptr = (void*)ptr;
-    return dd.Int;
-}
-
-__INLINE
-Ipp32u IPP_UINT_PTR( const void* ptr )  {
-    union {
-        void*   Ptr;
-        Ipp32u  Int;
-    } dd;
-    dd.Ptr = (void*)ptr;
-    return dd.Int;
-}
-#elif ((_IPP_ARCH == _IPP_ARCH_EM64T) || (_IPP_ARCH == _IPP_ARCH_LRB2) || (_IPP_ARCH == _IPP_ARCH_LP64))
-__INLINE
-Ipp64s IPP_INT_PTR( const void* ptr )  {
-    union {
-        void*   Ptr;
-        Ipp64s  Int;
-    } dd;
-    dd.Ptr = (void*)ptr;
-    return dd.Int;
-}
-
-__INLINE
-Ipp64u IPP_UINT_PTR( const void* ptr )  {
-    union {
-        void*    Ptr;
-        Ipp64u   Int;
-    } dd;
-    dd.Ptr = (void*)ptr;
-    return dd.Int;
-}
-#else
-  #define IPP_INT_PTR( ptr )  ( (long)(ptr) )
-  #define IPP_UINT_PTR( ptr ) ( (unsigned long)(ptr) )
-#endif
-
-#define IPP_ALIGN_TYPE(type, align) ((align)/sizeof(type)-1)
-#define IPP_BYTES_TO_ALIGN(ptr, align) ((-(IPP_INT_PTR(ptr)&((align)-1)))&((align)-1))
-#define IPP_ALIGNED_PTR(ptr, align) (void*)( (unsigned char*)(ptr) + (IPP_BYTES_TO_ALIGN( ptr, align )) )
-
-#define IPP_ALIGNED_SIZE(size, align) (((size)+(align)-1)&~((align)-1))
-
-#define IPP_MALLOC_ALIGNED_BYTES   64
-#define IPP_MALLOC_ALIGNED_8BYTES   8
-#define IPP_MALLOC_ALIGNED_16BYTES 16
-#define IPP_MALLOC_ALIGNED_32BYTES 32
-
-#define IPP_ALIGNED_ARRAY(align,arrtype,arrname,arrlength)\
- char arrname##AlignedArrBuff[sizeof(arrtype)*(arrlength)+IPP_ALIGN_TYPE(char, align)];\
- arrtype *arrname = (arrtype*)IPP_ALIGNED_PTR(arrname##AlignedArrBuff,align)
-
-#if defined( __cplusplus )
-extern "C" {
-#endif
-
-/* /////////////////////////////////////////////////////////////////////////////
-
-           IPP Context Identification
-
-  /////////////////////////////////////////////////////////////////////////// */
-
-#define IPP_CONTEXT( a, b, c, d) \
-            (int)(((unsigned)(a) << 24) | ((unsigned)(b) << 16) | \
-            ((unsigned)(c) << 8) | (unsigned)(d))
-
-typedef enum {
-    idCtxUnknown = 0,
-    idCtxFFT_C_16sc,
-    idCtxFFT_C_16s,
-    idCtxFFT_R_16s,
-    idCtxFFT_C_32fc,
-    idCtxFFT_C_32f,
-    idCtxFFT_R_32f,
-    idCtxFFT_C_64fc,
-    idCtxFFT_C_64f,
-    idCtxFFT_R_64f,
-    idCtxDFT_C_16sc,
-    idCtxDFT_C_16s,
-    idCtxDFT_R_16s,
-    idCtxDFT_C_32fc,
-    idCtxDFT_C_32f,
-    idCtxDFT_R_32f,
-    idCtxDFT_C_64fc,
-    idCtxDFT_C_64f,
-    idCtxDFT_R_64f,
-    idCtxDCTFwd_16s,
-    idCtxDCTInv_16s,
-    idCtxDCTFwd_32f,
-    idCtxDCTInv_32f,
-    idCtxDCTFwd_64f,
-    idCtxDCTInv_64f,
-    idCtxFFT2D_C_32fc,
-    idCtxFFT2D_R_32f,
-    idCtxDFT2D_C_32fc,
-    idCtxDFT2D_R_32f,
-    idCtxFFT2D_R_32s,
-    idCtxDFT2D_R_32s,
-    idCtxDCT2DFwd_32f,
-    idCtxDCT2DInv_32f,
-    idCtxMoment64f,
-    idCtxMoment64s,
-    idCtxRandUni_8u,
-    idCtxRandUni_16s,
-    idCtxRandUni_32f,
-    idCtxRandUni_64f,
-    idCtxRandGauss_8u,
-    idCtxRandGauss_16s,
-    idCtxRandGauss_32f,
-    idCtxRandGauss_64f,
-    idCtxWTFwd_32f,
-    idCtxWTFwd_8u32f,
-    idCtxWTFwd_8s32f,
-    idCtxWTFwd_16u32f,
-    idCtxWTFwd_16s32f,
-    idCtxWTFwd2D_32f_C1R,
-    idCtxWTInv2D_32f_C1R,
-    idCtxWTFwd2D_32f_C3R,
-    idCtxWTInv2D_32f_C3R,
-    idCtxWTInv_32f,
-    idCtxWTInv_32f8u,
-    idCtxWTInv_32f8s,
-    idCtxWTInv_32f16u,
-    idCtxWTInv_32f16s,
-    idCtxMDCTFwd_32f,
-    idCtxMDCTInv_32f,
-    idCtxMDCTFwd_16s,
-    idCtxFIRBlock_32f,
-    idCtxFDP_32f,
-    idCtxRLMS_32f       = IPP_CONTEXT( 'L', 'M', 'S', '1'),
-    idCtxRLMS32f_16s    = IPP_CONTEXT( 'L', 'M', 'S', 0 ),
-    idCtxIIRAR_32f      = IPP_CONTEXT( 'I', 'I', '0', '1'),
-    idCtxIIRBQ_32f      = IPP_CONTEXT( 'I', 'I', '0', '2'),
-    idCtxIIRAR_32fc     = IPP_CONTEXT( 'I', 'I', '0', '3'),
-    idCtxIIRBQ_32fc     = IPP_CONTEXT( 'I', 'I', '0', '4'),
-    idCtxIIRAR32f_16s   = IPP_CONTEXT( 'I', 'I', '0', '5'),
-    idCtxIIRBQ32f_16s   = IPP_CONTEXT( 'I', 'I', '0', '6'),
-    idCtxIIRAR32fc_16sc = IPP_CONTEXT( 'I', 'I', '0', '7'),
-    idCtxIIRBQ32fc_16sc = IPP_CONTEXT( 'I', 'I', '0', '8'),
-    idCtxIIRAR32s_16s   = IPP_CONTEXT( 'I', 'I', '0', '9'),
-    idCtxIIRBQ32s_16s   = IPP_CONTEXT( 'I', 'I', '1', '0'),
-    idCtxIIRAR32sc_16sc = IPP_CONTEXT( 'I', 'I', '1', '1'),
-    idCtxIIRBQ32sc_16sc = IPP_CONTEXT( 'I', 'I', '1', '2'),
-    idCtxIIRAR_64f      = IPP_CONTEXT( 'I', 'I', '1', '3'),
-    idCtxIIRBQ_64f      = IPP_CONTEXT( 'I', 'I', '1', '4'),
-    idCtxIIRAR_64fc     = IPP_CONTEXT( 'I', 'I', '1', '5'),
-    idCtxIIRBQ_64fc     = IPP_CONTEXT( 'I', 'I', '1', '6'),
-    idCtxIIRAR64f_32f   = IPP_CONTEXT( 'I', 'I', '1', '7'),
-    idCtxIIRBQ64f_32f   = IPP_CONTEXT( 'I', 'I', '1', '8'),
-    idCtxIIRAR64fc_32fc = IPP_CONTEXT( 'I', 'I', '1', '9'),
-    idCtxIIRBQ64fc_32fc = IPP_CONTEXT( 'I', 'I', '2', '0'),
-    idCtxIIRAR64f_32s   = IPP_CONTEXT( 'I', 'I', '2', '1'),
-    idCtxIIRBQ64f_32s   = IPP_CONTEXT( 'I', 'I', '2', '2'),
-    idCtxIIRAR64fc_32sc = IPP_CONTEXT( 'I', 'I', '2', '3'),
-    idCtxIIRBQ64fc_32sc = IPP_CONTEXT( 'I', 'I', '2', '4'),
-    idCtxIIRAR64f_16s   = IPP_CONTEXT( 'I', 'I', '2', '5'),
-    idCtxIIRBQ64f_16s   = IPP_CONTEXT( 'I', 'I', '2', '6'),
-    idCtxIIRAR64fc_16sc = IPP_CONTEXT( 'I', 'I', '2', '7'),
-    idCtxIIRBQ64fc_16sc = IPP_CONTEXT( 'I', 'I', '2', '8'),
-    idCtxIIRBQDF1_32f   = IPP_CONTEXT( 'I', 'I', '2', '9'),
-    idCtxIIRBQDF164f_32s= IPP_CONTEXT( 'I', 'I', '3', '0'),
-    idCtxFIRSR_32f      = IPP_CONTEXT( 'F', 'I', '0', '1'),
-    idCtxFIRSR_32fc     = IPP_CONTEXT( 'F', 'I', '0', '2'),
-    idCtxFIRMR_32f      = IPP_CONTEXT( 'F', 'I', '0', '3'),
-    idCtxFIRMR_32fc     = IPP_CONTEXT( 'F', 'I', '0', '4'),
-    idCtxFIRSR32f_16s   = IPP_CONTEXT( 'F', 'I', '0', '5'),
-    idCtxFIRSR32fc_16sc = IPP_CONTEXT( 'F', 'I', '0', '6'),
-    idCtxFIRMR32f_16s   = IPP_CONTEXT( 'F', 'I', '0', '7'),
-    idCtxFIRMR32fc_16sc = IPP_CONTEXT( 'F', 'I', '0', '8'),
-    idCtxFIRSR32s_16s   = IPP_CONTEXT( 'F', 'I', '0', '9'),
-    idCtxFIRSR32sc_16sc = IPP_CONTEXT( 'F', 'I', '1', '0'),
-    idCtxFIRMR32s_16s   = IPP_CONTEXT( 'F', 'I', '1', '1'),
-    idCtxFIRMR32sc_16sc = IPP_CONTEXT( 'F', 'I', '1', '2'),
-    idCtxFIRSR_64f      = IPP_CONTEXT( 'F', 'I', '1', '3'),
-    idCtxFIRSR_64fc     = IPP_CONTEXT( 'F', 'I', '1', '4'),
-    idCtxFIRMR_64f      = IPP_CONTEXT( 'F', 'I', '1', '5'),
-    idCtxFIRMR_64fc     = IPP_CONTEXT( 'F', 'I', '1', '6'),
-    idCtxFIRSR64f_32f   = IPP_CONTEXT( 'F', 'I', '1', '7'),
-    idCtxFIRSR64fc_32fc = IPP_CONTEXT( 'F', 'I', '1', '8'),
-    idCtxFIRMR64f_32f   = IPP_CONTEXT( 'F', 'I', '1', '9'),
-    idCtxFIRMR64fc_32fc = IPP_CONTEXT( 'F', 'I', '2', '0'),
-    idCtxFIRSR64f_32s   = IPP_CONTEXT( 'F', 'I', '2', '1'),
-    idCtxFIRSR64fc_32sc = IPP_CONTEXT( 'F', 'I', '2', '2'),
-    idCtxFIRMR64f_32s   = IPP_CONTEXT( 'F', 'I', '2', '3'),
-    idCtxFIRMR64fc_32sc = IPP_CONTEXT( 'F', 'I', '2', '4'),
-    idCtxFIRSR64f_16s   = IPP_CONTEXT( 'F', 'I', '2', '5'),
-    idCtxFIRSR64fc_16sc = IPP_CONTEXT( 'F', 'I', '2', '6'),
-    idCtxFIRMR64f_16s   = IPP_CONTEXT( 'F', 'I', '2', '7'),
-    idCtxFIRMR64fc_16sc = IPP_CONTEXT( 'F', 'I', '2', '8'),
-    idCtxFIRSR_16s      = IPP_CONTEXT( 'F', 'I', '2', '9'),
-    idCtxFIRMR_16s      = IPP_CONTEXT( 'F', 'I', '3', '0'),
-    idCtxFIRSRStream_16s= IPP_CONTEXT( 'F', 'I', '3', '1'),
-    idCtxFIRMRStream_16s= IPP_CONTEXT( 'F', 'I', '3', '2'),
-    idCtxFIRSRStream_32f= IPP_CONTEXT( 'F', 'I', '3', '3'),
-    idCtxFIRMRStream_32f= IPP_CONTEXT( 'F', 'I', '3', '4'),
-    idCtxRLMS32s_16s    = IPP_CONTEXT( 'L', 'M', 'S', 'R'),
-    idCtxCLMS32s_16s    = IPP_CONTEXT( 'L', 'M', 'S', 'C'),
-    idCtxEncode_JPEG2K,
-    idCtxDES            = IPP_CONTEXT( ' ', 'D', 'E', 'S'),
-    idCtxBlowfish       = IPP_CONTEXT( ' ', ' ', 'B', 'F'),
-    idCtxRijndael       = IPP_CONTEXT( ' ', 'R', 'I', 'J'),
-    idCtxSMS4           = IPP_CONTEXT( 'S', 'M', 'S', '4'),
-    idCtxTwofish        = IPP_CONTEXT( ' ', ' ', 'T', 'F'),
-    idCtxARCFOUR        = IPP_CONTEXT( ' ', 'R', 'C', '4'),
-    idCtxRC564          = IPP_CONTEXT( 'R', 'C', '5', '1'),
-    idCtxRC5128         = IPP_CONTEXT( 'R', 'C', '5', '2'),
-    idCtxSHA1           = IPP_CONTEXT( 'S', 'H', 'S', '1'),
-    idCtxSHA224         = IPP_CONTEXT( 'S', 'H', 'S', '3'),
-    idCtxSHA256         = IPP_CONTEXT( 'S', 'H', 'S', '2'),
-    idCtxSHA384         = IPP_CONTEXT( 'S', 'H', 'S', '4'),
-    idCtxSHA512         = IPP_CONTEXT( 'S', 'H', 'S', '5'),
-    idCtxMD5            = IPP_CONTEXT( ' ', 'M', 'D', '5'),
-    idCtxHMAC           = IPP_CONTEXT( 'H', 'M', 'A', 'C'),
-    idCtxDAA            = IPP_CONTEXT( ' ', 'D', 'A', 'A'),
-    idCtxBigNum         = IPP_CONTEXT( 'B', 'I', 'G', 'N'),
-    idCtxMontgomery     = IPP_CONTEXT( 'M', 'O', 'N', 'T'),
-    idCtxPrimeNumber    = IPP_CONTEXT( 'P', 'R', 'I', 'M'),
-    idCtxPRNG           = IPP_CONTEXT( 'P', 'R', 'N', 'G'),
-    idCtxRSA            = IPP_CONTEXT( ' ', 'R', 'S', 'A'),
-    idCtxRSA_PubKey     = IPP_CONTEXT( 'R', 'S', 'A', '0'),
-    idCtxRSA_PrvKey1    = IPP_CONTEXT( 'R', 'S', 'A', '1'),
-    idCtxRSA_PrvKey2    = IPP_CONTEXT( 'R', 'S', 'A', '2'),
-    idCtxDSA            = IPP_CONTEXT( ' ', 'D', 'S', 'A'),
-    idCtxECCP           = IPP_CONTEXT( ' ', 'E', 'C', 'P'),
-    idCtxECCB           = IPP_CONTEXT( ' ', 'E', 'C', 'B'),
-    idCtxECCPPoint      = IPP_CONTEXT( 'P', 'E', 'C', 'P'),
-    idCtxECCBPoint      = IPP_CONTEXT( 'P', 'E', 'C', 'B'),
-    idCtxDH             = IPP_CONTEXT( ' ', ' ', 'D', 'H'),
-    idCtxDLP            = IPP_CONTEXT( ' ', 'D', 'L', 'P'),
-    idCtxCMAC           = IPP_CONTEXT( 'C', 'M', 'A', 'C'),
-    idCtxRFFT2_8u,
-    idCtxHilbert_32f32fc,
-    idCtxHilbert_16s32fc,
-    idCtxHilbert_16s16sc,
-    idCtxTone_16s,
-    idCtxTriangle_16s,
-    idCtxDFTOutOrd_C_32fc,
-    idCtxDFTOutOrd_C_64fc,
-    idCtxFFT_C_32sc,
-    idCtxFFT_C_32s,
-    idCtxFFT_R_32s,
-    idCtxFFT_R_16s32s,
-    idCtxDecodeProgr_JPEG2K,
-    idCtxWarp_MPEG4,
-    idCtxQuantInvIntra_MPEG4,
-    idCtxQuantInvInter_MPEG4,
-    idCtxQuantIntra_MPEG4,
-    idCtxQuantInter_MPEG4,
-    idCtxAnalysisFilter_SBR_C_32f32fc,
-    idCtxAnalysisFilter_SBR_C_32f,
-    idCtxAnalysisFilter_SBR_R_32f,
-    idCtxSynthesisFilter_SBR_C_32fc32f,
-    idCtxSynthesisFilter_SBR_C_32f,
-    idCtxSynthesisFilter_SBR_R_32f,
-    idCtxSynthesisDownFilter_SBR_C_32fc32f,
-    idCtxSynthesisDownFilter_SBR_C_32f,
-    idCtxSynthesisDownFilter_SBR_R_32f,
-    idCtxVLCEncode,
-    idCtxVLCDecode,
-    idCtxAnalysisFilter_SBR_C_32s32sc,
-    idCtxAnalysisFilter_SBR_R_32s,
-    idCtxSynthesisFilter_SBR_C_32sc32s,
-    idCtxSynthesisFilter_SBR_R_32s,
-    idCtxSynthesisDownFilter_SBR_C_32sc32s,
-    idCtxSynthesisDownFilter_SBR_R_32s,
-    idCtxSynthesisFilter_PQMF_MP3_32f,
-    idCtxAnalysisFilter_PQMF_MP3_32f,
-    idCtxResampleRow,
-    idCtxAnalysisFilter_SBR_Enc_C_32f32fc,
-    idCtxSynthesisFilter_DTS_32f,
-    idCtxFilterBilateralGauss_8u,
-    idCtxFilterBilateralGaussFast_8u,
-    idCtxBGF,
-    idCtxPolyGF,
-    idCtxRSenc,
-    idCtxRSdec,
-    idCtxSnow3g        = IPP_CONTEXT( 'S', 'n', 'o', 'w'),
-    idCtxSnow3gF8,
-    idCtxSnow3gF9,
-    idCtxKasumi        = IPP_CONTEXT( 'K', 'a', 's', 'u'),
-    idCtxKasumiF8,
-    idCtxKasumiF9,
-    idCtxResizeHannFilter_8u,
-    idCtxResizeLanczosFilter_8u,
-    idCtxAESXCBC,
-    idCtxAESCCM,
-    idCtxAESGCM,
-    idCtxMsgCatalog,
-    idCtxGFP,
-    idCtxGFPE,
-    idCtxGFPX,
-    idCtxGFPXE,
-    idCtxGFPXQX,
-    idCtxGFPXQXE,
-    idCtxGFPEC,
-    idCtxGFPPoint,
-    idCtxGFPXEC,
-    idCtxGFPXECPoint,
-    idCtxPairing,
-    idCtxResize_32f,
-    idCtxResizeYUV420,
-    idCtxResizeYUV422,
-    idCtxResize_64f,
-    idCtxFilterBilateralBorder,
-    idCtxThresholdAdaptiveGauss,
-    idCtxHOG,
-    idCtxFastN,
-    idCtxHash,
-    idCtxSM3
-} IppCtxId;
-
-
-
-
-/* /////////////////////////////////////////////////////////////////////////////
-           Helpers
-  /////////////////////////////////////////////////////////////////////////// */
-
-#define IPP_NOERROR_RET()  return ippStsNoErr
-#define IPP_ERROR_RET( ErrCode )  return (ErrCode)
-
-#ifdef _IPP_DEBUG
-
-    #define IPP_BADARG_RET( expr, ErrCode )\
-                {if (expr) { IPP_ERROR_RET( ErrCode ); }}
-
-#else
-
-    #define IPP_BADARG_RET( expr, ErrCode )
-
-#endif
-
-
-    #define IPP_BAD_SIZE_RET( n )\
-                IPP_BADARG_RET( (n)<=0, ippStsSizeErr )
-
-    #define IPP_BAD_STEP_RET( n )\
-                IPP_BADARG_RET( (n)<=0, ippStsStepErr )
-
-    #define IPP_BAD_PTR1_RET( ptr )\
-                IPP_BADARG_RET( NULL==(ptr), ippStsNullPtrErr )
-
-    #define IPP_BAD_PTR2_RET( ptr1, ptr2 )\
-                {IPP_BAD_PTR1_RET( ptr1 ); IPP_BAD_PTR1_RET( ptr2 )}
-
-    #define IPP_BAD_PTR3_RET( ptr1, ptr2, ptr3 )\
-                {IPP_BAD_PTR2_RET( ptr1, ptr2 ); IPP_BAD_PTR1_RET( ptr3 )}
-
-    #define IPP_BAD_PTR4_RET( ptr1, ptr2, ptr3, ptr4 )\
-                {IPP_BAD_PTR2_RET( ptr1, ptr2 ); IPP_BAD_PTR2_RET( ptr3, ptr4 )}
-
-    #define IPP_BAD_ISIZE_RET(roi) \
-               IPP_BADARG_RET( ((roi).width<=0 || (roi).height<=0), ippStsSizeErr)
-
-/* ////////////////////////////////////////////////////////////////////////// */
-/*                              internal messages                             */
-
-#define MSG_LOAD_DLL_ERR (-9700) /* Error at loading of %s library */
-#define MSG_NO_DLL       (-9701) /* No DLLs were found in the Waterfall procedure */
-#define MSG_NO_SHARED    (-9702) /* No shared libraries were found in the Waterfall procedure */
-
-/* ////////////////////////////////////////////////////////////////////////// */
-
-
-typedef union { /* double precision */
-    Ipp64s  hex;
-    Ipp64f   fp;
-} IppFP_64f;
-
-typedef union { /* single precision */
-    Ipp32s  hex;
-    Ipp32f   fp;
-} IppFP_32f;
-
-
-extern const IppFP_32f ippConstantOfNAN_32f;
-extern const IppFP_64f ippConstantOfNAN_64f;
-
-extern const IppFP_32f ippConstantOfINF_32f;
-extern const IppFP_64f ippConstantOfINF_64f;
-extern const IppFP_32f ippConstantOfINF_NEG_32f;
-extern const IppFP_64f ippConstantOfINF_NEG_64f;
-
-#define NAN_32F      (ippConstantOfNAN_32f.fp)
-#define NAN_64F      (ippConstantOfNAN_64f.fp)
-#define INF_32F      (ippConstantOfINF_32f.fp)
-#define INF_64F      (ippConstantOfINF_64f.fp)
-#define INF_NEG_32F  (ippConstantOfINF_NEG_32f.fp)
-#define INF_NEG_64F  (ippConstantOfINF_NEG_64f.fp)
-
-/* ////////////////////////////////////////////////////////////////////////// */
-
-typedef enum {
-    ippunreg=-1,
-    ippac   = 0,
-    ippcc   = 1,
-    ippch   = 2,
-    ippcp   = 3,
-    ippcv   = 4,
-    ippdc   = 5,
-    ippdi   = 6,
-    ippgen  = 7,
-    ippi    = 8,
-    ippj    = 9,
-    ippm    = 10,
-    ippr    = 11,
-    ipps    = 12,
-    ippsc   = 13,
-    ippsr   = 14,
-    ippvc   = 15,
-    ippvm   = 16,
-    ippmsdk = 17,
-    ippcpepid = 18,
-    ippe = 19,
-    ipprs = 20,
-    ippsq = 21,
-    ippnomore
-} IppDomain;
-
-int __CDECL ownGetNumThreads( void );
-int __CDECL ownGetFeature( Ipp64u MaskOfFeature ); /* the main function of tick-tock dispatcher */
-
-#ifdef _IPP_DYNAMIC
-typedef IppStatus (__STDCALL *DYN_RELOAD)( int );
-void __CDECL ownRegisterLib( IppDomain, DYN_RELOAD );
-void __CDECL ownUnregisterLib( IppDomain );
-#endif
-
-/*     the number of threads available for any ipp function that uses OMP;     */
-/* at the ippxx.dll loading time is equal to the number of logical processors, */
-/*  and can be changed ONLY externally by library user to any desired number   */
-/*               by means of ippSetNumThreads() function                       */
-#define IPP_GET_NUM_THREADS() ( ownGetNumThreads() )
-#define IPP_OMP_NUM_THREADS() num_threads( IPP_GET_NUM_THREADS() )
-#define IPP_OMP_LIMIT_MAX_NUM_THREADS(n)  num_threads( IPP_MIN(IPP_GET_NUM_THREADS(),(n)))
-
-
-/* ////////////////////////////////////////////////////////////////////////// */
-
-/* Define NULL pointer value */
-#ifndef NULL
-#ifdef  __cplusplus
-#define NULL    0
-#else
-#define NULL    ((void *)0)
-#endif
-#endif
-
-#define UNREFERENCED_PARAMETER(p) (p)=(p)
-
-#if defined( _IPP_MARK_LIBRARY )
-static char G[] = {73, 80, 80, 71, 101, 110, 117, 105, 110, 101, 243, 193, 210, 207, 215};
-#endif
-
-
-#define STR2(x)           #x
-#define STR(x)       STR2(x)
-#define MESSAGE( desc )\
-     message(__FILE__ "(" STR(__LINE__) "):" #desc)
-
-/*
-// endian definition
-*/
-#define IPP_LITTLE_ENDIAN  (0)
-#define IPP_BIG_ENDIAN     (1)
-
-#if defined( _IPP_LE )
-   #define IPP_ENDIAN IPP_LITTLE_ENDIAN
-
-#elif defined( _IPP_BE )
-   #define IPP_ENDIAN IPP_BIG_ENDIAN
-
-#else
-   #if defined( __ARMEB__ )
-     #define IPP_ENDIAN IPP_BIG_ENDIAN
-
-   #else
-     #define IPP_ENDIAN IPP_LITTLE_ENDIAN
-
-   #endif
-#endif
-
-
-/* ////////////////////////////////////////////////////////////////////////// */
-
-/* intrinsics */
-#if (_IPP >= _IPP_A6) || (_IPP32E >= _IPP32E_M7)
-    #if defined(__INTEL_COMPILER) || (_MSC_VER >= 1300)
-        #if (_IPP == _IPP_A6)
-            #include "xmmintrin.h"
-        #elif (_IPP == _IPP_W7)
-            #if defined(__INTEL_COMPILER)
-              #include "emmintrin.h"
-            #else
-              #undef _W7
-              #include "emmintrin.h"
-              #define _W7
-            #endif
-            #define _mm_loadu _mm_loadu_si128
-        #elif (_IPP == _IPP_T7) || (_IPP32E == _IPP32E_M7)
-            #if defined(__INTEL_COMPILER)
-                #include "pmmintrin.h"
-                #define _mm_loadu _mm_lddqu_si128
-            #elif (_MSC_FULL_VER >= 140050110)
-                #include "intrin.h"
-                #define _mm_loadu _mm_lddqu_si128
-            #elif (_MSC_FULL_VER < 140050110)
-                #include "emmintrin.h"
-                #define _mm_loadu _mm_loadu_si128
-            #endif
-        #elif (_IPP == _IPP_V8) || (_IPP32E == _IPP32E_U8)
-            #if defined(__INTEL_COMPILER)
-                #include "tmmintrin.h"
-                #define _mm_loadu _mm_lddqu_si128
-            #elif (_MSC_FULL_VER >= 140050110)
-                #include "intrin.h"
-                #define _mm_loadu _mm_lddqu_si128
-            #elif (_MSC_FULL_VER < 140050110)
-                #include "emmintrin.h"
-                #define _mm_loadu _mm_loadu_si128
-            #endif
-        #elif (_IPP == _IPP_P8) || (_IPP32E == _IPP32E_Y8)
-            #if defined(__INTEL_COMPILER)
-                #include "smmintrin.h"
-                #define _mm_loadu _mm_lddqu_si128
-            #elif (_MSC_FULL_VER >= 140050110)
-                #include "intrin.h"
-                #define _mm_loadu _mm_lddqu_si128
-            #elif (_MSC_FULL_VER < 140050110)
-                #include "emmintrin.h"
-                #define _mm_loadu _mm_loadu_si128
-            #endif
-        #elif (_IPP >= _IPP_G9) || (_IPP32E >= _IPP32E_E9)
-            #if defined(__INTEL_COMPILER)
-                #include "immintrin.h"
-                #define _mm_loadu _mm_lddqu_si128
-            #elif (_MSC_FULL_VER >= 160021003)
-                #include "immintrin.h"
-                #define _mm_loadu _mm_lddqu_si128
-            #endif
-        #endif
-    #endif
-#elif (_IPPLP32 >= _IPPLP32_S8) || (_IPPLP64 >= _IPPLP64_N8)
-    #if defined(__INTEL_COMPILER)
-        #include "tmmintrin.h"
-        #define _mm_loadu _mm_lddqu_si128
-    #elif (_MSC_FULL_VER >= 140050110)
-        #include "intrin.h"
-        #define _mm_loadu _mm_lddqu_si128
-    #elif (_MSC_FULL_VER < 140050110)
-        #include "emmintrin.h"
-        #define _mm_loadu _mm_loadu_si128
-    #endif
-#elif (_IPPLRB >= _IPPLRB_B2)
-    #if defined(__INTEL_COMPILER) || defined(_REF_LIB)
-        #include "immintrin.h"
-    #endif
-#endif
-
-// **** intrinsics for bit casting ****
-#if defined(__INTEL_COMPILER)
-extern unsigned int      __intel_castf32_u32(float val);
-extern float             __intel_castu32_f32(unsigned int val);
-extern unsigned __int64  __intel_castf64_u64(double val);
-extern double            __intel_castu64_f64(unsigned __int64 val);
- #define __CAST_32f32u(val) __intel_castf32_u32((Ipp32f)val)
- #define __CAST_32u32f(val) __intel_castu32_f32((Ipp32u)val)
- #define __CAST_64f64u(val) __intel_castf64_u64((Ipp64f)val)
- #define __CAST_64u64f(val) __intel_castu64_f64((Ipp64u)val)
-#else
- #define __CAST_32f32u(val) ( *((Ipp32u*)&val) )
- #define __CAST_32u32f(val) ( *((Ipp32f*)&val) )
- #define __CAST_64f64u(val) ( *((Ipp64u*)&val) )
- #define __CAST_64u64f(val) ( *((Ipp64f*)&val) )
-#endif
-
-
-// short names for vector registers casting
-#define _pd2ps _mm_castpd_ps
-#define _ps2pd _mm_castps_pd
-#define _pd2pi _mm_castpd_si128
-#define _pi2pd _mm_castsi128_pd
-#define _ps2pi _mm_castps_si128
-#define _pi2ps _mm_castsi128_ps
-
-#define _ypd2ypi _mm256_castpd_si256
-#define _ypi2ypd _mm256_castsi256_pd
-#define _yps2ypi _mm256_castps_si256
-#define _ypi2yps _mm256_castsi256_ps
-#define _ypd2yps _mm256_castpd_ps
-#define _yps2ypd _mm256_castps_pd
-
-#define _yps2ps _mm256_castps256_ps128
-#define _ypi2pi _mm256_castsi256_si128
-#define _ypd2pd _mm256_castpd256_pd128
-#define _ps2yps _mm256_castps128_ps256
-#define _pi2ypi _mm256_castsi128_si256
-#define _pd2ypd _mm256_castpd128_pd256
-
-
-#if defined(__INTEL_COMPILER)
-#define __IVDEP ivdep
-#else
-#define __IVDEP message("message :: 'ivdep' is not defined")
-#endif
-//usage: #pragma __IVDEP
-
-/* //////////////////////////////////////////////////////////////////////////
-  _IPP_DATA shoul be defined only:
-    - if compile not merged library
-    - only for 1 CPU for merged library to avoid data duplication
-*/
-#if defined( _MERGED_BLD ) && ( defined(_G9) || defined(_E9) ) /* compile data only for g9 and e9 CPU */
-  #define _IPP_DATA 1
-#elif !defined( _MERGED_BLD ) /* compile data if it isn't merged library */
-  #define _IPP_DATA 1
-#endif
-
-
-#if defined( __cplusplus )
-}
-#endif
-
-#endif /* __OWNDEFS_H__ */
-

+ 0 - 149
external/crypto_px/sources/ippcp/src/owncp.h

@@ -1,149 +0,0 @@
-/*
-* Copyright (C) 2016 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 __OWNCP_H__
-#define __OWNCP_H__
-
-#ifndef __OWNDEFS_H__
-  #include "owndefs.h"
-#endif
-
-#ifndef __IPPCP_H__
-  #include "ippcp.h"
-#endif
-
-#pragma warning( disable : 4324)
-
-/* ippCP length */
-typedef int cpSize;
-
-/*
-// common macros & definitions
-*/
-
-/* size of cache line (bytes) */
-#define CACHE_LINE_SIZE      (64)
-#define LOG_CACHE_LINE_SIZE   (6)
-
-/* swap data & pointers */
-#define SWAP_PTR(ATYPE, pX,pY)   { ATYPE* aPtr=(pX); (pX)=(pY); (pY)=aPtr; }
-#define SWAP(x,y)                {(x)^=(y); (y)^=(x); (x)^=(y);}
-
-/* alignment value */
-#define ALIGN_VAL ((int)sizeof(void*))
-
-/* bitsize */
-#define BYTESIZE     (8)
-#define BITSIZE(x)   ((int)(sizeof(x)*BYTESIZE))
-
-/* bit length -> byte/word length conversion */
-#define BITS2WORD8_SIZE(x)  (((x)+ 7)>>3)
-#define BITS2WORD16_SIZE(x) (((x)+15)>>4)
-#define BITS2WORD32_SIZE(x) (((x)+31)>>5)
-#define BITS2WORD64_SIZE(x) (((x)+63)>>6)
-
-/* WORD and DWORD manipulators */
-#define LODWORD(x)    ((Ipp32u)(x))
-#define HIDWORD(x)    ((Ipp32u)(((Ipp64u)(x) >>32) & 0xFFFFFFFF))
-
-#define MAKEHWORD(bLo,bHi) ((Ipp16u)(((Ipp8u)(bLo))  | ((Ipp16u)((Ipp8u)(bHi))) << 8))
-#define MAKEWORD(hLo,hHi)  ((Ipp32u)(((Ipp16u)(hLo)) | ((Ipp32u)((Ipp16u)(hHi))) << 16))
-#define MAKEDWORD(wLo,wHi) ((Ipp64u)(((Ipp32u)(wLo)) | ((Ipp64u)((Ipp32u)(wHi))) << 32))
-
-/* extract byte */
-#define EBYTE(w,n) ((Ipp8u)((w) >> (8 * (n))))
-
-/* hexString <-> Ipp32u conversion */
-#define HSTRING_TO_U32(ptrByte)  \
-         (((ptrByte)[0]) <<24)   \
-        +(((ptrByte)[1]) <<16)   \
-        +(((ptrByte)[2]) <<8)    \
-        +((ptrByte)[3])
-#define U32_TO_HSTRING(ptrByte, x)  \
-   (ptrByte)[0] = (Ipp8u)((x)>>24); \
-   (ptrByte)[1] = (Ipp8u)((x)>>16); \
-   (ptrByte)[2] = (Ipp8u)((x)>>8);  \
-   (ptrByte)[3] = (Ipp8u)(x)
-
-/* 32- and 64-bit masks for MSB of nbits-sequence */
-#define MAKEMASK32(nbits) (0xFFFFFFFF >>((32 - ((nbits)&0x1F)) &0x1F))
-#define MAKEMASK64(nbits) (0xFFFFFFFFFFFFFFFF >>((64 - ((nbits)&0x3F)) &0x3F))
-
-/* Logical Shifts (right and left) of WORD */
-#define LSR32(x,nBits)  ((x)>>(nBits))
-#define LSL32(x,nBits)  ((x)<<(nBits))
-
-/* Rorate (right and left) of WORD */
-#if defined(_MSC_VER)
-#  include <stdlib.h>
-#  define ROR32(x, nBits)  _lrotr((x),(nBits))
-#  define ROL32(x, nBits)  _lrotl((x),(nBits))
-#else
-#  define ROR32(x, nBits) (LSR32((x),(nBits)) | LSL32((x),32-(nBits)))
-#  define ROL32(x, nBits) ROR32((x),(32-(nBits)))
-#endif
-
-/* Logical Shifts (right and left) of DWORD */
-#define LSR64(x,nBits)  ((x)>>(nBits))
-#define LSL64(x,nBits)  ((x)<<(nBits))
-
-/* Rorate (right and left) of DWORD */
-#define ROR64(x, nBits) (LSR64((x),(nBits)) | LSL64((x),64-(nBits)))
-#define ROL64(x, nBits) ROR64((x),(64-(nBits)))
-
-/* change endian */
-#if defined(_MSC_VER)
-#  define ENDIANNESS(x)   _byteswap_ulong((x))
-#  define ENDIANNESS32(x)  ENDIANNESS((x))
-#  define ENDIANNESS64(x) _byteswap_uint64((x))
-#else
-#  define ENDIANNESS(x) ((ROR32((x), 24) & 0x00ff00ff) | (ROR32((x), 8) & 0xff00ff00))
-#  define ENDIANNESS32(x) ENDIANNESS((x))
-#  define ENDIANNESS64(x) MAKEDWORD(ENDIANNESS(HIDWORD((x))), ENDIANNESS(LODWORD((x))))
-#endif
-
-#define IPP_MAKE_MULTIPLE_OF_8(x) ((x) = ((x)+7)&(~7))
-#define IPP_MAKE_MULTIPLE_OF_16(x) ((x) = ((x)+15)&(~15))
-
-/* 64-bit constant */
-#if !defined(__GNUC__)
-   #define CONST_64(x)  (x) /*(x##i64)*/
-#else
-   #define CONST_64(x)  (x##LL)
-#endif
-
-/* copy under mask */
-#define MASKED_COPY_BNU(dst, mask, src1, src2, len) { \
-   cpSize i; \
-   for(i=0; i<(len); i++) (dst)[i] = ((mask) & (src1)[i]) | (~(mask) & (src2)[i]); \
-}
-
-#endif /* __OWNCP_H__ */

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