commit
f8499ea4d4
|
@ -0,0 +1,58 @@
|
||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio 2013
|
||||||
|
VisualStudioVersion = 12.0.31101.0
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "benchmark", "Benchmarks\Benchmarks.vcxproj", "{C1574FBF-5346-480F-8DAD-A547480FF9F1}"
|
||||||
|
EndProject
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Enclave", "Enclave\Enclave.vcxproj", "{BA00CB73-68CC-4BAD-8C00-ABEE66B4EB1C}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Win32 = Debug|Win32
|
||||||
|
Debug|x64 = Debug|x64
|
||||||
|
Prerelease|Win32 = Prerelease|Win32
|
||||||
|
Prerelease|x64 = Prerelease|x64
|
||||||
|
Release|Win32 = Release|Win32
|
||||||
|
Release|x64 = Release|x64
|
||||||
|
Simulation|Win32 = Simulation|Win32
|
||||||
|
Simulation|x64 = Simulation|x64
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{C1574FBF-5346-480F-8DAD-A547480FF9F1}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||||
|
{C1574FBF-5346-480F-8DAD-A547480FF9F1}.Debug|Win32.Build.0 = Debug|Win32
|
||||||
|
{C1574FBF-5346-480F-8DAD-A547480FF9F1}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
|
{C1574FBF-5346-480F-8DAD-A547480FF9F1}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
{C1574FBF-5346-480F-8DAD-A547480FF9F1}.Prerelease|Win32.ActiveCfg = Prerelease|Win32
|
||||||
|
{C1574FBF-5346-480F-8DAD-A547480FF9F1}.Prerelease|Win32.Build.0 = Prerelease|Win32
|
||||||
|
{C1574FBF-5346-480F-8DAD-A547480FF9F1}.Prerelease|x64.ActiveCfg = Prerelease|x64
|
||||||
|
{C1574FBF-5346-480F-8DAD-A547480FF9F1}.Prerelease|x64.Build.0 = Prerelease|x64
|
||||||
|
{C1574FBF-5346-480F-8DAD-A547480FF9F1}.Release|Win32.ActiveCfg = Release|Win32
|
||||||
|
{C1574FBF-5346-480F-8DAD-A547480FF9F1}.Release|Win32.Build.0 = Release|Win32
|
||||||
|
{C1574FBF-5346-480F-8DAD-A547480FF9F1}.Release|x64.ActiveCfg = Release|x64
|
||||||
|
{C1574FBF-5346-480F-8DAD-A547480FF9F1}.Release|x64.Build.0 = Release|x64
|
||||||
|
{C1574FBF-5346-480F-8DAD-A547480FF9F1}.Simulation|Win32.ActiveCfg = Simulation|Win32
|
||||||
|
{C1574FBF-5346-480F-8DAD-A547480FF9F1}.Simulation|Win32.Build.0 = Simulation|Win32
|
||||||
|
{C1574FBF-5346-480F-8DAD-A547480FF9F1}.Simulation|x64.ActiveCfg = Simulation|x64
|
||||||
|
{C1574FBF-5346-480F-8DAD-A547480FF9F1}.Simulation|x64.Build.0 = Simulation|x64
|
||||||
|
{BA00CB73-68CC-4BAD-8C00-ABEE66B4EB1C}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||||
|
{BA00CB73-68CC-4BAD-8C00-ABEE66B4EB1C}.Debug|Win32.Build.0 = Debug|Win32
|
||||||
|
{BA00CB73-68CC-4BAD-8C00-ABEE66B4EB1C}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
|
{BA00CB73-68CC-4BAD-8C00-ABEE66B4EB1C}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
{BA00CB73-68CC-4BAD-8C00-ABEE66B4EB1C}.Prerelease|Win32.ActiveCfg = Prerelease|Win32
|
||||||
|
{BA00CB73-68CC-4BAD-8C00-ABEE66B4EB1C}.Prerelease|Win32.Build.0 = Prerelease|Win32
|
||||||
|
{BA00CB73-68CC-4BAD-8C00-ABEE66B4EB1C}.Prerelease|x64.ActiveCfg = Prerelease|x64
|
||||||
|
{BA00CB73-68CC-4BAD-8C00-ABEE66B4EB1C}.Prerelease|x64.Build.0 = Prerelease|x64
|
||||||
|
{BA00CB73-68CC-4BAD-8C00-ABEE66B4EB1C}.Release|Win32.ActiveCfg = Release|Win32
|
||||||
|
{BA00CB73-68CC-4BAD-8C00-ABEE66B4EB1C}.Release|Win32.Build.0 = Release|Win32
|
||||||
|
{BA00CB73-68CC-4BAD-8C00-ABEE66B4EB1C}.Release|x64.ActiveCfg = Release|x64
|
||||||
|
{BA00CB73-68CC-4BAD-8C00-ABEE66B4EB1C}.Release|x64.Build.0 = Release|x64
|
||||||
|
{BA00CB73-68CC-4BAD-8C00-ABEE66B4EB1C}.Simulation|Win32.ActiveCfg = Simulation|Win32
|
||||||
|
{BA00CB73-68CC-4BAD-8C00-ABEE66B4EB1C}.Simulation|Win32.Build.0 = Simulation|Win32
|
||||||
|
{BA00CB73-68CC-4BAD-8C00-ABEE66B4EB1C}.Simulation|x64.ActiveCfg = Simulation|x64
|
||||||
|
{BA00CB73-68CC-4BAD-8C00-ABEE66B4EB1C}.Simulation|x64.Build.0 = Simulation|x64
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
|
@ -0,0 +1,484 @@
|
||||||
|
/* Benchmarks.cpp
|
||||||
|
*
|
||||||
|
* Copyright (C) 2006-2016 wolfSSL Inc.
|
||||||
|
*
|
||||||
|
* This file is part of wolfSSL.
|
||||||
|
*
|
||||||
|
* wolfSSL is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* wolfSSL is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "stdafx.h"
|
||||||
|
#include "Benchmarks.h" /* contains include of Enclave_u.h which has wolfSSL header files */
|
||||||
|
|
||||||
|
/* Check settings of wolfSSL */
|
||||||
|
#if !defined(HAVE_AESGCM) || defined(NO_RSA) || defined(NO_SHA256)
|
||||||
|
#error please enable AES-GCM, RSA, and SHA256
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Use Debug SGX ? */
|
||||||
|
#if _DEBUG
|
||||||
|
#define DEBUG_VALUE SGX_DEBUG_FLAG
|
||||||
|
#else
|
||||||
|
#define DEBUG_VALUE 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define WIN32_LEAN_AND_MEAN
|
||||||
|
#include <windows.h>
|
||||||
|
|
||||||
|
|
||||||
|
/* Choose AES Key size */
|
||||||
|
//#define WC_AES_KEY_SZ 16 /* 128 bit key */
|
||||||
|
#define WC_AES_KEY_SZ 24 /* 192 bit key */
|
||||||
|
|
||||||
|
static double current_time(int reset)
|
||||||
|
{
|
||||||
|
static int init = 0;
|
||||||
|
static LARGE_INTEGER freq;
|
||||||
|
LARGE_INTEGER count;
|
||||||
|
|
||||||
|
(void)reset;
|
||||||
|
|
||||||
|
if (!init) {
|
||||||
|
QueryPerformanceFrequency(&freq);
|
||||||
|
init = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
QueryPerformanceCounter(&count);
|
||||||
|
return (double)count.QuadPart / freq.QuadPart;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void free_resources(byte* plain, byte* cipher) {
|
||||||
|
delete[] plain;
|
||||||
|
delete[] cipher;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* benchmark is performed calling into Enclave on each update
|
||||||
|
* This function tests speeds at different message sizes during update */
|
||||||
|
static double sha256_getTime_multiple(sgx_enclave_id_t id, double* total) {
|
||||||
|
double start, end;
|
||||||
|
int ret, sgxStatus;
|
||||||
|
byte* plain;
|
||||||
|
byte digest[64];
|
||||||
|
int plainSz = (1024 * 1024);
|
||||||
|
int tSz = (1024 * 1024) * numBlocks;
|
||||||
|
int i, k;
|
||||||
|
|
||||||
|
Sha256 sha256;
|
||||||
|
|
||||||
|
ret = 0;
|
||||||
|
k = numBlocks;
|
||||||
|
printf("\n");
|
||||||
|
for (k = 1; k <= numBlocks; k++) {
|
||||||
|
plainSz = tSz / k;
|
||||||
|
plain = new byte[plainSz];
|
||||||
|
ret |= wc_sha256_init(id, &sgxStatus, &sha256);
|
||||||
|
start = current_time(1);
|
||||||
|
for (i = 0; i < k; i++) {
|
||||||
|
ret |= wc_sha256_update(id, &sgxStatus, &sha256, plain, plainSz);
|
||||||
|
}
|
||||||
|
ret |= wc_sha256_final(id, &sgxStatus, &sha256, digest);
|
||||||
|
end = current_time(0);
|
||||||
|
|
||||||
|
if (ret != SGX_SUCCESS || sgxStatus != 0) {
|
||||||
|
printf("Error in SHA256 operation with Enclave: %d sgxStatus = %d.\n", ret, sgxStatus);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
*total = end - start;
|
||||||
|
printf("%8.3f\n", *total);
|
||||||
|
delete[] plain;
|
||||||
|
}
|
||||||
|
printf("\n");
|
||||||
|
*total = end - start;
|
||||||
|
return 1 / *total * numBlocks;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* benchmark is performed calling into Enclave on each update */
|
||||||
|
static double sha256_getTime(sgx_enclave_id_t id, double* total) {
|
||||||
|
double start, end;
|
||||||
|
int ret = 0;
|
||||||
|
int sgxStatus = 0;
|
||||||
|
int i;
|
||||||
|
byte* plain;
|
||||||
|
byte digest[64];
|
||||||
|
int plainSz = (1024 * 1024);
|
||||||
|
|
||||||
|
Sha256 sha256;
|
||||||
|
|
||||||
|
plain = new byte[plainSz];
|
||||||
|
ret |= wc_sha256_init(id, &sgxStatus, &sha256);
|
||||||
|
start = current_time(1);
|
||||||
|
|
||||||
|
/* perform work and get digest */
|
||||||
|
for (i = 0; i < numBlocks; i++) {
|
||||||
|
ret |= wc_sha256_update(id, &sgxStatus, &sha256, plain, plainSz);
|
||||||
|
}
|
||||||
|
ret |= wc_sha256_final(id, &sgxStatus, &sha256, digest);
|
||||||
|
end = current_time(0);
|
||||||
|
|
||||||
|
delete[] plain;
|
||||||
|
if (ret != SGX_SUCCESS || sgxStatus != 0) {
|
||||||
|
printf("Error in SHA256 operation with Enclave: %d sgxStatus = %d.\n", ret, sgxStatus);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
*total = end - start;
|
||||||
|
return 1 / *total * numBlocks;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static int sha256_print(sgx_enclave_id_t id)
|
||||||
|
{
|
||||||
|
double total, persec;
|
||||||
|
|
||||||
|
printf("SHA-256 ");
|
||||||
|
persec = sha256_getTime(id, &total);
|
||||||
|
printf("%d megs took %5.3f seconds , %8.3f MB/s\n", numBlocks, total, persec);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* return time in MB/s with crossing into enclave boundary with each encrypt */
|
||||||
|
static double aesgcm_encrypt_getTime(sgx_enclave_id_t id, double* total, byte* plain, byte* cipher, word32 sz, byte* tag, word32 tagSz)
|
||||||
|
{
|
||||||
|
Aes aes;
|
||||||
|
double start, end;
|
||||||
|
int i;
|
||||||
|
int ret, sgxStatus;
|
||||||
|
|
||||||
|
const byte ad[13] = { 0 };
|
||||||
|
|
||||||
|
const XGEN_ALIGN byte iv[] =
|
||||||
|
{
|
||||||
|
0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef,
|
||||||
|
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||||
|
0x11, 0x21, 0x31, 0x41, 0x51, 0x61, 0x71, 0x81
|
||||||
|
};
|
||||||
|
|
||||||
|
const XGEN_ALIGN byte key[] =
|
||||||
|
{
|
||||||
|
0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
|
||||||
|
0xfe, 0xde, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10,
|
||||||
|
0x89, 0xab, 0xcd, 0xef, 0x01, 0x23, 0x45, 0x67
|
||||||
|
};
|
||||||
|
|
||||||
|
ret = wc_aesgcm_setKey(id, &sgxStatus, &aes, key, WC_AES_KEY_SZ);
|
||||||
|
if (ret != SGX_SUCCESS || sgxStatus != 0) {
|
||||||
|
printf("AES set key failed %d sgxStatus = %d\n", ret, sgxStatus);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
start = current_time(1);
|
||||||
|
for (i = 0; i < numBlocks; i++) {
|
||||||
|
ret = wc_aesgcm_encrypt(id, &sgxStatus, &aes, cipher, plain, sz, iv, 12, tag, tagSz, ad, 13);
|
||||||
|
}
|
||||||
|
end = current_time(0);
|
||||||
|
|
||||||
|
if (ret != SGX_SUCCESS || sgxStatus != 0) {
|
||||||
|
printf("Error in AES-GCM encrypt operation with Enclave: %d sgxStatus = %d.\n", ret, sgxStatus);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
*total = end - start;
|
||||||
|
return 1 / *total * numBlocks;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static int aesgcm_encrypt_print(sgx_enclave_id_t id, byte* plain, byte* cipher, word32 sz, byte* tag, word32 tagSz)
|
||||||
|
{
|
||||||
|
double total, persec;
|
||||||
|
|
||||||
|
printf("AES-GCM encrypt ");
|
||||||
|
persec = aesgcm_encrypt_getTime(id, &total, plain, cipher, sz, tag, tagSz);
|
||||||
|
printf("%d megs took %5.3f seconds , %8.3f MB/s\n", numBlocks, total, persec);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* return MB/s with crossing into Enclave boundary with each decrypt */
|
||||||
|
static double aesgcm_decrypt_getTime(sgx_enclave_id_t id, double* total, byte* plain, const byte* cipher, word32 sz, const byte* tag, word32 tagSz)
|
||||||
|
{
|
||||||
|
Aes aes;
|
||||||
|
double start, end;
|
||||||
|
int ret, sgxStatus;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
const byte ad[13] = { 0 };
|
||||||
|
|
||||||
|
const XGEN_ALIGN byte iv[] =
|
||||||
|
{
|
||||||
|
0x12, 0x34, 0x56, 0x78, 0x90, 0xab, 0xcd, 0xef,
|
||||||
|
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||||
|
0x11, 0x21, 0x31, 0x41, 0x51, 0x61, 0x71, 0x81
|
||||||
|
};
|
||||||
|
|
||||||
|
const XGEN_ALIGN byte key[] =
|
||||||
|
{
|
||||||
|
0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
|
||||||
|
0xfe, 0xde, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10,
|
||||||
|
0x89, 0xab, 0xcd, 0xef, 0x01, 0x23, 0x45, 0x67
|
||||||
|
};
|
||||||
|
|
||||||
|
ret = wc_aesgcm_setKey(id, &sgxStatus, &aes, key, WC_AES_KEY_SZ);
|
||||||
|
if (ret != SGX_SUCCESS || sgxStatus != 0) {
|
||||||
|
printf("AES set key failed %d sgxStatus = %d\n", ret, sgxStatus);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
start = current_time(1);
|
||||||
|
for (i = 0; i < numBlocks; i++) {
|
||||||
|
ret = wc_aesgcm_decrypt(id, &sgxStatus, &aes, plain, cipher, sz, iv, 12, tag, tagSz, ad, 13);
|
||||||
|
}
|
||||||
|
end = current_time(0);
|
||||||
|
|
||||||
|
if (ret != SGX_SUCCESS || sgxStatus < 0) {
|
||||||
|
printf("Error in AES-GCM decrypt operation with Enclave: %d sgxStatus = %d.\n", ret, sgxStatus);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
*total = end - start;
|
||||||
|
return 1 / *total * numBlocks;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static int aesgcm_decrypt_print(sgx_enclave_id_t id, byte* plain, byte* cipher, word32 sz, const byte* tag, word32 tagSz)
|
||||||
|
{
|
||||||
|
double total, persec;
|
||||||
|
|
||||||
|
printf("AES-GCM decrypt ");
|
||||||
|
persec = aesgcm_decrypt_getTime(id, &total, plain, cipher, sz, tag, tagSz);
|
||||||
|
printf("%d megs took %5.3f seconds , %8.3f MB/s\n", numBlocks, total, persec);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* return time for each in milliseconds */
|
||||||
|
static double rsa_encrypt_getTime(sgx_enclave_id_t id, int* sgxStatus, double* total, const byte* message, word32 mSz, byte* cipher, word32 cSz)
|
||||||
|
{
|
||||||
|
double start, end;
|
||||||
|
int ret, i;
|
||||||
|
int freeStatus = 0;
|
||||||
|
RsaKey rsa;
|
||||||
|
|
||||||
|
ret = 0; *sgxStatus = 0;
|
||||||
|
ret = wc_rsa_init(id, sgxStatus, &rsa); /* loads RSA key from buffer and inits RNG */
|
||||||
|
if (ret != SGX_SUCCESS || *sgxStatus != 0) {
|
||||||
|
printf("Initializing RSA failed %d sgxStatus = %d\n", ret, *sgxStatus);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
start = current_time(1);
|
||||||
|
for (i = 0; i < ntimes; i++) {
|
||||||
|
ret = wc_rsa_encrypt(id, sgxStatus, message, mSz, cipher, cSz, &rsa);
|
||||||
|
}
|
||||||
|
end = current_time(0);
|
||||||
|
|
||||||
|
if (ret != SGX_SUCCESS || *sgxStatus < 0) {
|
||||||
|
printf("Error in rsa encrypt operation with Enclave: %d sgxStatus = %d.\n", ret, *sgxStatus);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = wc_rsa_free(id, &freeStatus, &rsa);
|
||||||
|
if (ret != 0 || freeStatus != 0) {
|
||||||
|
printf("Failed to free RSA key %d sgxStatus = %d\n", ret, freeStatus);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
*total = end - start;
|
||||||
|
return (*total / ntimes) * 1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static int rsa_encrypt_print(sgx_enclave_id_t id, int* sgxStatus, byte* plain, word32 pSz, byte* cipher, word32 cSz)
|
||||||
|
{
|
||||||
|
double total, each;
|
||||||
|
|
||||||
|
printf("RSA-2048 encrypt ");
|
||||||
|
each = rsa_encrypt_getTime(id, sgxStatus, &total, plain, pSz, cipher, cSz);
|
||||||
|
printf("took %6.3f milliseconds, avg over %d\n", each, ntimes);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* return time in milliseconds for each */
|
||||||
|
static double rsa_decrypt_getTime(sgx_enclave_id_t id, double* total, byte* m, word32 mSz, const byte* c, word32 cSz)
|
||||||
|
{
|
||||||
|
double start, end;
|
||||||
|
int ret, sgxStatus, i;
|
||||||
|
RsaKey rsa;
|
||||||
|
|
||||||
|
ret = wc_rsa_init(id, &sgxStatus, &rsa); /* loads RSA key from buffer and inits RNG */
|
||||||
|
if (ret != SGX_SUCCESS || sgxStatus != 0) {
|
||||||
|
printf("Initializing RSA failed %d sgxStatus = %d\n", ret, sgxStatus);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
start = current_time(1);
|
||||||
|
for (i = 0; i < ntimes; i++) {
|
||||||
|
ret = wc_rsa_decrypt(id, &sgxStatus, c, cSz, m, mSz, &rsa);
|
||||||
|
}
|
||||||
|
end = current_time(0);
|
||||||
|
|
||||||
|
if (ret != SGX_SUCCESS || sgxStatus < 0) {
|
||||||
|
printf("Error in rsa decrypt operation with Enclave: %d sgxStatus = %d.\n", ret, sgxStatus);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = wc_rsa_free(id, &sgxStatus, &rsa);
|
||||||
|
if (ret != 0 || sgxStatus != 0) {
|
||||||
|
printf("Failed to free RSA key %d sgxStatus = %d\n", ret, sgxStatus);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
*total = end - start;
|
||||||
|
return (*total / ntimes) * 1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static int rsa_decrypt_print(sgx_enclave_id_t id, byte* m, word32 mSz, const byte* c, word32 cSz)
|
||||||
|
{
|
||||||
|
double total, each;
|
||||||
|
|
||||||
|
printf("RSA-2048 decrypt ");
|
||||||
|
each = rsa_decrypt_getTime(id, &total, m, mSz, c, cSz);
|
||||||
|
printf("took %6.3f milliseconds, avg over %d\n", each, ntimes);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc, char* argv[])
|
||||||
|
{
|
||||||
|
sgx_enclave_id_t id;
|
||||||
|
sgx_launch_token_t t;
|
||||||
|
|
||||||
|
int ret = 0;
|
||||||
|
int sgxStatus = 0;
|
||||||
|
int updated = 0;
|
||||||
|
byte message[] = "Secure wolfSSL.";
|
||||||
|
|
||||||
|
byte* plain = new byte[1024 * 1024];
|
||||||
|
byte* cipher = new byte[1024 * 1024];
|
||||||
|
const byte tag[16] = { 0 };
|
||||||
|
int plainSz = 1024 * 1024;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
/* only print off if no command line arguments were passed in */
|
||||||
|
if (argc == 1) {
|
||||||
|
printf("Setting up Enclave ... ");
|
||||||
|
}
|
||||||
|
|
||||||
|
memset(t, 0, sizeof(sgx_launch_token_t));
|
||||||
|
|
||||||
|
ret = sgx_create_enclave(_T("Enclave.signed.dll"), DEBUG_VALUE, &t, &updated, &id, NULL);
|
||||||
|
if (ret != SGX_SUCCESS) {
|
||||||
|
printf("Failed to create Enclave : error %d - %#x.\n", ret, ret);
|
||||||
|
free_resources(plain, cipher);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* test if only printing off times */
|
||||||
|
if (argc > 1) {
|
||||||
|
double total;
|
||||||
|
int idx = 1;
|
||||||
|
while (1) {
|
||||||
|
for (idx = 1; idx < argc; idx++) {
|
||||||
|
if (strncmp(argv[idx], "-s256", 6) == 0) {
|
||||||
|
printf("%8.3f - SHA-256\n", sha256_getTime(id, &total));
|
||||||
|
fflush(stdout);
|
||||||
|
}
|
||||||
|
else if (strncmp(argv[idx], "-ag", 3) == 0) {
|
||||||
|
printf("%8.3f - AES-GCM\n", aesgcm_encrypt_getTime(id, &total, plain, cipher, plainSz, (byte*)tag, sizeof(tag)));
|
||||||
|
fflush(stdout);
|
||||||
|
}
|
||||||
|
else if (strncmp(argv[idx], "-re", 4) == 0) {
|
||||||
|
printf("%8.3f - RSA-ENC\n", rsa_encrypt_getTime(id, &sgxStatus, &total, message, sizeof(message), cipher, plainSz));
|
||||||
|
fflush(stdout);
|
||||||
|
}
|
||||||
|
else if (strncmp(argv[idx], "-rd", 4) == 0) {
|
||||||
|
rsa_encrypt_getTime(id, &sgxStatus, &total, message, sizeof(message), cipher, plainSz);
|
||||||
|
printf("%8.3f - RSA-DEC\n", rsa_decrypt_getTime(id, &total, plain, plainSz, cipher, sgxStatus));
|
||||||
|
fflush(stdout);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
printf("\"%s\" Not yet implemented\n\t-s256 for SHA256\n\t-ag for AES-GCM\n\t-re for RSA encrypt", argv[idx]);
|
||||||
|
fflush(stdout);
|
||||||
|
free_resources(plain, cipher);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("Success\nCollecting benchmark values for wolfSSL using SGX\n");
|
||||||
|
|
||||||
|
/*********** SHA-256 ***************/
|
||||||
|
if (sha256_print(id) != 0) {
|
||||||
|
free_resources(plain, cipher);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
printf("\n");
|
||||||
|
|
||||||
|
|
||||||
|
/*********** AES-GCM ***************/
|
||||||
|
/* place message in first bytes of plain and test encrypt/decrypt with aesgcm */
|
||||||
|
memcpy(plain, message, sizeof(message));
|
||||||
|
|
||||||
|
if (aesgcm_encrypt_print(id, plain, cipher, plainSz, (byte*)tag, sizeof(tag)) != 0) {
|
||||||
|
free_resources(plain, cipher);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
memset(plain, 0, plainSz);
|
||||||
|
if (aesgcm_decrypt_print(id, plain, cipher, plainSz, tag, sizeof(tag)) != 0) {
|
||||||
|
free_resources(plain, cipher);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("\tdecrypted message = ");
|
||||||
|
for (i = 0; i < sizeof(message); i++) { printf("%c", plain[i]); }
|
||||||
|
printf("\n\n");
|
||||||
|
|
||||||
|
/*********** RSA ***************/
|
||||||
|
memset(cipher, 0, 256);
|
||||||
|
ret = rsa_encrypt_print(id, &sgxStatus, message, sizeof(message), cipher, plainSz);
|
||||||
|
if (ret < 0) {
|
||||||
|
free_resources(plain, cipher);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
memset(plain, 0, plainSz);
|
||||||
|
ret = rsa_decrypt_print(id, plain, plainSz, cipher, sgxStatus);
|
||||||
|
if (ret != 0) {
|
||||||
|
free_resources(plain, cipher);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("\tdecrypted message = ");
|
||||||
|
for (i = 0; i < 15; i++){ printf("%c", plain[i]); }
|
||||||
|
printf("\n");
|
||||||
|
|
||||||
|
|
||||||
|
/*********** Free arrays and exit ***************/
|
||||||
|
free_resources(plain, cipher);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,39 @@
|
||||||
|
/* Benchmarks.h
|
||||||
|
*
|
||||||
|
* Copyright (C) 2006-2016 wolfSSL Inc.
|
||||||
|
*
|
||||||
|
* This file is part of wolfSSL.
|
||||||
|
*
|
||||||
|
* wolfSSL is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* wolfSSL is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef BENCHMARKS_H
|
||||||
|
#define BENCHMARKS_H
|
||||||
|
|
||||||
|
#include "sgx_urts.h" /* Manages Enclave */
|
||||||
|
#include <iostream> /* IO stream Operations */
|
||||||
|
#include "sgx_status.h" /* checks the status of the sgx APIs */
|
||||||
|
#include "Enclave_u.h" /* contains untrusted wrapper functions used to call enclave functions*/
|
||||||
|
#include <sstream>
|
||||||
|
|
||||||
|
#define BENCH_RSA
|
||||||
|
|
||||||
|
enum BenchmarkBounds {
|
||||||
|
/* these numbers are lower then default wolfSSL one to collect benchmark values faster for GUI */
|
||||||
|
numBlocks = 10, /* how many megs to test */
|
||||||
|
ntimes = 30 /* how many itteration to run RSA decrypt/encrypt */
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
|
@ -0,0 +1,363 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
|
<ProjectConfiguration Include="Debug|Win32">
|
||||||
|
<Configuration>Debug</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Debug|x64">
|
||||||
|
<Configuration>Debug</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Prerelease|Win32">
|
||||||
|
<Configuration>Prerelease</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Prerelease|x64">
|
||||||
|
<Configuration>Prerelease</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release|Win32">
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release|x64">
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Simulation|Win32">
|
||||||
|
<Configuration>Simulation</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Simulation|x64">
|
||||||
|
<Configuration>Simulation</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
</ItemGroup>
|
||||||
|
<PropertyGroup Label="Globals">
|
||||||
|
<ProjectGuid>{C1574FBF-5346-480F-8DAD-A547480FF9F1}</ProjectGuid>
|
||||||
|
<Keyword>Win32Proj</Keyword>
|
||||||
|
<RootNamespace>Benchmarks</RootNamespace>
|
||||||
|
<ProjectName>benchmark</ProjectName>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<PlatformToolset>Intel C++ Compiler 16.0</PlatformToolset>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<PlatformToolset>Intel C++ Compiler 16.0</PlatformToolset>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Simulation|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<PlatformToolset>Intel C++ Compiler 16.0</PlatformToolset>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Simulation|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<PlatformToolset>Intel C++ Compiler 16.0</PlatformToolset>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<PlatformToolset>Intel C++ Compiler 16.0</PlatformToolset>
|
||||||
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<PlatformToolset>Intel C++ Compiler 16.0</PlatformToolset>
|
||||||
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Prerelease|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<PlatformToolset>Intel C++ Compiler 16.0</PlatformToolset>
|
||||||
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Prerelease|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<PlatformToolset>Intel C++ Compiler 16.0</PlatformToolset>
|
||||||
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||||
|
<ImportGroup Label="ExtensionSettings">
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Simulation|Win32'" Label="PropertySheets">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Simulation|x64'" Label="PropertySheets">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Prerelease|Win32'" Label="PropertySheets">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Prerelease|x64'" Label="PropertySheets">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<PropertyGroup Label="UserMacros" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<LinkIncremental>true</LinkIncremental>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<LinkIncremental>true</LinkIncremental>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Simulation|Win32'">
|
||||||
|
<LinkIncremental>true</LinkIncremental>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Simulation|x64'">
|
||||||
|
<LinkIncremental>true</LinkIncremental>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<LinkIncremental>false</LinkIncremental>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<LinkIncremental>false</LinkIncremental>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Prerelease|Win32'">
|
||||||
|
<LinkIncremental>false</LinkIncremental>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Prerelease|x64'">
|
||||||
|
<LinkIncremental>false</LinkIncremental>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<PreprocessorDefinitions>WOLFSSL_SGX;WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<AdditionalIncludeDirectories>$(SGXSDKInstallPath)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<AdditionalLibraryDirectories>$(SGXSDKInstallPath)\bin\$(Platform)\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<AdditionalDependencies>sgx_urts.lib;sgx_uae_service.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<PreprocessorDefinitions>WOLFSSL_SGX;WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<AdditionalIncludeDirectories>$(SGXSDKInstallPath)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<AdditionalLibraryDirectories>$(SGXSDKInstallPath)\bin\$(Platform)\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<AdditionalDependencies>sgx_urts.lib;sgx_uae_service.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Simulation|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<PreprocessorDefinitions>WOLFSSL_SGX;WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<AdditionalIncludeDirectories>$(SGXSDKInstallPath)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<AdditionalLibraryDirectories>$(SGXSDKInstallPath)\bin\$(Platform)\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<AdditionalDependencies>sgx_urts_sim.lib;sgx_uae_service_sim.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Simulation|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<PreprocessorDefinitions>WOLFSSL_SGX;WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<AdditionalIncludeDirectories>$(SGXSDKInstallPath)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<AdditionalLibraryDirectories>$(SGXSDKInstallPath)\bin\$(Platform)\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<AdditionalDependencies>sgx_urts_sim.lib;sgx_uae_service_sim.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||||
|
<Optimization>MaxSpeed</Optimization>
|
||||||
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<PreprocessorDefinitions>WOLFSSL_SGX;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<AdditionalIncludeDirectories>$(SGXSDKInstallPath)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<AdditionalLibraryDirectories>$(SGXSDKInstallPath)\bin\$(Platform)\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<AdditionalDependencies>sgx_urts.lib;sgx_uae_service.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||||
|
<Optimization>MaxSpeed</Optimization>
|
||||||
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<PreprocessorDefinitions>WOLFSSL_SGX;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<AdditionalIncludeDirectories>$(SGXSDKInstallPath)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<AdditionalLibraryDirectories>$(SGXSDKInstallPath)\bin\$(Platform)\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<AdditionalDependencies>sgx_urts.lib;sgx_uae_service.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Prerelease|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||||
|
<Optimization>MaxSpeed</Optimization>
|
||||||
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<PreprocessorDefinitions>WOLFSSL_SGX;EDEBUG;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<AdditionalIncludeDirectories>$(SGXSDKInstallPath)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<AdditionalLibraryDirectories>$(SGXSDKInstallPath)\bin\$(Platform)\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<AdditionalDependencies>sgx_urts.lib;sgx_uae_service.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Prerelease|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||||
|
<Optimization>MaxSpeed</Optimization>
|
||||||
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<PreprocessorDefinitions>WOLFSSL_SGX;EDEBUG;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<AdditionalIncludeDirectories>$(SGXSDKInstallPath)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<AdditionalLibraryDirectories>$(SGXSDKInstallPath)\bin\$(Platform)\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
<AdditionalDependencies>sgx_urts.lib;sgx_uae_service.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Text Include="ReadMe.txt" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="Enclave_u.h" />
|
||||||
|
<ClInclude Include="Benchmarks.h" />
|
||||||
|
<ClInclude Include="stdafx.h" />
|
||||||
|
<ClInclude Include="targetver.h" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="Benchmarks.cpp" />
|
||||||
|
<ClCompile Include="Enclave_u.c">
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Simulation|Win32'">
|
||||||
|
</PrecompiledHeader>
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Simulation|x64'">
|
||||||
|
</PrecompiledHeader>
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Prerelease|Win32'">
|
||||||
|
</PrecompiledHeader>
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Prerelease|x64'">
|
||||||
|
</PrecompiledHeader>
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
</PrecompiledHeader>
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
</PrecompiledHeader>
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
</PrecompiledHeader>
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
</PrecompiledHeader>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="stdafx.cpp">
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Simulation|Win32'">Create</PrecompiledHeader>
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Simulation|x64'">Create</PrecompiledHeader>
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Prerelease|Win32'">Create</PrecompiledHeader>
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Prerelease|x64'">Create</PrecompiledHeader>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<CustomBuild Include="..\Enclave\Enclave.edl">
|
||||||
|
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">"$(SGXSDKInstallPath)\bin\win32\Release\sgx_edger8r.exe" --untrusted ".\..\Enclave\Enclave.edl" --search-path ".\..\Enclave%3b$(SGXSDKInstallPath)\include"</Command>
|
||||||
|
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">"$(SGXSDKInstallPath)\bin\win32\Release\sgx_edger8r.exe" --untrusted ".\..\Enclave\Enclave.edl" --search-path ".\..\Enclave%3b$(SGXSDKInstallPath)\include"</Command>
|
||||||
|
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Creating untrusted proxy/bridge routines</Message>
|
||||||
|
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Creating untrusted proxy/bridge routines</Message>
|
||||||
|
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)%(Filename)_u.h;$(ProjectDir)%(Filename)_u.c;%(Outputs)</Outputs>
|
||||||
|
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectDir)%(Filename)_u.h;$(ProjectDir)%(Filename)_u.c;%(Outputs)</Outputs>
|
||||||
|
<Command Condition="'$(Configuration)|$(Platform)'=='Simulation|Win32'">"$(SGXSDKInstallPath)\bin\win32\Release\sgx_edger8r.exe" --untrusted ".\..\Enclave\Enclave.edl" --search-path ".\..\Enclave%3b$(SGXSDKInstallPath)\include"</Command>
|
||||||
|
<Command Condition="'$(Configuration)|$(Platform)'=='Simulation|x64'">"$(SGXSDKInstallPath)\bin\win32\Release\sgx_edger8r.exe" --untrusted ".\..\Enclave\Enclave.edl" --search-path ".\..\Enclave%3b$(SGXSDKInstallPath)\include"</Command>
|
||||||
|
<Message Condition="'$(Configuration)|$(Platform)'=='Simulation|Win32'">Creating untrusted proxy/bridge routines</Message>
|
||||||
|
<Message Condition="'$(Configuration)|$(Platform)'=='Simulation|x64'">Creating untrusted proxy/bridge routines</Message>
|
||||||
|
<Outputs Condition="'$(Configuration)|$(Platform)'=='Simulation|Win32'">$(ProjectDir)%(Filename)_u.h;$(ProjectDir)%(Filename)_u.c;%(Outputs)</Outputs>
|
||||||
|
<Outputs Condition="'$(Configuration)|$(Platform)'=='Simulation|x64'">$(ProjectDir)%(Filename)_u.h;$(ProjectDir)%(Filename)_u.c;%(Outputs)</Outputs>
|
||||||
|
<Command Condition="'$(Configuration)|$(Platform)'=='Prerelease|Win32'">"$(SGXSDKInstallPath)\bin\win32\Release\sgx_edger8r.exe" --untrusted ".\..\Enclave\Enclave.edl" --search-path ".\..\Enclave%3b$(SGXSDKInstallPath)\include"</Command>
|
||||||
|
<Command Condition="'$(Configuration)|$(Platform)'=='Prerelease|x64'">"$(SGXSDKInstallPath)\bin\win32\Release\sgx_edger8r.exe" --untrusted ".\..\Enclave\Enclave.edl" --search-path ".\..\Enclave%3b$(SGXSDKInstallPath)\include"</Command>
|
||||||
|
<Message Condition="'$(Configuration)|$(Platform)'=='Prerelease|Win32'">Creating untrusted proxy/bridge routines</Message>
|
||||||
|
<Message Condition="'$(Configuration)|$(Platform)'=='Prerelease|x64'">Creating untrusted proxy/bridge routines</Message>
|
||||||
|
<Outputs Condition="'$(Configuration)|$(Platform)'=='Prerelease|Win32'">$(ProjectDir)%(Filename)_u.h;$(ProjectDir)%(Filename)_u.c;%(Outputs)</Outputs>
|
||||||
|
<Outputs Condition="'$(Configuration)|$(Platform)'=='Prerelease|x64'">$(ProjectDir)%(Filename)_u.h;$(ProjectDir)%(Filename)_u.c;%(Outputs)</Outputs>
|
||||||
|
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">"$(SGXSDKInstallPath)\bin\win32\Release\sgx_edger8r.exe" --untrusted ".\..\Enclave\Enclave.edl" --search-path ".\..\Enclave%3b$(SGXSDKInstallPath)\include"</Command>
|
||||||
|
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">"$(SGXSDKInstallPath)\bin\win32\Release\sgx_edger8r.exe" --untrusted ".\..\Enclave\Enclave.edl" --search-path ".\..\Enclave%3b$(SGXSDKInstallPath)\include"</Command>
|
||||||
|
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Creating untrusted proxy/bridge routines</Message>
|
||||||
|
<Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Creating untrusted proxy/bridge routines</Message>
|
||||||
|
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)%(Filename)_u.h;$(ProjectDir)%(Filename)_u.c;%(Outputs)</Outputs>
|
||||||
|
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectDir)%(Filename)_u.h;$(ProjectDir)%(Filename)_u.c;%(Outputs)</Outputs>
|
||||||
|
</CustomBuild>
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
</ImportGroup>
|
||||||
|
</Project>
|
|
@ -0,0 +1,53 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup>
|
||||||
|
<Filter Include="Source Files">
|
||||||
|
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||||
|
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Header Files">
|
||||||
|
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||||
|
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Resource Files">
|
||||||
|
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||||
|
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Generated Files">
|
||||||
|
<UniqueIdentifier>{926368bf-c0ee-493d-a234-f605ef22f69a}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Text Include="ReadMe.txt" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="stdafx.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="targetver.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="Enclave_u.h">
|
||||||
|
<Filter>Generated Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="Benchmarks.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="stdafx.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="Benchmarks.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="Enclave_u.c">
|
||||||
|
<Filter>Generated Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<CustomBuild Include="..\Enclave\Enclave.edl">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</CustomBuild>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
|
@ -0,0 +1,8 @@
|
||||||
|
// stdafx.cpp : source file that includes just the standard includes
|
||||||
|
// Benchmarks.pch will be the pre-compiled header
|
||||||
|
// stdafx.obj will contain the pre-compiled type information
|
||||||
|
|
||||||
|
#include "stdafx.h"
|
||||||
|
|
||||||
|
// TODO: reference any additional headers you need in STDAFX.H
|
||||||
|
// and not in this file
|
|
@ -0,0 +1,15 @@
|
||||||
|
// stdafx.h : include file for standard system include files,
|
||||||
|
// or project specific include files that are used frequently, but
|
||||||
|
// are changed infrequently
|
||||||
|
//
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "targetver.h"
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <tchar.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// TODO: reference additional headers your program requires here
|
|
@ -0,0 +1,8 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
// Including SDKDDKVer.h defines the highest available Windows platform.
|
||||||
|
|
||||||
|
// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
|
||||||
|
// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.
|
||||||
|
|
||||||
|
#include <SDKDDKVer.h>
|
|
@ -0,0 +1,11 @@
|
||||||
|
<EnclaveConfiguration>
|
||||||
|
<ProdID>0</ProdID>
|
||||||
|
<ISVSVN>0</ISVSVN>
|
||||||
|
<StackMaxSize>0x100000</StackMaxSize>
|
||||||
|
<HeapMaxSize>0x200000</HeapMaxSize>
|
||||||
|
<TCSNum>1</TCSNum>
|
||||||
|
<TCSPolicy>1</TCSPolicy>
|
||||||
|
<DisableDebug>0</DisableDebug>
|
||||||
|
<MiscSelect>0</MiscSelect>
|
||||||
|
<MiscMask>0xFFFFFFFF</MiscMask>
|
||||||
|
</EnclaveConfiguration>
|
|
@ -0,0 +1,119 @@
|
||||||
|
/* Enclave.cpp
|
||||||
|
*
|
||||||
|
* Copyright (C) 2006-2016 wolfSSL Inc.
|
||||||
|
*
|
||||||
|
* This file is part of wolfSSL.
|
||||||
|
*
|
||||||
|
* wolfSSL is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* wolfSSL is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "Enclave_t.h" /* includes header files from wolfSSL */
|
||||||
|
#include "wolfssl/certs_test.h"
|
||||||
|
#include "sgx_trts.h"
|
||||||
|
|
||||||
|
static volatile byte RNG_unset = 1;
|
||||||
|
static WC_RNG rng;
|
||||||
|
|
||||||
|
int wc_sha256_init(Sha256* sha256) {
|
||||||
|
return wc_InitSha256(sha256);
|
||||||
|
}
|
||||||
|
|
||||||
|
int wc_sha256_update(Sha256* sha256, byte* buf, int bufSz)
|
||||||
|
{
|
||||||
|
return wc_Sha256Update(sha256, buf, bufSz);
|
||||||
|
}
|
||||||
|
|
||||||
|
int wc_sha256_final(Sha256* sha256, byte* digest)
|
||||||
|
{
|
||||||
|
return wc_Sha256Final(sha256, digest);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int wc_aesgcm_setKey(Aes* aes, const byte* key, word32 sz)
|
||||||
|
{
|
||||||
|
return wc_AesGcmSetKey(aes, key, sz);
|
||||||
|
}
|
||||||
|
|
||||||
|
int wc_aesgcm_encrypt(Aes* aes, byte* c, const byte*p, word32 pSz, const byte* iv, word32 ivSz, byte* tag, word32 tagSz, const byte* ad, word32 adSz)
|
||||||
|
{
|
||||||
|
return wc_AesGcmEncrypt(aes, c, p, pSz, iv, ivSz, tag, tagSz, ad, adSz);
|
||||||
|
}
|
||||||
|
|
||||||
|
int wc_aesgcm_decrypt(Aes* aes, byte* p, const byte* c, word32 cSz, const byte* iv, word32 ivSz, const byte* tag, word32 tagSz, const byte* ad, word32 adSz)
|
||||||
|
{
|
||||||
|
return wc_AesGcmDecrypt(aes, p, c, cSz, iv, 12, tag, 16, ad, 13);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* return size of encrypted data */
|
||||||
|
int wc_rsa_encrypt(const byte* m, word32 mSz, byte* out, word32 outSz, RsaKey* rsaKey)
|
||||||
|
{
|
||||||
|
return wc_RsaPublicEncrypt(m, mSz, out, outSz, rsaKey, &rng);
|
||||||
|
}
|
||||||
|
|
||||||
|
int wc_rsa_decrypt(const byte* in, word32 inSz, byte* m, word32 mSz, RsaKey* rsaKey)
|
||||||
|
{
|
||||||
|
return wc_RsaPrivateDecrypt(in, inSz, m, mSz, rsaKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int wc_rsa_free(RsaKey* rsaKey)
|
||||||
|
{
|
||||||
|
return wc_FreeRsaKey(rsaKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* RSA key is set from wolfSSL certs_test.h */
|
||||||
|
int wc_rsa_init(RsaKey* rsaKey)
|
||||||
|
{
|
||||||
|
int ret;
|
||||||
|
word32 bytes;
|
||||||
|
word32 idx = 0;
|
||||||
|
const byte* tmp;
|
||||||
|
|
||||||
|
#ifdef USE_CERT_BUFFERS_1024
|
||||||
|
tmp = rsa_key_der_1024;
|
||||||
|
bytes = sizeof_rsa_key_der_1024;
|
||||||
|
#elif defined(USE_CERT_BUFFERS_2048)
|
||||||
|
tmp = rsa_key_der_2048;
|
||||||
|
bytes = sizeof_rsa_key_der_2048;
|
||||||
|
#else
|
||||||
|
#error "need a cert buffer size"
|
||||||
|
#endif /* USE_CERT_BUFFERS */
|
||||||
|
|
||||||
|
ret = wc_InitRsaKey(rsaKey, 0);
|
||||||
|
if (ret < 0) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
ret = wc_RsaPrivateKeyDecode(tmp, &idx, rsaKey, bytes);
|
||||||
|
if (ret != 0) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (RNG_unset) { /* not atomic, for demo only. RNG could be moved to user APP and passed by reference */
|
||||||
|
RNG_unset = 0;
|
||||||
|
ret = wc_InitRng(&rng);
|
||||||
|
if (ret < 0) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef WC_RSA_BLINDING
|
||||||
|
wc_RsaSetRNG(rsaKey, rng);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
|
@ -0,0 +1,47 @@
|
||||||
|
enclave {
|
||||||
|
|
||||||
|
include "wolfssl/wolfcrypt/settings.h"
|
||||||
|
include "wolfssl/wolfcrypt/types.h"
|
||||||
|
include "wolfssl/wolfcrypt/sha256.h"
|
||||||
|
include "wolfssl/wolfcrypt/aes.h"
|
||||||
|
include "wolfssl/wolfcrypt/rsa.h"
|
||||||
|
include "wolfssl/wolfcrypt/random.h"
|
||||||
|
|
||||||
|
|
||||||
|
trusted {
|
||||||
|
|
||||||
|
/* SHA 256 opperations
|
||||||
|
* Using user_check to increase performance, in copies over the buffer */
|
||||||
|
public int wc_sha256_init([user_check]Sha256* sha256);
|
||||||
|
public int wc_sha256_update([user_check]Sha256* sha256, [user_check]byte* buf, int bufSz);
|
||||||
|
public int wc_sha256_final([user_check]Sha256* sha256, [user_check]byte* digest);
|
||||||
|
|
||||||
|
|
||||||
|
/* AES GCM opperations
|
||||||
|
* Using user_check to increase performance */
|
||||||
|
public int wc_aesgcm_setKey([user_check]Aes* aes, [user_check]const byte* key, word32 len);
|
||||||
|
public int wc_aesgcm_encrypt([user_check]Aes* aes, [user_check]byte* out,
|
||||||
|
[user_check]const byte* in, word32 sz,
|
||||||
|
[user_check]const byte* iv, word32 ivSz,
|
||||||
|
[user_check]byte* authTag, word32 authTagSz,
|
||||||
|
[user_check]const byte* authIn, word32 authInSz);
|
||||||
|
public int wc_aesgcm_decrypt([user_check]Aes* aes, [user_check]byte* out,
|
||||||
|
[user_check]const byte* in, word32 sz,
|
||||||
|
[user_check]const byte* iv, word32 ivSz,
|
||||||
|
[user_check]const byte* authTag, word32 authTagSz,
|
||||||
|
[user_check]const byte* authIn, word32 authInSz);
|
||||||
|
|
||||||
|
|
||||||
|
/* RSA opperations
|
||||||
|
* Using user_check to increase performance */
|
||||||
|
public int wc_rsa_encrypt([user_check]const byte* m, word32 mSz, [user_check]byte* out, word32 outSz, [user_check]RsaKey* key);
|
||||||
|
public int wc_rsa_decrypt([user_check]const byte* in, word32 inSz, [user_check]byte* out, word32 mSz, [user_check]RsaKey* key);
|
||||||
|
public int wc_rsa_init([user_check]RsaKey* rsa);
|
||||||
|
public int wc_rsa_free([user_check]RsaKey* rsa);
|
||||||
|
};
|
||||||
|
|
||||||
|
untrusted {
|
||||||
|
/* define OCALLs here. */
|
||||||
|
|
||||||
|
};
|
||||||
|
};
|
|
@ -0,0 +1,426 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
|
<ProjectConfiguration Include="Debug|Win32">
|
||||||
|
<Configuration>Debug</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Debug|x64">
|
||||||
|
<Configuration>Debug</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Prerelease|Win32">
|
||||||
|
<Configuration>Prerelease</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Prerelease|x64">
|
||||||
|
<Configuration>Prerelease</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release|Win32">
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release|x64">
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Simulation|Win32">
|
||||||
|
<Configuration>Simulation</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Simulation|x64">
|
||||||
|
<Configuration>Simulation</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
</ItemGroup>
|
||||||
|
<PropertyGroup Label="Globals">
|
||||||
|
<ProjectGuid>{BA00CB73-68CC-4BAD-8C00-ABEE66B4EB1C}</ProjectGuid>
|
||||||
|
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<PlatformToolset>Intel C++ Compiler 16.0</PlatformToolset>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<PlatformToolset>Intel C++ Compiler 16.0</PlatformToolset>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Simulation|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<PlatformToolset>v120</PlatformToolset>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Simulation|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<PlatformToolset>v120</PlatformToolset>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<PlatformToolset>Intel C++ Compiler 16.0</PlatformToolset>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<PlatformToolset>Intel C++ Compiler 16.0</PlatformToolset>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Prerelease|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<PlatformToolset>v120</PlatformToolset>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Prerelease|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<PlatformToolset>v120</PlatformToolset>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Prerelease|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<PlatformToolset>Intel C++ Compiler 16.0</PlatformToolset>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Prerelease|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<PlatformToolset>Intel C++ Compiler 16.0</PlatformToolset>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Simulation|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<PlatformToolset>Intel C++ Compiler 16.0</PlatformToolset>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Simulation|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<PlatformToolset>Intel C++ Compiler 16.0</PlatformToolset>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||||
|
<ImportGroup Label="ExtensionSettings">
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<Import Project="$(LocalAppData)\Microsoft\VisualStudio\12.0\SecureEnclave.$(Platform).props" Condition="exists('$(LocalAppData)\Microsoft\VisualStudio\11.0\SecureEnclave.$(Platform).props')" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||||
|
<Import Project="$(LocalAppData)\Microsoft\VisualStudio\12.0\SecureEnclave.$(Platform).props" Condition="exists('$(LocalAppData)\Microsoft\VisualStudio\11.0\SecureEnclave.$(Platform).props')" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Simulation|Win32'" Label="PropertySheets">
|
||||||
|
<Import Project="$(LocalAppData)\Microsoft\VisualStudio\12.0\SecureEnclave.$(Platform).props" Condition="exists('$(LocalAppData)\Microsoft\VisualStudio\11.0\SecureEnclave.$(Platform).props')" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Simulation|x64'" Label="PropertySheets">
|
||||||
|
<Import Project="$(LocalAppData)\Microsoft\VisualStudio\12.0\SecureEnclave.$(Platform).props" Condition="exists('$(LocalAppData)\Microsoft\VisualStudio\11.0\SecureEnclave.$(Platform).props')" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<Import Project="$(LocalAppData)\Microsoft\VisualStudio\12.0\SecureEnclave.$(Platform).props" Condition="exists('$(LocalAppData)\Microsoft\VisualStudio\11.0\SecureEnclave.$(Platform).props')" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||||
|
<Import Project="$(LocalAppData)\Microsoft\VisualStudio\12.0\SecureEnclave.$(Platform).props" Condition="exists('$(LocalAppData)\Microsoft\VisualStudio\11.0\SecureEnclave.$(Platform).props')" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Prerelease|Win32'" Label="PropertySheets">
|
||||||
|
<Import Project="$(LocalAppData)\Microsoft\VisualStudio\12.0\SecureEnclave.$(Platform).props" Condition="exists('$(LocalAppData)\Microsoft\VisualStudio\11.0\SecureEnclave.$(Platform).props')" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Prerelease|x64'" Label="PropertySheets">
|
||||||
|
<Import Project="$(LocalAppData)\Microsoft\VisualStudio\12.0\SecureEnclave.$(Platform).props" Condition="exists('$(LocalAppData)\Microsoft\VisualStudio\11.0\SecureEnclave.$(Platform).props')" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Prerelease|Win32'" Label="PropertySheets">
|
||||||
|
<Import Project="$(LocalAppData)\Microsoft\VisualStudio\12.0\SecureEnclave.$(Platform).props" Condition="exists('$(LocalAppData)\Microsoft\VisualStudio\11.0\SecureEnclave.$(Platform).props')" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Prerelease|x64'" Label="PropertySheets">
|
||||||
|
<Import Project="$(LocalAppData)\Microsoft\VisualStudio\12.0\SecureEnclave.$(Platform).props" Condition="exists('$(LocalAppData)\Microsoft\VisualStudio\11.0\SecureEnclave.$(Platform).props')" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Simulation|Win32'">
|
||||||
|
<Import Project="$(LocalAppData)\Microsoft\VisualStudio\12.0\SecureEnclave.$(Platform).props" Condition="exists('$(LocalAppData)\Microsoft\VisualStudio\11.0\SecureEnclave.$(Platform).props')" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Simulation|x64'" Label="PropertySheets">
|
||||||
|
<Import Project="$(LocalAppData)\Microsoft\VisualStudio\12.0\SecureEnclave.$(Platform).props" Condition="exists('$(LocalAppData)\Microsoft\VisualStudio\11.0\SecureEnclave.$(Platform).props')" />
|
||||||
|
</ImportGroup>
|
||||||
|
<PropertyGroup Label="UserMacros" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<GenerateManifest>false</GenerateManifest>
|
||||||
|
<LinkIncremental>false</LinkIncremental>
|
||||||
|
<IncludePath>
|
||||||
|
</IncludePath>
|
||||||
|
<LibraryPath>$(NoInherit)</LibraryPath>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<GenerateManifest>false</GenerateManifest>
|
||||||
|
<LinkIncremental>false</LinkIncremental>
|
||||||
|
<IncludePath>
|
||||||
|
</IncludePath>
|
||||||
|
<LibraryPath>$(NoInherit)</LibraryPath>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Simulation|Win32'">
|
||||||
|
<GenerateManifest>false</GenerateManifest>
|
||||||
|
<LinkIncremental>false</LinkIncremental>
|
||||||
|
<IncludePath>$(SolutionDir)\wolfSSLEnclaveLib;$(NoInherit);;$(SolutionDir)\wolfSSLEnclaveLib;$(SolutionDir)\wolfSSLEnclaveLib</IncludePath>
|
||||||
|
<LibraryPath>$(NoInherit)</LibraryPath>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Simulation|x64'">
|
||||||
|
<GenerateManifest>false</GenerateManifest>
|
||||||
|
<LinkIncremental>false</LinkIncremental>
|
||||||
|
<IncludePath>$(SolutionDir)\wolfSSLEnclaveLib;$(NoInherit);;$(SolutionDir)\wolfSSLEnclaveLib;$(SolutionDir)\wolfSSLEnclaveLib</IncludePath>
|
||||||
|
<LibraryPath>$(NoInherit)</LibraryPath>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<GenerateManifest>false</GenerateManifest>
|
||||||
|
<LinkIncremental>false</LinkIncremental>
|
||||||
|
<IncludePath>
|
||||||
|
</IncludePath>
|
||||||
|
<LibraryPath>$(NoInherit)</LibraryPath>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<GenerateManifest>false</GenerateManifest>
|
||||||
|
<LinkIncremental>false</LinkIncremental>
|
||||||
|
<IncludePath>
|
||||||
|
</IncludePath>
|
||||||
|
<LibraryPath>$(NoInherit)</LibraryPath>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Prerelease|Win32'">
|
||||||
|
<GenerateManifest>false</GenerateManifest>
|
||||||
|
<LinkIncremental>false</LinkIncremental>
|
||||||
|
<IncludePath>
|
||||||
|
</IncludePath>
|
||||||
|
<LibraryPath>$(NoInherit)</LibraryPath>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Prerelease|x64'">
|
||||||
|
<GenerateManifest>false</GenerateManifest>
|
||||||
|
<LinkIncremental>false</LinkIncremental>
|
||||||
|
<IncludePath>
|
||||||
|
</IncludePath>
|
||||||
|
<LibraryPath>$(NoInherit)</LibraryPath>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
|
||||||
|
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<AdditionalIncludeDirectories>$(SGXSDKInstallPath)include;$(SGXSDKInstallPath)include\tlibc;$(SGXSDKInstallPath)include\stlport;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>WOLFSSL_SGX;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>wolfssl.lib;sgx_trts.lib;sgx_tstdc.lib;sgx_tservice.lib;sgx_tcrypto.lib;sgx_tstdcxx.lib</AdditionalDependencies>
|
||||||
|
<AdditionalLibraryDirectories>$(OutDir);$(SGXSDKInstallPath)bin\$(Platform)\$(Configuration);$(SolutionDir)</AdditionalLibraryDirectories>
|
||||||
|
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
|
||||||
|
<EntryPointSymbol />
|
||||||
|
<NoEntryPoint>true</NoEntryPoint>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
</Link>
|
||||||
|
<PostBuildEvent>
|
||||||
|
<Command>"$(SGXSDKInstallPath)bin\win32\release\sgx_sign.exe" sign -key "Enclave_private.pem" -enclave "$(OutDir)Enclave.dll" -out "$(OutDir)Enclave.signed.dll" -config "Enclave.config.xml"</Command>
|
||||||
|
<Message>sign the enclave</Message>
|
||||||
|
</PostBuildEvent>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
|
||||||
|
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<AdditionalIncludeDirectories>$(SGXSDKInstallPath)include;$(SGXSDKInstallPath)include\tlibc;$(SGXSDKInstallPath)include\stlport;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>WOLFSSL_SGX;_WINDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>wolfssl.lib;sgx_trts.lib;sgx_tstdc.lib;sgx_tservice.lib;sgx_tcrypto.lib;sgx_tstdcxx.lib</AdditionalDependencies>
|
||||||
|
<AdditionalLibraryDirectories>$(OutDir);$(SGXSDKInstallPath)bin\$(Platform)\$(Configuration);$(OutDir)</AdditionalLibraryDirectories>
|
||||||
|
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
|
||||||
|
<EntryPointSymbol>
|
||||||
|
</EntryPointSymbol>
|
||||||
|
<NoEntryPoint>true</NoEntryPoint>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
</Link>
|
||||||
|
<PostBuildEvent>
|
||||||
|
<Command>"$(SGXSDKInstallPath)bin\x64\release\sgx_sign.exe" sign -key "Enclave_private.pem" -enclave "$(OutDir)Enclave.dll" -out "$(OutDir)Enclave.signed.dll" -config "Enclave.config.xml"</Command>
|
||||||
|
<Message>sign the enclave</Message>
|
||||||
|
</PostBuildEvent>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Simulation|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
|
||||||
|
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<AdditionalIncludeDirectories>$(SGXSDKInstallPath)include;$(SGXSDKInstallPath)include\tlibc;$(SGXSDKInstallPath)include\stlport;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>WOLFSSL_SGX;_WINDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>wolfSSLEnclaveLib.lib;sgx_trts_sim.lib;sgx_tstdc.lib;sgx_tservice_sim.lib;sgx_tcrypto.lib;sgx_tstdcxx.lib</AdditionalDependencies>
|
||||||
|
<AdditionalLibraryDirectories>$(OutDir);$(SGXSDKInstallPath)bin\$(Platform)\Debug</AdditionalLibraryDirectories>
|
||||||
|
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
|
||||||
|
<EntryPointSymbol>
|
||||||
|
</EntryPointSymbol>
|
||||||
|
<NoEntryPoint>true</NoEntryPoint>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
</Link>
|
||||||
|
<PostBuildEvent>
|
||||||
|
<Command>"$(SGXSDKInstallPath)bin\win32\release\sgx_sign.exe" sign -key "$(ProjectDir)Enclave_private.pem" -enclave "$(OutDir)Enclave.dll" -out "$(OutDir)Enclave.signed.dll" -config "$(ProjectDir)Enclave.config.xml"</Command>
|
||||||
|
<Message>sign the enclave</Message>
|
||||||
|
</PostBuildEvent>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Simulation|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
|
||||||
|
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<AdditionalIncludeDirectories>$(SGXSDKInstallPath)include;$(SGXSDKInstallPath)include\tlibc;$(SGXSDKInstallPath)include\stlport;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<PreprocessorDefinitions>WOLFSSL_SGX;_WINDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>wolfSSLEnclaveLib;sgx_trts_sim.lib;sgx_tstdc.lib;sgx_tservice_sim.lib;sgx_tcrypto.lib;sgx_tstdcxx.lib</AdditionalDependencies>
|
||||||
|
<AdditionalLibraryDirectories>$(OutDir);$(SGXSDKInstallPath)bin\$(Platform)\Debug</AdditionalLibraryDirectories>
|
||||||
|
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
|
||||||
|
<EntryPointSymbol>
|
||||||
|
</EntryPointSymbol>
|
||||||
|
<NoEntryPoint>true</NoEntryPoint>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
</Link>
|
||||||
|
<PostBuildEvent>
|
||||||
|
<Command>"$(SGXSDKInstallPath)bin\win32\release\sgx_sign.exe" sign -key "$(ProjectDir)Enclave_private.pem" -enclave "$(OutDir)Enclave.dll" -out "$(OutDir)Enclave.signed.dll" -config "$(ProjectDir)Enclave.config.xml"</Command>
|
||||||
|
<Message>sign the enclave</Message>
|
||||||
|
</PostBuildEvent>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
|
||||||
|
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||||
|
<Optimization>MaxSpeed</Optimization>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<AdditionalIncludeDirectories>$(SGXSDKInstallPath)include;$(SGXSDKInstallPath)include\tlibc;$(SGXSDKInstallPath)include\stlport;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
|
<PreprocessorDefinitions>WOLFSSL_SGX;_WINDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>wolfssl.lib;sgx_trts.lib;sgx_tstdc.lib;sgx_tservice.lib;sgx_tcrypto.lib;sgx_tstdcxx.lib</AdditionalDependencies>
|
||||||
|
<AdditionalLibraryDirectories>$(OutDir);$(SGXSDKInstallPath)bin\$(Platform)\$(Configuration);$(OutDir)</AdditionalLibraryDirectories>
|
||||||
|
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
|
||||||
|
<EntryPointSymbol />
|
||||||
|
<NoEntryPoint>true</NoEntryPoint>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
</Link>
|
||||||
|
<PostBuildEvent>
|
||||||
|
<Command>"$(SGXSDKInstallPath)bin\win32\release\sgx_sign.exe" gendata -enclave "$(OutDir)Enclave.dll" -out "$(OutDir)Enclave.hex" -config "$(ProjectDir)Enclave.config.xml"</Command>
|
||||||
|
<Message>generate the enclave signing material</Message>
|
||||||
|
</PostBuildEvent>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
|
||||||
|
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||||
|
<Optimization>MaxSpeed</Optimization>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<AdditionalIncludeDirectories>$(SGXSDKInstallPath)include;$(SGXSDKInstallPath)include\tlibc;$(SGXSDKInstallPath)include\stlport;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
|
<PreprocessorDefinitions>WOLFSSL_SGX;_WINDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>wolfSSLEnclaveLib.lib;sgx_trts.lib;sgx_tstdc.lib;sgx_tservice.lib;sgx_tcrypto.lib;sgx_tstdcxx.lib;wolfSSLEnclaveLib.lib</AdditionalDependencies>
|
||||||
|
<AdditionalLibraryDirectories>$(OutDir);$(SGXSDKInstallPath)bin\$(Platform)\$(Configuration)</AdditionalLibraryDirectories>
|
||||||
|
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
|
||||||
|
<EntryPointSymbol>
|
||||||
|
</EntryPointSymbol>
|
||||||
|
<NoEntryPoint>true</NoEntryPoint>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
</Link>
|
||||||
|
<PostBuildEvent>
|
||||||
|
<Command>"$(SGXSDKInstallPath)bin\win32\release\sgx_sign.exe" gendata -enclave "$(OutDir)Enclave.dll" -out "$(OutDir)Enclave.hex" -config "$(ProjectDir)Enclave.config.xml"</Command>
|
||||||
|
<Message>generate the enclave signing material</Message>
|
||||||
|
</PostBuildEvent>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Prerelease|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
|
||||||
|
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||||
|
<Optimization>MaxSpeed</Optimization>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<AdditionalIncludeDirectories>$(SGXSDKInstallPath)include;$(SGXSDKInstallPath)include\tlibc;$(SGXSDKInstallPath)include\stlport;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
|
<PreprocessorDefinitions>WOLFSSL_SGX;_WINDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>wolfSSLEnclaveLib.lib;sgx_trts.lib;sgx_tstdc.lib;sgx_tservice.lib;sgx_tcrypto.lib;sgx_tstdcxx.lib</AdditionalDependencies>
|
||||||
|
<AdditionalLibraryDirectories>$(OutDir);$(SGXSDKInstallPath)bin\$(Platform)\Release;$(SolutionDir)</AdditionalLibraryDirectories>
|
||||||
|
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
|
||||||
|
<EntryPointSymbol>
|
||||||
|
</EntryPointSymbol>
|
||||||
|
<NoEntryPoint>true</NoEntryPoint>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
</Link>
|
||||||
|
<PostBuildEvent>
|
||||||
|
<Command>"$(SGXSDKInstallPath)bin\win32\release\sgx_sign.exe" sign -key "$(ProjectDir)Enclave_private.pem" -enclave "$(OutDir)Enclave.dll" -out "$(OutDir)Enclave.signed.dll" -config "$(ProjectDir)Enclave.config.xml"</Command>
|
||||||
|
<Message>sign the enclave</Message>
|
||||||
|
</PostBuildEvent>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Prerelease|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
|
||||||
|
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||||
|
<Optimization>MaxSpeed</Optimization>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<AdditionalIncludeDirectories>$(SGXSDKInstallPath)include;$(SGXSDKInstallPath)include\tlibc;$(SGXSDKInstallPath)include\stlport;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
|
<PreprocessorDefinitions>WOLFSSL_SGX;_WINDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>wolfssl.lib;sgx_trts.lib;sgx_tstdc.lib;sgx_tservice.lib;sgx_tcrypto.lib;sgx_tstdcxx.lib</AdditionalDependencies>
|
||||||
|
<AdditionalLibraryDirectories>$(OutDir);$(SGXSDKInstallPath)bin\$(Platform)\Release;$(SolutionDir)</AdditionalLibraryDirectories>
|
||||||
|
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
|
||||||
|
<EntryPointSymbol>
|
||||||
|
</EntryPointSymbol>
|
||||||
|
<NoEntryPoint>true</NoEntryPoint>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
</Link>
|
||||||
|
<PostBuildEvent>
|
||||||
|
<Command>"$(SGXSDKInstallPath)bin\win32\release\sgx_sign.exe" sign -key "$(ProjectDir)Enclave_private.pem" -enclave "$(OutDir)Enclave.dll" -out "$(OutDir)Enclave.signed.dll" -config "$(ProjectDir)Enclave.config.xml"</Command>
|
||||||
|
<Message>sign the enclave</Message>
|
||||||
|
</PostBuildEvent>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="Enclave.cpp" />
|
||||||
|
<ClCompile Include="Enclave_t.c" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="Enclave_t.h" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<CustomBuild Include="Enclave.edl">
|
||||||
|
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">"$(SGXSDKInstallPath)bin\win32\release\sgx_edger8r.exe" --trusted "$(ProjectDir)Enclave.edl" --search-path "$(SGXSDKInstallPath)include"</Command>
|
||||||
|
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">"$(SGXSDKInstallPath)bin\win32\release\sgx_edger8r.exe" --trusted "$(ProjectDir)Enclave.edl" --search-path "$(SGXSDKInstallPath)include"</Command>
|
||||||
|
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Creating proxy/bridge routines</Message>
|
||||||
|
<Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Creating proxy/bridge routines</Message>
|
||||||
|
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectName)_t.h;$(ProjectName)_t.c;%(Outputs)</Outputs>
|
||||||
|
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectName)_t.h;$(ProjectName)_t.c;%(Outputs)</Outputs>
|
||||||
|
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Enclave.config.xml;%(AdditionalInputs)</AdditionalInputs>
|
||||||
|
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Enclave.config.xml;%(AdditionalInputs)</AdditionalInputs>
|
||||||
|
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">"$(SGXSDKInstallPath)bin\win32\release\sgx_edger8r.exe" --trusted "$(ProjectDir)Enclave.edl" --search-path "$(SGXSDKInstallPath)include"</Command>
|
||||||
|
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">"$(SGXSDKInstallPath)bin\win32\release\sgx_edger8r.exe" --trusted "$(ProjectDir)Enclave.edl" --search-path "$(SGXSDKInstallPath)include"</Command>
|
||||||
|
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Creating proxy/bridge routines</Message>
|
||||||
|
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Creating proxy/bridge routines</Message>
|
||||||
|
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectName)_t.h;$(ProjectName)_t.c;%(Outputs)</Outputs>
|
||||||
|
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectName)_t.h;$(ProjectName)_t.c;%(Outputs)</Outputs>
|
||||||
|
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Enclave.config.xml;%(AdditionalInputs)</AdditionalInputs>
|
||||||
|
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Enclave.config.xml;%(AdditionalInputs)</AdditionalInputs>
|
||||||
|
<Command Condition="'$(Configuration)|$(Platform)'=='Prerelease|Win32'">"$(SGXSDKInstallPath)bin\win32\release\sgx_edger8r.exe" --trusted "$(ProjectDir)Enclave.edl" --search-path "$(SGXSDKInstallPath)include"</Command>
|
||||||
|
<Command Condition="'$(Configuration)|$(Platform)'=='Prerelease|x64'">"$(SGXSDKInstallPath)bin\win32\release\sgx_edger8r.exe" --trusted "$(ProjectDir)Enclave.edl" --search-path "$(SGXSDKInstallPath)include"</Command>
|
||||||
|
<Message Condition="'$(Configuration)|$(Platform)'=='Prerelease|Win32'">Creating proxy/bridge routines</Message>
|
||||||
|
<Message Condition="'$(Configuration)|$(Platform)'=='Prerelease|x64'">Creating proxy/bridge routines</Message>
|
||||||
|
<Outputs Condition="'$(Configuration)|$(Platform)'=='Prerelease|Win32'">$(ProjectName)_t.h;$(ProjectName)_t.c;%(Outputs)</Outputs>
|
||||||
|
<Outputs Condition="'$(Configuration)|$(Platform)'=='Prerelease|x64'">$(ProjectName)_t.h;$(ProjectName)_t.c;%(Outputs)</Outputs>
|
||||||
|
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Prerelease|Win32'">Enclave.config.xml;%(AdditionalInputs)</AdditionalInputs>
|
||||||
|
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Prerelease|x64'">Enclave.config.xml;%(AdditionalInputs)</AdditionalInputs>
|
||||||
|
<Command Condition="'$(Configuration)|$(Platform)'=='Simulation|Win32'">"$(SGXSDKInstallPath)bin\win32\release\sgx_edger8r.exe" --trusted "$(ProjectDir)Enclave.edl" --search-path "$(SGXSDKInstallPath)include"</Command>
|
||||||
|
<Command Condition="'$(Configuration)|$(Platform)'=='Simulation|x64'">"$(SGXSDKInstallPath)bin\win32\release\sgx_edger8r.exe" --trusted "$(ProjectDir)Enclave.edl" --search-path "$(SGXSDKInstallPath)include"</Command>
|
||||||
|
<Message Condition="'$(Configuration)|$(Platform)'=='Simulation|Win32'">Creating proxy/bridge routines</Message>
|
||||||
|
<Message Condition="'$(Configuration)|$(Platform)'=='Simulation|x64'">Creating proxy/bridge routines</Message>
|
||||||
|
<Outputs Condition="'$(Configuration)|$(Platform)'=='Simulation|Win32'">$(ProjectName)_t.h;$(ProjectName)_t.c;%(Outputs)</Outputs>
|
||||||
|
<Outputs Condition="'$(Configuration)|$(Platform)'=='Simulation|x64'">$(ProjectName)_t.h;$(ProjectName)_t.c;%(Outputs)</Outputs>
|
||||||
|
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Simulation|Win32'">Enclave.config.xml;%(AdditionalInputs)</AdditionalInputs>
|
||||||
|
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Simulation|x64'">Enclave.config.xml;%(AdditionalInputs)</AdditionalInputs>
|
||||||
|
</CustomBuild>
|
||||||
|
<None Include="Enclave_private.pem" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Xml Include="Enclave.config.xml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</Xml>
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
</ImportGroup>
|
||||||
|
</Project>
|
|
@ -0,0 +1,48 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup>
|
||||||
|
<Filter Include="Generated Files">
|
||||||
|
<UniqueIdentifier>{068eae22-7203-4e1c-854d-a433a15212ff}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Source Files">
|
||||||
|
<UniqueIdentifier>{10eec786-fad8-432e-8225-ed17e418af2c}</UniqueIdentifier>
|
||||||
|
<Extensions>cpp;c;edl;def; .. and other options</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Header Files">
|
||||||
|
<UniqueIdentifier>{30fcb149-c376-4064-84a4-7534d550c8d1}</UniqueIdentifier>
|
||||||
|
<Extensions>h;hpp; .. and other options</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Resource Files">
|
||||||
|
<UniqueIdentifier>{bf60dc36-c54c-4b85-830b-1446ecf54231}</UniqueIdentifier>
|
||||||
|
<Extensions>rc;xml;pem; .. and other options</Extensions>
|
||||||
|
</Filter>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="Enclave_t.c">
|
||||||
|
<Filter>Generated Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="Enclave.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="Enclave_t.h">
|
||||||
|
<Filter>Generated Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="Enclave_private.pem">
|
||||||
|
<Filter>Resource Files</Filter>
|
||||||
|
</None>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Xml Include="Enclave.config.xml">
|
||||||
|
<Filter>Resource Files</Filter>
|
||||||
|
</Xml>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<CustomBuild Include="Enclave.edl">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</CustomBuild>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
|
@ -0,0 +1,39 @@
|
||||||
|
-----BEGIN RSA PRIVATE KEY-----
|
||||||
|
MIIG5AIBAAKCAYEA4eKLFIPVBZlRKo/WLIG27A0/9CI7E0fPyEYu+ro3ckIDRoGw
|
||||||
|
eFLGmp4MpnFWBEbwtWoBhb/uZHiJ3Y+/6b8oooVDmC1/h0dn2/RoKKdHTB5i0PJ6
|
||||||
|
wnuxjCAPPGvsbScMQ/GpZpiP7FYGQbzVRh5DjJqgJQgEJS7I7uXBnIY1pNAh1P5w
|
||||||
|
4dSJQv4VzJI+dfbDsSKGM1KdrFPdaxcNaZqH2NtVgDcbHvVcksHXAa2rcAowvuQR
|
||||||
|
8B6uU27685qdckof+kX5J8kYCes5qymJxLV27I3pSdTlIjE3hiypBXCrULgaQalB
|
||||||
|
f/16vbpKQtArVQIes9J+1yCF+9PqUj1ppW2JWsYnFboi4bIAbX16yejw2t8OB7fZ
|
||||||
|
Su1B7mw0DaMhM51tvKnFYHI0kf+9k7z3D+qqRG2vHzr8BVsQN8zB1joFs5Idp/7R
|
||||||
|
6loEf5r/qDgrog+Yv4ktio0eFTGGpUy+GDtigm3KHaFn0sOQbMy9fov2hpNu1Q/A
|
||||||
|
O/PGjMw/o+rsJJz9AgEDAoIBgQCWlwdjAo4Du4txtTlzASSdXiqiwXy3hTUwLsn8
|
||||||
|
fCT21qzZq8r64dm8aV3ES46thKB48VZZKp7tpbE+X9VGf3BsWNe6yP+vhO/n+EVw
|
||||||
|
b4TdaZc19vyBp8uywAooR/Lzb12CoRuZuwqdjq7WfeOEFC0IZxVuBVgYydtJ7oET
|
||||||
|
BCPDNWvjVEtBOFuB/rkzDCmj+dfLbFl3jGkdjT5HZLObvFqQkjkAJLy/Tj23K+Sr
|
||||||
|
yRz1XCB/QragFHQ3n1H3vGj23BQQi5elOTewDnIQ7caZM/as0rdNJFClFNrVmFW8
|
||||||
|
lWFO4KfP3QOHLqSr1MDIWWZW+Iq6byJO93sxzlJ+1Rdl9Rd6A6HDL53l8AHrWBHj
|
||||||
|
jbIazF8n3bA1Xtp5TiBqOozW/guHEoMe3kub4DIVvWg0z/vYENKhuDaXM4Wo7aOm
|
||||||
|
Q9a/idSGwz8vGj6gRiZ8DRgPjXuNC5J0ICb6kHar/AUnafnJ097Jh99dF6ObP9l6
|
||||||
|
9ExhWnRdgMBFUbAw052IMI4SbxMCgcEA+9TALDSbzdzFBcCroFacTqtSrGz7O45L
|
||||||
|
WDsHlx4OAjukatIxFFnFUUNYqfrrRpe1oGM2y7/IDSKu/2b+clFkKo9aV1gir9xx
|
||||||
|
FvXh/2Fv/0LH7j6FAWIr2jJSiH/31q7nCWfW/fo4IT4Peabl5Lgiwnyjq4RxNMzY
|
||||||
|
Nz+20/iYbZ63XFi3tCY4Yu/jKijIxUzgN+RLS2YAG8lvAMkwJxPI1YIeSj3AqQqT
|
||||||
|
H/A8I9et/5KszRSv02RsD+rrjj9TDvG7AoHBAOWf1YO+qLP4yYwEND6Q6Jqmg6mx
|
||||||
|
cO8Do+2NINNyi1greh8LiyDdvmq30GxPJov1mPvIlJTthSP7v5SWyBosgfkxWhma
|
||||||
|
k1jtjHWDffUy9bNpt12sy/l8zl5EsOXLVhpxdWimKbQqiwbxYvl59Nv6jb3Xz4Ei
|
||||||
|
OO3A74MolYjbqyakp4GBO2+MbixB4sP7vsVufzQThpD244GPZaKJhjYIov4t3aUX
|
||||||
|
2B4Vh+P8uyJF1fT5E3u58ACU0jOj58liw/oEpwKBwQCn4yrIIxKJPdiugHJq5Gg0
|
||||||
|
cjcdnfzSXtzlfK+6FAlW0m2cjCC4O9jg15BxUfIvD85q7M8yf9qzbHSqRKmhi5gc
|
||||||
|
X5GPkBcf6Etko+v/lkqqLIVJfwNWQXKRduGwVU/kdJoGRTn+ptAWKV+mb0Pt0Bcs
|
||||||
|
UxfHraDN3eV6KnnipbrzvyToOyUixCWXSpdxcIXY3erP7YeHmVVn259V23VvYoXj
|
||||||
|
rBQxfoBwsbdqoCgX5R6qYciIuHU3mEgKnJ0Jf4y0oScCgcEAmRU5An8bIqXbsq14
|
||||||
|
KbXwZxmtG8ugn1fCnl4V4kxc5XJRageyFekpnHqK8t9vB/kQp9sNuJ5YwqfVDbna
|
||||||
|
vB2r+3Y8ERG3kJ5do6z+o3dOd5vPk8iH+6iJlC3LQ9zkEaD48G7GeBxcr0uXUPv4
|
||||||
|
kqcJKTqKVhbQnoCfrMW5BefHbxhvq6t89QhJctaXLVJ/LkmqIrevC09CVl+ZFwZZ
|
||||||
|
eVsXVB6Tw2U6vrkFQqh8wYPj+KYM/SagAGM2zRfv25ctUVhvAoHBANkD/bSFatBR
|
||||||
|
w23oEp0bdHEb8zGhvN+gVIv+U2uDwAB9KBnW5I5BKipNLZByoS6+NOT/Lo8LJQbs
|
||||||
|
8K5XtcjXGy2+gGEw7dHI0rZUIsz8Be/D3WdOycAovoRNNteWoFv7WkCWqzpwuO4M
|
||||||
|
D/JldsDEXOmHlDgkwyTGs51L9XVDL2fOY6EBieFPuORuxcLo2/j5JQ46vI8pLSkp
|
||||||
|
dVfPSyZd3XirUKNRJXg3bcKsgDQRqv1qyKbrtkenujomtA+zwZ+4Ng==
|
||||||
|
-----END RSA PRIVATE KEY-----
|
|
@ -0,0 +1,15 @@
|
||||||
|
|
||||||
|
#ifndef SGX_BENCHMARK_H
|
||||||
|
#define SGX_BENCHMARK_H
|
||||||
|
|
||||||
|
#include <wolfssl/wolfcrypt/types.h>
|
||||||
|
|
||||||
|
enum BenchmarkBounds {
|
||||||
|
numBlocks = 50, /* how many megs to test (en/de)cryption */
|
||||||
|
ntimes = 100,
|
||||||
|
genTimes = 100,
|
||||||
|
agreeTimes = 100
|
||||||
|
};
|
||||||
|
|
||||||
|
static byte plain[1024 * 1024];
|
||||||
|
#endif
|
Binary file not shown.
After Width: | Height: | Size: 76 KiB |
Binary file not shown.
After Width: | Height: | Size: 158 KiB |
Binary file not shown.
After Width: | Height: | Size: 39 KiB |
|
@ -0,0 +1,38 @@
|
||||||
|
wolfSSL Enclave Example
|
||||||
|
============================
|
||||||
|
|
||||||
|
This repository contains an example application, written in C++, which
|
||||||
|
demonstrates how to link with the wolfSSL lightweight SSL/TLS library with a
|
||||||
|
simple Enclave. First create wolfssl.lib from <wolfssl-root>/IDE/WIN-SGX
|
||||||
|
then copy wolfssl.lib to SGX_example/. Steps for creating wolfssl.lib can be
|
||||||
|
found in the main wolfSSL directory. <wolfssl-root>/IDE/WIN-SGX/ReadMe.txt.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
After creating and moving wolfssl.lib add the include path to wolfSSL header
|
||||||
|
files. It's suggested to add this with all platforms and all configurations
|
||||||
|
selected so that it only has to be added once.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Next optionally set the platform toolset for the compiler desired to use.
|
||||||
|
By default it is set to Intel C++ 16.0.
|
||||||
|
|
||||||
|
Below is the expected results when running the created benchmark application.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## Limitations
|
||||||
|
This code has been developed and tested on Visual Studio 2013 with the
|
||||||
|
default Intel compiler set. It may work for other versions but building
|
||||||
|
has not been tested on other versions.
|
||||||
|
|
||||||
|
1)Single Threaded
|
||||||
|
2)Crypto Only
|
||||||
|
3)AES-NI intrensics not added
|
||||||
|
|
||||||
|
## Support
|
||||||
|
|
||||||
|
Please contact wolfSSL at support@wolfssl.com with any questions, bug fixes,
|
||||||
|
or suggested feature additions.
|
||||||
|
|
Loading…
Reference in New Issue