From a33f7bf5ca33587ddb05f2acac42f93068022458 Mon Sep 17 00:00:00 2001 From: Ondrej Kozina Date: Fri, 2 Dec 2022 11:39:59 +0100 Subject: [PATCH 1/3] Run PBKDF benchmark with 8 bytes long well-known passphrase. --- lib/utils_benchmark.c | 4 ++-- src/cryptsetup.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/utils_benchmark.c b/lib/utils_benchmark.c index 0a0c438e..d8976fb2 100644 --- a/lib/utils_benchmark.c +++ b/lib/utils_benchmark.c @@ -187,7 +187,7 @@ int crypt_benchmark_pbkdf_internal(struct crypt_device *cd, pbkdf->parallel_threads = 0; /* N/A in PBKDF2 */ pbkdf->max_memory_kb = 0; /* N/A in PBKDF2 */ - r = crypt_benchmark_pbkdf(cd, pbkdf, "foo", 3, "01234567890abcdef", 16, + r = crypt_benchmark_pbkdf(cd, pbkdf, "foobarfo", 8, "01234567890abcdef", 16, volume_key_size, &benchmark_callback, &u); pbkdf->time_ms = ms_tmp; if (r < 0) { @@ -207,7 +207,7 @@ int crypt_benchmark_pbkdf_internal(struct crypt_device *cd, return 0; } - r = crypt_benchmark_pbkdf(cd, pbkdf, "foo", 3, + r = crypt_benchmark_pbkdf(cd, pbkdf, "foobarfo", 8, "0123456789abcdef0123456789abcdef", 32, volume_key_size, &benchmark_callback, &u); if (r < 0) diff --git a/src/cryptsetup.c b/src/cryptsetup.c index c2e23c6e..dfaf7682 100644 --- a/src/cryptsetup.c +++ b/src/cryptsetup.c @@ -997,7 +997,7 @@ static int action_benchmark_kdf(const char *kdf, const char *hash, size_t key_si .time_ms = 1000, }; - r = crypt_benchmark_pbkdf(NULL, &pbkdf, "foo", 3, "0123456789abcdef", 16, key_size, + r = crypt_benchmark_pbkdf(NULL, &pbkdf, "foobarfo", 8, "0123456789abcdef", 16, key_size, &benchmark_callback, &pbkdf); if (r < 0) log_std(_("PBKDF2-%-9s N/A\n"), hash); @@ -1012,7 +1012,7 @@ static int action_benchmark_kdf(const char *kdf, const char *hash, size_t key_si .parallel_threads = ARG_UINT32(OPT_PBKDF_PARALLEL_ID) }; - r = crypt_benchmark_pbkdf(NULL, &pbkdf, "foo", 3, + r = crypt_benchmark_pbkdf(NULL, &pbkdf, "foobarfo", 8, "0123456789abcdef0123456789abcdef", 32, key_size, &benchmark_callback, &pbkdf); if (r < 0) -- 2.38.1