diff mbox series

[API-NEXT,v1,1/1] validation: crypto: properly use check_alg for GMAC/CMAC testing

Message ID 1517630408-15320-2-git-send-email-odpbot@yandex.ru
State New
Headers show
Series [API-NEXT,v1,1/1] validation: crypto: properly use check_alg for GMAC/CMAC testing | expand

Commit Message

Github ODP bot Feb. 3, 2018, 4 a.m. UTC
From: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>


Use check_alg instead of alg_test for GMAC/CMAC testing.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>

---
/** Email created from pull request 451 (lumag:crypto-fix)
 ** https://github.com/Linaro/odp/pull/451
 ** Patch: https://github.com/Linaro/odp/pull/451.patch
 ** Base sha: 7cc568a011f1623a343399f5cff6688baf834639
 ** Merge commit sha: f20a7e9abfe5728c1b0eef83d3d8dd512898513b
 **/
 test/validation/api/crypto/odp_crypto_test_inp.c | 66 +++++++++---------------
 1 file changed, 24 insertions(+), 42 deletions(-)
diff mbox series

Patch

diff --git a/test/validation/api/crypto/odp_crypto_test_inp.c b/test/validation/api/crypto/odp_crypto_test_inp.c
index f310329ab..8c0ef5bca 100644
--- a/test/validation/api/crypto/odp_crypto_test_inp.c
+++ b/test/validation/api/crypto/odp_crypto_test_inp.c
@@ -1243,31 +1243,22 @@  static int check_alg_aes_gmac(void)
 
 static void crypto_test_gen_alg_aes_gmac(void)
 {
-	unsigned int test_vec_num = (sizeof(aes_gmac_reference) /
-				     sizeof(aes_gmac_reference[0]));
-	unsigned int i;
-
-	for (i = 0; i < test_vec_num; i++)
-		check_alg(ODP_CRYPTO_OP_ENCODE,
-			  ODP_CIPHER_ALG_NULL,
-			  ODP_AUTH_ALG_AES_GMAC,
-			  aes_gmac_reference,
-			  ARRAY_SIZE(aes_gmac_reference),
-			  false);
+	check_alg(ODP_CRYPTO_OP_ENCODE,
+		  ODP_CIPHER_ALG_NULL,
+		  ODP_AUTH_ALG_AES_GMAC,
+		  aes_gmac_reference,
+		  ARRAY_SIZE(aes_gmac_reference),
+		  false);
 }
 
 static void crypto_test_gen_alg_aes_gmac_ovr_iv(void)
 {
-	unsigned int test_vec_num = (sizeof(aes_gmac_reference) /
-				     sizeof(aes_gmac_reference[0]));
-	unsigned int i;
-
-	for (i = 0; i < test_vec_num; i++)
-		alg_test(ODP_CRYPTO_OP_ENCODE,
-			 ODP_CIPHER_ALG_NULL,
-			 ODP_AUTH_ALG_AES_GMAC,
-			 &aes_gmac_reference[i],
-			 true);
+	check_alg(ODP_CRYPTO_OP_ENCODE,
+		  ODP_CIPHER_ALG_NULL,
+		  ODP_AUTH_ALG_AES_GMAC,
+		  aes_gmac_reference,
+		  ARRAY_SIZE(aes_gmac_reference),
+		  true);
 }
 
 static void crypto_test_check_alg_aes_gmac(void)
@@ -1282,16 +1273,12 @@  static void crypto_test_check_alg_aes_gmac(void)
 
 static void crypto_test_check_alg_aes_gmac_ovr_iv(void)
 {
-	unsigned int test_vec_num = (sizeof(aes_gmac_reference) /
-				     sizeof(aes_gmac_reference[0]));
-	unsigned int i;
-
-	for (i = 0; i < test_vec_num; i++)
-		alg_test(ODP_CRYPTO_OP_DECODE,
-			 ODP_CIPHER_ALG_NULL,
-			 ODP_AUTH_ALG_AES_GMAC,
-			 &aes_gmac_reference[i],
-			 true);
+	check_alg(ODP_CRYPTO_OP_DECODE,
+		  ODP_CIPHER_ALG_NULL,
+		  ODP_AUTH_ALG_AES_GMAC,
+		  aes_gmac_reference,
+		  ARRAY_SIZE(aes_gmac_reference),
+		  false);
 }
 
 static int check_alg_aes_cmac(void)
@@ -1301,17 +1288,12 @@  static int check_alg_aes_cmac(void)
 
 static void crypto_test_gen_alg_aes_cmac(void)
 {
-	unsigned int test_vec_num = (sizeof(aes_cmac_reference) /
-				     sizeof(aes_cmac_reference[0]));
-	unsigned int i;
-
-	for (i = 0; i < test_vec_num; i++)
-		check_alg(ODP_CRYPTO_OP_ENCODE,
-			  ODP_CIPHER_ALG_NULL,
-			  ODP_AUTH_ALG_AES_CMAC,
-			  aes_cmac_reference,
-			  ARRAY_SIZE(aes_cmac_reference),
-			  false);
+	check_alg(ODP_CRYPTO_OP_ENCODE,
+		  ODP_CIPHER_ALG_NULL,
+		  ODP_AUTH_ALG_AES_CMAC,
+		  aes_cmac_reference,
+		  ARRAY_SIZE(aes_cmac_reference),
+		  false);
 }
 
 static void crypto_test_check_alg_aes_cmac(void)