Hi
I have removed the compilation warnings from the AES testcases and also added do_ParseArgs() in the testcase.
Thanks
Richa Marwaha
LTC Security
>From 4911950b01530d923a229f5e6f5152806637292f Mon Sep 17 00:00:00 2001
From: Richa Marwaha <[email protected]>
Date: Fri, 13 May 2011 13:46:06 -0400
Subject: [PATCH] Removed the compilation warnings for aes testcases

Signed-off-by: Richa Marwaha <[email protected]>
---
 testcases/driver/aes.h      |    2 +-
 testcases/driver/aes_func.c |   14 ++++++++------
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/testcases/driver/aes.h b/testcases/driver/aes.h
index 0074c8f..4b6f8b8 100644
--- a/testcases/driver/aes.h
+++ b/testcases/driver/aes.h
@@ -10,7 +10,7 @@
 #endif
 
 #define MAX_KEY_SIZE  64
-#define MAX_TEXT_SIZE  64
+#define MAX_TEXT_SIZE  128
 #define MAX_IV_SIZE  64
 #define MAX_COUNTER_SIZE 16
 
diff --git a/testcases/driver/aes_func.c b/testcases/driver/aes_func.c
index 397eda7..9245173 100644
--- a/testcases/driver/aes_func.c
+++ b/testcases/driver/aes_func.c
@@ -274,7 +274,7 @@ CK_RV do_DecryptAES(struct test_suite_info tsuite)
 		}
 
 		/* Initialize */
-		if (tusite.ctv[i].counterlen != 0)
+		if (tsuite.ctv[i].counterlen != 0)
 		{
 			memcpy(aesctr.cb, tsuite.ctv[i].counter, tsuite.ctv[i].counterlen);
                         aesctr.ulCounterBits = tsuite.ctv[i].counterbits;
@@ -620,7 +620,7 @@ CK_RV do_PadAES(CK_ULONG key_len, struct test_suite_info tsuite)
 		return rc;
 	}
 
-	printf("%s padding test with key length %d,  passed.\n", tsuite.name, key_len);
+	printf("%s padding test with key length %ld,  passed.\n", tsuite.name, key_len);
 	return 0;
 }
 //wrap and unwrap function for aes counter mode
@@ -637,7 +637,6 @@ CK_RV do_WrapUnwrapAESCTR (CK_ULONG key_len)
 	CK_OBJECT_HANDLE    uw_key;
 	CK_FLAGS            flags;
 	CK_BYTE             user_pin[PKCS11_MAX_PIN_LEN];
-	CK_BYTE             counterblock[MAX_COUNTER_SIZE] = AES_COUNTER_VALUE;
 	CK_ULONG            user_pin_len;
 	CK_ULONG            wrapped_data_len;
 	CK_ULONG            i;
@@ -1113,7 +1112,10 @@ int main  (int argc, char **argv)
 	int rc, i, fcount;
 	CK_C_INITIALIZE_ARGS cinit_args;
 	CK_RV rv;
-	SYSTEMTIME t1, t2;
+        SYSTEMTIME t1, t2;
+        rc = do_ParseArgs(argc, argv);
+	if ( rc != 1)
+	   return rc;
 
 	printf("Using slot #%lu...\n\n", SLOT_ID );
 	printf("With option: no_stop: %d\n", no_stop);
@@ -1184,7 +1186,7 @@ int main  (int argc, char **argv)
 				process_time(t1, t2);
 				if (rc)
 				{
-					fcount;
+					fcount++;
 				}
 			}
 		}
@@ -1205,7 +1207,7 @@ int main  (int argc, char **argv)
 		process_time(t1, t2);
 		if (rc)
 		{
-			PRINT_ERR("ERROR do_WrapUnwrapAES_CTR failed, rc = 0x%lx\n", rc);
+			PRINT_ERR("ERROR do_WrapUnwrapAES_CTR failed, rc = 0x%d\n", rc);
 			if (!no_stop)
 			return rc;
 		}
-- 
1.7.0.4

------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
Opencryptoki-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opencryptoki-tech

Reply via email to