diff hmac_test.c @ 143:5d99163f7e32 libtomcrypt-orig

import of libtomcrypt 0.99
author Matt Johnston <matt@ucc.asn.au>
date Sun, 19 Dec 2004 11:34:45 +0000
parents 7faae8f46238
children
line wrap: on
line diff
--- a/hmac_test.c	Tue Jun 15 14:07:21 2004 +0000
+++ b/hmac_test.c	Sun Dec 19 11:34:45 2004 +0000
@@ -285,12 +285,13 @@
         outlen = sizeof(digest);
         if((err = hmac_memory(hash, cases[i].key, cases[i].keylen, cases[i].data, cases[i].datalen, digest, &outlen)) != CRYPT_OK) {
 #if 0
-            printf("HMAC-%s test #%d\n", cases[i].algo, cases[i].num);
+            printf("HMAC-%s test #%d, %s\n", cases[i].algo, cases[i].num, error_to_string(err));
 #endif
             return err;
         }
 
         if(memcmp(digest, cases[i].digest, (size_t)hash_descriptor[hash].hashsize) != 0)  {
+            failed++;
 #if 0
             unsigned int j;
             printf("\nHMAC-%s test #%d:\n", cases[i].algo, cases[i].num);
@@ -303,9 +304,8 @@
                printf("%2x ", cases[i].digest[j]);
             }
             printf("\n");
+            return CRYPT_ERROR;
 #endif
-            failed++;
-            //return CRYPT_ERROR;
         } else {
             /* printf("HMAC-%s test #%d: Passed\n", cases[i].algo, cases[i].num); */
         }