aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/benchmark-crypto-cipher.c12
-rw-r--r--tests/benchmark-crypto-hash.c4
-rw-r--r--tests/benchmark-crypto-hmac.c7
3 files changed, 14 insertions, 9 deletions
diff --git a/tests/benchmark-crypto-cipher.c b/tests/benchmark-crypto-cipher.c
index 1936aa4..c04f0a0 100644
--- a/tests/benchmark-crypto-cipher.c
+++ b/tests/benchmark-crypto-cipher.c
@@ -70,8 +70,10 @@ static void test_cipher_speed(size_t chunk_size,
}
g_test_timer_elapsed();
- g_test_message("Enc chunk %zu bytes ", chunk_size);
- g_test_message("%.2f MB/sec ", (double)total / MiB / g_test_timer_last());
+ g_test_message("enc(%s-%s) chunk %zu bytes %.2f MB/sec ",
+ QCryptoCipherAlgorithm_str(alg),
+ QCryptoCipherMode_str(mode),
+ chunk_size, (double)total / MiB / g_test_timer_last());
g_test_timer_start();
remain = total;
@@ -85,8 +87,10 @@ static void test_cipher_speed(size_t chunk_size,
}
g_test_timer_elapsed();
- g_test_message("Dec chunk %zu bytes ", chunk_size);
- g_test_message("%.2f MB/sec ", (double)total / MiB / g_test_timer_last());
+ g_test_message("dec(%s-%s) chunk %zu bytes %.2f MB/sec ",
+ QCryptoCipherAlgorithm_str(alg),
+ QCryptoCipherMode_str(mode),
+ chunk_size, (double)total / MiB / g_test_timer_last());
qcrypto_cipher_free(cipher);
g_free(plaintext);
diff --git a/tests/benchmark-crypto-hash.c b/tests/benchmark-crypto-hash.c
index 598111e..927b00b 100644
--- a/tests/benchmark-crypto-hash.c
+++ b/tests/benchmark-crypto-hash.c
@@ -48,7 +48,9 @@ static void test_hash_speed(const void *opaque)
}
g_test_timer_elapsed();
- g_test_message("%.2f MB/sec ", (double)total / MiB / g_test_timer_last());
+ g_test_message("hash(%s): chunk %zu bytes %.2f MB/sec",
+ QCryptoHashAlgorithm_str(opts->alg),
+ opts->chunk_size, total / g_test_timer_last());
g_free(out);
g_free(in);
diff --git a/tests/benchmark-crypto-hmac.c b/tests/benchmark-crypto-hmac.c
index f9fa22d..5cca636 100644
--- a/tests/benchmark-crypto-hmac.c
+++ b/tests/benchmark-crypto-hmac.c
@@ -55,10 +55,9 @@ static void test_hmac_speed(const void *opaque)
} while (g_test_timer_elapsed() < 5.0);
total /= MiB;
- g_test_message("hmac(sha256): ");
- g_test_message("Testing chunk_size %zu bytes ", chunk_size);
- g_test_message("done: %.2f MB in %.2f secs: ", total, g_test_timer_last());
- g_test_message("%.2f MB/sec\n", total / g_test_timer_last());
+ g_test_message("hmac(%s): chunk %zu bytes %.2f MB/sec",
+ QCryptoHashAlgorithm_str(QCRYPTO_HASH_ALG_SHA256),
+ chunk_size, total / g_test_timer_last());
g_free(out);
g_free(in);