mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-05 16:00:05 +01:00
Tweak kdf benchmark log..
This commit is contained in:
@@ -242,16 +242,15 @@ int crypt_benchmark_pbkdf(struct crypt_device *cd,
|
|||||||
void *usrptr)
|
void *usrptr)
|
||||||
{
|
{
|
||||||
int r;
|
int r;
|
||||||
|
const char *kdf_opt;
|
||||||
|
|
||||||
r = init_crypto(cd);
|
r = init_crypto(cd);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
/* Hack to not print hash for argon, it is used also for AF later.*/
|
kdf_opt = !strcmp(pbkdf->type, CRYPT_KDF_PBKDF2) ? pbkdf->hash : "";
|
||||||
if (!strcmp(pbkdf->type, CRYPT_KDF_PBKDF2))
|
|
||||||
log_dbg("Running %s-%s benchmark.", pbkdf->type, pbkdf->hash);
|
log_dbg("Running %s(%s) benchmark.", pbkdf->type, kdf_opt);
|
||||||
else
|
|
||||||
log_dbg("Running %s benchmark.", pbkdf->type);
|
|
||||||
|
|
||||||
r = crypt_pbkdf_perf(pbkdf->type, pbkdf->hash, password, password_size,
|
r = crypt_pbkdf_perf(pbkdf->type, pbkdf->hash, password, password_size,
|
||||||
salt, salt_size, volume_key_size, pbkdf->time_ms,
|
salt, salt_size, volume_key_size, pbkdf->time_ms,
|
||||||
@@ -259,8 +258,8 @@ int crypt_benchmark_pbkdf(struct crypt_device *cd,
|
|||||||
&pbkdf->time_ms, &pbkdf->max_memory_kb, progress, usrptr);
|
&pbkdf->time_ms, &pbkdf->max_memory_kb, progress, usrptr);
|
||||||
|
|
||||||
if (!r)
|
if (!r)
|
||||||
log_dbg(" %u iterations, %u memory (for %zu-bits key).",
|
log_dbg("Benchmark returns %s(%s) %u iterations, %u memory, %u threads (for %zu-bits key).",
|
||||||
pbkdf->time_ms, pbkdf->max_memory_kb,
|
pbkdf->type, kdf_opt, pbkdf->time_ms, pbkdf->max_memory_kb,
|
||||||
volume_key_size * 8);
|
pbkdf->parallel_threads, volume_key_size * 8);
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user