From 08dee89e2f221fd566db707b760eb893291a7352 Mon Sep 17 00:00:00 2001 From: Greg Hudson Date: Wed, 2 Dec 2009 18:32:03 +0000 Subject: [PATCH] In t_kperf, generate a valid ciphertext when testing decryption git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23427 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/crypto/crypto_tests/t_kperf.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/lib/crypto/crypto_tests/t_kperf.c b/src/lib/crypto/crypto_tests/t_kperf.c index e653996bb..8c36e902f 100644 --- a/src/lib/crypto/crypto_tests/t_kperf.c +++ b/src/lib/crypto/crypto_tests/t_kperf.c @@ -94,6 +94,14 @@ main(int argc, char **argv) sum.length = cklen; sum.contents = calloc(1, cklen); + /* + * Decrypting typically involves copying the output after checking the + * hash, so we need to create a valid ciphertext to correctly measure its + * performance. + */ + if (op == 'd') + krb5_c_encrypt(NULL, &kblock, 0, NULL, &block, &outblock); + for (i = 0; i < num_blocks; i++) { if (intf == 'c') { if (op == 'e') -- 2.26.2