-
Notifications
You must be signed in to change notification settings - Fork 18
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
benchmarks: Sanity check of benchmarks. #337
Comments
@franziskuskiefer, do you want to provide input on this? Otherwise I could just start and use what I think is appropriate. Naming and order is not super important but let's do that as long as it's easily possible and makes the next steps easier. |
Some thought, but just go ahead
|
I think it would help to talk about comparisons (as with OpenSSL) and regression testing separately: To have comparable benchmarks, we should make sure that we "do the same" for HACL and, e.g., OpenSSL. For example, when the API call in HACL is unified such that it always hashes a message before signing, and OpenSSL hashes and signs in two steps, we should make sure to include the hashing step in OpenSSL. Otherwise we compare hashing+sign with sign-only. For regression testing, I agree with your comment. We can put as much things as needed in the setup and only measure the single function we don't want to regress. For some benchmarks comparisons and regression testing align, but not for all. I will take a look and point out these cases. |
Examine timing anomalies:
(result != 1)
OpenSSL_Ed25519_Verify
seems to be very slow?OpenSSL_K256_ECDSA_Sign
seems to be slow?OpenSSL_K256_ECDSA_Verify
seems to be slow?OpenSSL_K256_ECDH
seems to be slow?EverCrypt_HKDF_SHA2_256_extract_expand
is faster than SHA2-512 variant.HACL_x25519_51_{,base}
seems off.Vectorized variants are slower? Measure with bigger messages to accomodate for CPU init?
Erroneous setups:
hacl_init_cpu_features()
EverCrypt_AutoConfig2_init()
Setup(...)
Copy&Paste Bugs:
BENCHMARK_CAPTURE
to prevent these errorsUsecases:
(message: &[u8], signature: &[u8], public_key: &[u8])
" and benchmark the whole usecase. Pay attention to missing (or extraneous) checks.state.PauseTiming()
could come in handy, although it is not recommended)ChaCha20Poly1305
ciphertext != expected_ciphertext
new_raw_private
inOpenSSL_Ed25519_Sign
into benchmark?HACL_NaCl_precomputed_combined
before loop to accomodate usecase?HACL_NaCl_precomputed_detached
before loop to accomodate usecase?Chore:
BENCHMARK
for (auto _: state) {
v.s.state.keepRunning()
Unsure:
OpenSSL_blake2b_oneshot
?OpenSSL_blake2s_oneshot
?The text was updated successfully, but these errors were encountered: