Skip to content
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

test_ec_compressed_points is very slow in SGX #134

Open
jethrogb opened this issue Dec 23, 2020 · 1 comment
Open

test_ec_compressed_points is very slow in SGX #134

jethrogb opened this issue Dec 23, 2020 · 1 comment

Comments

@jethrogb
Copy link
Member

This test takes over 20 seconds in SGX on my machine but less than 1 second on Linux. Changing the optimization level seems to have no effect.

@zugzwang
Copy link
Contributor

Adding some info we gathered back then with @MihirLuthra.

MbedTLS implements comb methods for scalar multiplication (Algorithm 4 due to an attack by Louis Goubin, MbedTLS code). The first step is to precompute a list of generator multiples that is memory intensive (the list is thus fixed per curve).

To optimize one scalar mult, it could be useful to tune flags related to this algorithm (see MBEDTLS_ECP_WINDOW_SIZE (and COMB_MAX_PRE)).

To optimize several scalar mults: Precomputed points are cached within an EcGroup within each key. It would be great if MbedTLS reused static precomputation tables. This idea was discussed here and added to 3.X here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants