-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Performance difference in ECC signature computation using OpenSSL inside and outside Intel SGX enclave #182
Comments
@jinghe-INTC any update on this? |
There is problem in building the project:
and the rustc version is:
Probably it needs an earlier build of Rust. |
I am still investigating your code, but I'm wondering if your measurement excluded the overhead of the ECALLs for openssl_no_enclave? If so, that could account for the significant difference in performance between running the code inside and outside the enclave. |
since code base is based on https://github.com/apache/incubator-teaclave-sgx-sdk it requires nightly-2022-10-22. I have updated repo to include correct rust-toolchain please try again with latest pull or with correct tool chain |
yes for openssl_no_enclave measurement ECALL is excluded, how ever ECALL overhead is not much as I have done other tests with putting ring library inside enclave and overhead was only ~3-5 micro seconds. I believe large difference is due to crypto operations done in software vs hardware, So some CPU flags / operations are not configured correctly for openssl to leverage CPU instructions to perform crypto operations. |
So the result of |
OK so I did a lot of testing on my side and I am not able to get 5K TPS consistently. I am able to replicate it sometime when I rebuild / install sgx-ssl SDK or try to switch between rev1 and rev2. When I try on completely new setup I am getting numbers closer to your test ( ~30% diff in HW mode and ~12% diff in SIM mode ). I also added empty function and ring to the mix to compare numbers and here are my results # Simulation
stage iters secs msecs iters/s diff.s
empty_function_enclave 1_000 0.001 1.192 838_850
empty_function_no_enclave 1_000 0.000 0.001 871_080_139
openssl_enclave 1_000 0.027 27.005 37_029 -11.79 %
openssl_no_enclave 1_000 0.024 23.822 41_978
ring_enclave 1_000 0.022 21.975 45_506 +8.40 %
ring_no_enclave 1_000 0.023 23.224 43_059
lb_empty_enclave latency (μs) avg: 1, min: 1, max: 2
lb_empty_no_enclave latency (μs) avg: 0, min: 0, max: 0
lb_openssl_enclave latency (μs) avg: 26, min: 25, max: 66
lb_openssl_no_enclave latency (μs) avg: 22, min: 22, max: 26
lb_ring_enclave latency (μs) avg: 22, min: 21, max: 27
lb_ring_no_enclave latency (μs) avg: 23, min: 22, max: 28
# Hardware
stage iters secs msecs iters/s diff.s
empty_function_enclave 1_000 0.004 4.176 239_449
empty_function_no_enclave 1_000 0.000 0.001 928_505_106
openssl_enclave 1_000 0.033 32.663 30_616 -30.38 %
openssl_no_enclave 1_000 0.023 22.741 43_973
ring_enclave 1_000 0.026 26.497 37_739 -14.18 %
ring_no_enclave 1_000 0.023 23.227 43_053
lb_empty_enclave latency (μs) avg: 4, min: 4, max: 8
lb_empty_no_enclave latency (μs) avg: 0, min: 0, max: 0
lb_openssl_enclave latency (μs) avg: 32, min: 31, max: 40
lb_openssl_no_enclave latency (μs) avg: 22, min: 22, max: 27
lb_ring_enclave latency (μs) avg: 26, min: 26, max: 31
lb_ring_no_enclave latency (μs) avg: 23, min: 22, max: 26
|
@jinghe-INTC how can we analyze performance loss between ring and openssl inside the enclave? |
Both Ring library and SGX SSL had modifications for the SGX, but that on SGX SSL was a little more. So a slight more performance loss is reasonable. |
Overview:
When computing ECC signatures inside and outside the Intel SGX enclave using the OpenSSL library, we observed a significant performance difference. Inside the enclave, the performance is about 5,000 operations, while outside the enclave, it is 43,000 operations. However, when using the Ring library, the performance is similar inside and outside the enclave.
Additional Information:
Steps to Reproduce:
POC Code
Expected Behavior:
The performance of ECC signature computation should be similar inside and outside the enclave when using the OpenSSL library.
Actual Behavior:
There is a significant performance difference in ECC signature computation inside and outside the enclave using the OpenSSL library.
Environment Details:
The text was updated successfully, but these errors were encountered: