svn rev #23427: trunk/src/lib/crypto/crypto_tests/

ghudson@MIT.EDU ghudson at MIT.EDU
Wed Dec 2 13:32:04 EST 2009


http://src.mit.edu/fisheye/changelog/krb5/?cs=23427
Commit By: ghudson
Log Message:
In t_kperf, generate a valid ciphertext when testing decryption.



Changed Files:
U   trunk/src/lib/crypto/crypto_tests/t_kperf.c
Modified: trunk/src/lib/crypto/crypto_tests/t_kperf.c
===================================================================
--- trunk/src/lib/crypto/crypto_tests/t_kperf.c	2009-12-02 18:10:12 UTC (rev 23426)
+++ trunk/src/lib/crypto/crypto_tests/t_kperf.c	2009-12-02 18:32:03 UTC (rev 23427)
@@ -94,6 +94,14 @@
     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')




More information about the cvs-krb5 mailing list