Skip to content

Commit

Permalink
evaluation results v0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
imtypist committed Nov 22, 2022
1 parent 247badd commit d820557
Show file tree
Hide file tree
Showing 28 changed files with 691 additions and 9 deletions.
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

4 changes: 3 additions & 1 deletion 2.client_deploy_and_call.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ bash console.sh call SmartCall $contract_address inference "cd $WORK_DIR/tee-pro

## execute private model inference with Gramine in SGX
printLog "client or TEE provider starts secret key provisioning server"
cd $WORK_DIR/tee-provider/sgx_gramine/encrypted_model/alexnet/secret_prov_pf && RA_TLS_ALLOW_DEBUG_ENCLAVE_INSECURE=1 RA_TLS_ALLOW_OUTDATED_TCB_INSECURE=1 ./server_dcap wrap_key &
cd $WORK_DIR/tee-provider/sgx_gramine/encrypted_model/alexnet/secret_prov_pf

RA_TLS_ALLOW_DEBUG_ENCLAVE_INSECURE=1 RA_TLS_ALLOW_OUTDATED_TCB_INSECURE=1 ./server_dcap wrap_key &> eval_logs/server_dcap.log &

cd $WORK_DIR/console

Expand Down
Binary file added dist/figures/das-time.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions dist/figures/das-time.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import matplotlib.pyplot as plt
import matplotlib
import numpy as np

matplotlib.rcParams['font.size'] = 16

labels = ['Registration/update', 'Remote attestation']
pckcache = [6.858, 0.061]
register_TPM = [2.544, 0]
quote_verify = [0, 0.152]
width = 0.2


fig, ax = plt.subplots()
ax.bar(labels, pckcache, width, label='PCK cache')
ax.bar(labels, register_TPM, width, bottom=pckcache, label='Register in TPM')
ax.bar(labels, quote_verify, width, bottom=register_TPM, label='Verify quote')
# x = np.arange(len(labels)) # the label locations

# Add some text for labels, title and custom x-axis tick labels, etc.
ax.set_ylabel('time cost (seconds)')
# ax.set_xticks(x,labels, rotation=5)

# ax.bar_label(rects1, padding=3, rotation=45)
# ax.bar_label(rects2, padding=3, rotation=45)

fig.tight_layout()
ax.legend()

plt.show()

# data = np.asarray([ubuntu18, windows11])
# plt.boxplot(data,labels=labels)
# plt.show()
Binary file added dist/figures/e2e-latency.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 42 additions & 0 deletions dist/figures/e2e-latency.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import matplotlib.pyplot as plt
import matplotlib
import numpy as np

matplotlib.rcParams['font.size'] = 16

labels = ['SGX, PM', 'SGX, SM']
on_chain_outsource = np.array([1.872, 2.120])
off_chain_pre_check = np.array([69.551, 69.223])
off_chain_exeution = np.array([15.643, 12.465])
generate_quote = np.array([0.013, 0.014])
return_to_on_chain = np.array([1.144, 1.203])
verify_quote = np.array([0.282, 0.156])

width = 0.35


fig, ax = plt.subplots()
ax.barh(labels, on_chain_outsource, width, label='On-chain call')
ax.barh(labels, off_chain_pre_check, width, left=on_chain_outsource, label='SGX pre-check')
ax.barh(labels, off_chain_exeution, width, left=off_chain_pre_check+on_chain_outsource, label='Model inference')
ax.barh(labels, generate_quote, width, left=off_chain_pre_check+on_chain_outsource+off_chain_exeution, label='Generate quote')
ax.barh(labels, return_to_on_chain, width, left=off_chain_pre_check+on_chain_outsource+off_chain_exeution+generate_quote, label='Return to on-chain')
ax.barh(labels, verify_quote, width, left=off_chain_pre_check+on_chain_outsource+off_chain_exeution+generate_quote+return_to_on_chain, label='Verify quote')
# x = np.arange(len(labels)) # the label locations

# Add some text for labels, title and custom x-axis tick labels, etc.
ax.set_xlabel('time cost (seconds)')
x = np.arange(len(labels))
ax.set_yticks(x,labels,rotation=90)

# ax.bar_label(rects1, padding=3, rotation=45)
# ax.bar_label(rects2, padding=3, rotation=45)

fig.tight_layout()
ax.legend(loc='best')

plt.show()

# data = np.asarray([ubuntu18, windows11])
# plt.boxplot(data,labels=labels)
# plt.show()
Binary file added dist/figures/on-off-chain-time.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions dist/figures/on-off-chain-time.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import matplotlib.pyplot as plt
import matplotlib
import numpy as np

matplotlib.rcParams['font.size'] = 16

labels = ['non-SGX, PM', 'SGX, PM', 'SGX, SM']
times = [4.711, 87.502, 86.667]
width = 0.35

fig, ax = plt.subplots()
ax.bar(labels, times, width=width)
# x = np.arange(len(labels)) # the label locations

# Add some text for labels, title and custom x-axis tick labels, etc.
ax.set_ylabel('time cost (seconds)')
# ax.set_xticks(x,labels, rotation=5)

# ax.bar_label(rects1, padding=3, rotation=45)
# ax.bar_label(rects2, padding=3, rotation=45)

fig.tight_layout()

plt.show()

# data = np.asarray([ubuntu18, windows11])
# plt.boxplot(data,labels=labels)
# plt.show()
Binary file added dist/figures/secret-prov-time.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions dist/figures/secret-prov-time.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import matplotlib.pyplot as plt
import matplotlib
import numpy as np

matplotlib.rcParams['font.size'] = 16

labels = ['secret provisioning']

secret_prov_time = [1.133, 0.951]

fig, ax = plt.subplots()

bplot1 = ax.boxplot(secret_prov_time,
vert=True, # vertical box alignment
patch_artist=True, # fill with color
labels=labels) # will be used to label x-ticks

ax.set_ylabel('time cost (seconds)')
fig.tight_layout()

plt.show()
52 changes: 52 additions & 0 deletions eval_logs/0-1.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
 [SMART][1669112798025] stop existing blockchain nodes 
try to stop node0
node0 isn't running.
try to stop node1
node1 isn't running.
try to stop node2
node2 isn't running.
try to stop node3
node3 isn't running.
 [SMART][1669112798099] remove existing blockchain data 
 [SMART][1669112798183] remove existing console log 
 [SMART][1669112798188] remove existing local pck database 
 [SMART][1669112798201] restart pck cache server 
 [SMART][1669112798221] generate 4 new blockchain nodes 
[INFO] Use binary fisco-smart/build/fisco-bcos-air/fisco-bcos
[INFO] Generate ca cert successfully!
Processing IP:127.0.0.1 Total:4
[INFO] Generate ./nodes/127.0.0.1/sdk cert successful!
[INFO] Generate ./nodes/127.0.0.1/node0/conf cert successful!
[INFO] Generate ./nodes/127.0.0.1/node1/conf cert successful!
[INFO] Generate ./nodes/127.0.0.1/node2/conf cert successful!
[INFO] Generate ./nodes/127.0.0.1/node3/conf cert successful!
[INFO] Generate uuid success: 8709a14e-76c0-4fce-b28e-0f2da0036b88
[INFO] Generate uuid success: 85f1dcf2-d806-4536-ba90-7f91c174e01c
[INFO] Generate uuid success: a78965c5-2a96-4da9-bdc1-bc06b937b83d
[INFO] Generate uuid success: 7c9222ff-dfa4-4b03-b2e0-af9bae498679
==============================================================
[INFO] GroupID : group0
[INFO] ChainID : chain0
[INFO] fisco-bcos path : fisco-smart/build/fisco-bcos-air/fisco-bcos
[INFO] Auth mode : false
[INFO] Start port : 30300 20200
[INFO] Server IP : 127.0.0.1:4
[INFO] SM model : false
[INFO] Output dir : ./nodes
[INFO] All completed. Files in ./nodes
 [SMART][1669112799227] start 4 new blockchain nodes 
try to start node0
try to start node1
try to start node2
try to start node3
 node1 start successfully pid=478307
 node2 start successfully pid=478309
 node0 start successfully pid=478308
 node3 start successfully pid=478316
 [SMART][1669112800784] sync blockchain nodes config to console 
 [SMART][1669112800788] deploy TEE provider management contract 
transaction hash: 0x30ff08be0028e2a73b6dcb21b3340e3a45bd9aaf724449bcd57e482fbf340ba2
contract address: 0x6849f21d1e455e9f0712b1e99fa4fcd23758e8f1
currentAccount: 0x1d716572cc50f4349508ece334c81fa0d5f1517a

 [SMART][1669112803839] system initialization is completed 
52 changes: 52 additions & 0 deletions eval_logs/0-2.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
 [SMART][1669114931226] stop existing blockchain nodes 
try to stop node0
 stop node0 success.
try to stop node1
 stop node1 success.
try to stop node2
 stop node2 success.
try to stop node3
 stop node3 success.
 [SMART][1669114935394] remove existing blockchain data 
 [SMART][1669114935478] remove existing console log 
 [SMART][1669114935483] remove existing local pck database 
 [SMART][1669114935496] restart pck cache server 
 [SMART][1669114935514] generate 4 new blockchain nodes 
[INFO] Use binary fisco-smart/build/fisco-bcos-air/fisco-bcos
[INFO] Generate ca cert successfully!
Processing IP:127.0.0.1 Total:4
[INFO] Generate ./nodes/127.0.0.1/sdk cert successful!
[INFO] Generate ./nodes/127.0.0.1/node0/conf cert successful!
[INFO] Generate ./nodes/127.0.0.1/node1/conf cert successful!
[INFO] Generate ./nodes/127.0.0.1/node2/conf cert successful!
[INFO] Generate ./nodes/127.0.0.1/node3/conf cert successful!
[INFO] Generate uuid success: 58da7247-9f82-4569-a6a9-697cdf567360
[INFO] Generate uuid success: c3f486fa-24e1-485b-8276-1760926c636f
[INFO] Generate uuid success: db44fbf9-dbe9-4a87-bbfc-4f14834895b5
[INFO] Generate uuid success: 27dda9a6-dca5-4638-9bc6-b2a870c6db5c
==============================================================
[INFO] GroupID : group0
[INFO] ChainID : chain0
[INFO] fisco-bcos path : fisco-smart/build/fisco-bcos-air/fisco-bcos
[INFO] Auth mode : false
[INFO] Start port : 30300 20200
[INFO] Server IP : 127.0.0.1:4
[INFO] SM model : false
[INFO] Output dir : ./nodes
[INFO] All completed. Files in ./nodes
 [SMART][1669114936631] start 4 new blockchain nodes 
try to start node0
try to start node1
try to start node2
try to start node3
 node1 start successfully pid=495036
 node2 start successfully pid=495048
 node3 start successfully pid=495047
 node0 start successfully pid=495051
 [SMART][1669114938185] sync blockchain nodes config to console 
 [SMART][1669114938189] deploy TEE provider management contract 
transaction hash: 0x8fe1d0885d8778fbc1a24ee2993a9432e131ccc0c7c2ffee73928dd65f805b31
contract address: 0x6849f21d1e455e9f0712b1e99fa4fcd23758e8f1
currentAccount: 0x1d716572cc50f4349508ece334c81fa0d5f1517a

 [SMART][1669114940924] system initialization is completed 
Binary file added eval_logs/0-3.log
Binary file not shown.
File renamed without changes.
41 changes: 41 additions & 0 deletions eval_logs/1-1.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
 [SMART][1669112894082] obtain TPM contract address 
 [SMART][1669112894091] retrieve enc_ppid from PCE and request pck cache update 

Intel(R) Software Guard Extensions PCK Cert ID Retrieval Tool Version 1.14.100.3

Warning: platform manifest is not available or current platform is not multi-package platform.
the data has been sent to cache server successfully and pckid_retrieval.csv has been generated successfully!
 [SMART][1669112901280] obtain enc_ppid 
 [SMART][1669112901285] register TEE provider in the TPM contract 
transaction hash: 0x95fd7c82eb69229dde28c506d628bbf860de86a075609e218f37b8b046ec29eb
---------------------------------------------------------------------------------------------
transaction status: 0
description: transaction executed successfully
---------------------------------------------------------------------------------------------
Receipt message: Success
Return message: Success
Return value size:0
Return types: ()
Return values:()
---------------------------------------------------------------------------------------------
Event logs
Event: {}

 [SMART][1669112903787] query the latest registered TEE provider 
---------------------------------------------------------------------------------------------
Return code: 0
description: transaction executed successfully
Return message: Success
---------------------------------------------------------------------------------------------
Return value size:2
Return types: (address, string)
Return values:(0x1d716572cc50f4349508ece334c81fa0d5f1517a, 0dd8725359db591e5be1c18161361f4052e881e4a0df4fe8312364ae74d71ca6bf7895b66f63453ed3cc06e07146031c94e0061a5f99702f2ea6f24479c4fb98fa61e15b85780f5892ccc1d80e44065bc45f30348fbfac9264abd50aa849729723e4d778f07a50815600d59d09877adeebf392d487f9ca494d023c0d3bf8b7fc852d849c809b82959f5f008f2a0bedde866bc06db03fbfbd471d8da9f28baf4ef8892a6e350153f5915cbd93208244822b8461c65fcba0d8f8fdf7811ea64b8cbc4df665bd1f5a900b75f684c259639904457c5b538d222722c22d712d276b4612d279942067520b8033bf4ddf35430667fac8f66a384cea9984c96dbcae36775420fbb11caac2fad19238ee6981a1fc325cbe1c8b189ca9210b319d93fc83999d457a5f1fad1f4e68bf5a9b2836ecee8048274371b85f2c8a617188786f42cd46bcbe3e9c887e756f1d9df617967da44b5e0f03b28d2532690009fb46761dad76517f06ac7c40522af1c963b8ecef5335d75fa4c656dec9d821e51d464dc60d)
---------------------------------------------------------------------------------------------

 [SMART][1669112906041] query an exsited enc_ppid in the pck cache database 

Intel(R) Software Guard Extensions PCK Cert ID Retrieval Tool Version 1.14.100.3

Warning: platform manifest is not available or current platform is not multi-package platform.
the data has been sent to cache server successfully and pckid_retrieval.csv has been generated successfully!
 [SMART][1669112906100] TEE provider registration is completed 
41 changes: 41 additions & 0 deletions eval_logs/1-2.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
 [SMART][1669115021706] obtain TPM contract address 
 [SMART][1669115021715] retrieve enc_ppid from PCE and request pck cache update 

Intel(R) Software Guard Extensions PCK Cert ID Retrieval Tool Version 1.14.100.3

Warning: platform manifest is not available or current platform is not multi-package platform.
the data has been sent to cache server successfully and pckid_retrieval.csv has been generated successfully!
 [SMART][1669115029913] obtain enc_ppid 
 [SMART][1669115029917] register TEE provider in the TPM contract 
transaction hash: 0xa726665e6d301e7169c11cc27764500d011be5f7ff3b7877036898f1fb9d9240
---------------------------------------------------------------------------------------------
transaction status: 0
description: transaction executed successfully
---------------------------------------------------------------------------------------------
Receipt message: Success
Return message: Success
Return value size:0
Return types: ()
Return values:()
---------------------------------------------------------------------------------------------
Event logs
Event: {}

 [SMART][1669115032391] query the latest registered TEE provider 
---------------------------------------------------------------------------------------------
Return code: 0
description: transaction executed successfully
Return message: Success
---------------------------------------------------------------------------------------------
Return value size:2
Return types: (address, string)
Return values:(0x1d716572cc50f4349508ece334c81fa0d5f1517a, 2d3bbd81eb23e2df23dd53965e6620f9fb53254c7df8ab1a9698caa18a7223b9faa3cf59550d6489d5d6c5d6ff0639f53d202fdc6f4acc016b992a6836b259ce7f6928521c9d6247ee24113f0972fb86e88896dcb09084aa847ac23a8eae46108cf1e39a0af8233934130918e502ea2fdd3698fab9922b380567f46d4eb1267637415ef3ca542882118618a09a4a91acb2abbed073f404ab76cd1b52af3e2a19a4db81683caf017610181894324e878e7724b679c0a7af9688b1d1ac3763c562e0f70421fbe0b9834e64bae74b413669f642bf22b9ff1c6879672a5078e862b68abc203e7d6828c295350c54a8c43010d0d7627bff372e44c7f4675c6970dd2dea3987eeedb00668e8ee1bc4b163e14d83f602a34f8b5dc8fcc472d76319b794386f27f5b42764d86534a037752d741650b136163f616658292f0ec42af8b936fc38d224d46cf20d09f4bac1ef730fe3e3d410aaf01e9727c0131f143d6852b909f3223dafbd8b22640c5eb5b1c018913dc6df88f780d86837e8056d6fcad019)
---------------------------------------------------------------------------------------------

 [SMART][1669115034623] query an exsited enc_ppid in the pck cache database 

Intel(R) Software Guard Extensions PCK Cert ID Retrieval Tool Version 1.14.100.3

Warning: platform manifest is not available or current platform is not multi-package platform.
the data has been sent to cache server successfully and pckid_retrieval.csv has been generated successfully!
 [SMART][1669115034683] TEE provider registration is completed 
41 changes: 41 additions & 0 deletions eval_logs/1-3.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
 [SMART][1669119530350] obtain TPM contract address 
 [SMART][1669119530360] retrieve enc_ppid from PCE and request pck cache update 

Intel(R) Software Guard Extensions PCK Cert ID Retrieval Tool Version 1.14.100.3

Warning: platform manifest is not available or current platform is not multi-package platform.
the data has been sent to cache server successfully and pckid_retrieval.csv has been generated successfully!
 [SMART][1669119537312] obtain enc_ppid 
 [SMART][1669119537317] register TEE provider in the TPM contract 
transaction hash: 0x53def2ed46c888ad8212d13d685a1503cec1f3f72b7c1764c343625b7dd0b310
---------------------------------------------------------------------------------------------
transaction status: 0
description: transaction executed successfully
---------------------------------------------------------------------------------------------
Receipt message: Success
Return message: Success
Return value size:0
Return types: ()
Return values:()
---------------------------------------------------------------------------------------------
Event logs
Event: {}

 [SMART][1669119539862] query the latest registered TEE provider 
---------------------------------------------------------------------------------------------
Return code: 0
description: transaction executed successfully
Return message: Success
---------------------------------------------------------------------------------------------
Return value size:2
Return types: (address, string)
Return values:(0x1d716572cc50f4349508ece334c81fa0d5f1517a, cfa56ccaa179de749b0a18648f1344213cc0012e334cf4ea55a4b4b9678b8fbf81c1d1c9a130c325c0aa0d6fba84739098bb568697f6ef152d493a5aa73b58465894214733aca4109156fa2bd046d14a0154f9afad1208eb07df696a37542a5223a7b1a0b6e31dff97260d84e07ae77a0ae0ac79019c7e04fbc7a41745f117eba48220118da7ff3102804e7e6edc842d5949226761ac16ea1168726aab9ed8fc22e6c2b42f95e058a639cc899b557519596cddaaeb12de54ae544e6004de8230613edf5a7e16045b5094921c31350391524f9eebbb4d7f45e61e5bd8f84da92c6de195cb0454981ddb3bbaa8d34a862b5f8f61db28e96cdba3c9320dd5f6c57b7bc62596b0fff13128453316189810e2d7a86c53e6d3245bd59259b926c2b0d8199ee05f4a13566661a341bba8137f6a3e30823279bee0b0637957cbfa4f5bd03b570b268be4903060f97ff3098bdfa8a98dbc5e74d2a92dcb50126e22caead40e5d32b597e8d0ca1f8a8999927232b2e2b6fce27104008b4e4f9d6ab8f8fb6b)
---------------------------------------------------------------------------------------------

 [SMART][1669119542135] query an exsited enc_ppid in the pck cache database 

Intel(R) Software Guard Extensions PCK Cert ID Retrieval Tool Version 1.14.100.3

Warning: platform manifest is not available or current platform is not multi-package platform.
the data has been sent to cache server successfully and pckid_retrieval.csv has been generated successfully!
 [SMART][1669119542199] TEE provider registration is completed 
File renamed without changes.
Loading

0 comments on commit d820557

Please sign in to comment.