DPDK patches and discussions
 help / color / mirror / Atom feed
From: Pablo de Lara <pablo.de.lara.guarch@intel.com>
To: dev@dpdk.org
Cc: declan.doherty@intel.com, Pablo de Lara <pablo.de.lara.guarch@intel.com>
Subject: [dpdk-dev] [PATCH v2 09/11] test: add bit-level Snow3G UIA2 tests
Date: Fri, 17 Jun 2016 12:24:50 +0100	[thread overview]
Message-ID: <1466162692-24654-10-git-send-email-pablo.de.lara.guarch@intel.com> (raw)
In-Reply-To: <1466162692-24654-1-git-send-email-pablo.de.lara.guarch@intel.com>

Snow3G PMD supports now buffers that are non byte multiple,
so tests to cover this case have been added.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
 app/test/test_cryptodev.c                          |  50 ++++++++++
 app/test/test_cryptodev_snow3g_hash_test_vectors.h | 107 +++++++++++++++++++++
 2 files changed, 157 insertions(+)

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index 803f1f6..546ae92 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -2048,6 +2048,24 @@ test_snow3g_hash_generate_test_case_3(void)
 }
 
 static int
+test_snow3g_hash_generate_test_case_4(void)
+{
+	return test_snow3g_authentication(&snow3g_hash_test_case_4);
+}
+
+static int
+test_snow3g_hash_generate_test_case_5(void)
+{
+	return test_snow3g_authentication(&snow3g_hash_test_case_5);
+}
+
+static int
+test_snow3g_hash_generate_test_case_6(void)
+{
+	return test_snow3g_authentication(&snow3g_hash_test_case_6);
+}
+
+static int
 test_snow3g_hash_verify_test_case_1(void)
 {
 	return test_snow3g_authentication_verify(&snow3g_hash_test_case_1);
@@ -2067,6 +2085,24 @@ test_snow3g_hash_verify_test_case_3(void)
 }
 
 static int
+test_snow3g_hash_verify_test_case_4(void)
+{
+	return test_snow3g_authentication_verify(&snow3g_hash_test_case_4);
+}
+
+static int
+test_snow3g_hash_verify_test_case_5(void)
+{
+	return test_snow3g_authentication_verify(&snow3g_hash_test_case_5);
+}
+
+static int
+test_snow3g_hash_verify_test_case_6(void)
+{
+	return test_snow3g_authentication_verify(&snow3g_hash_test_case_6);
+}
+
+static int
 test_kasumi_hash_generate_test_case_1(void)
 {
 	return test_kasumi_authentication(&kasumi_hash_test_case_1);
@@ -4079,12 +4115,26 @@ static struct unit_test_suite cryptodev_sw_snow3g_testsuite  = {
 			test_snow3g_hash_generate_test_case_2),
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_snow3g_hash_generate_test_case_3),
+		/* Tests with buffers which length is not byte-aligned */
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_snow3g_hash_generate_test_case_4),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_snow3g_hash_generate_test_case_5),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_snow3g_hash_generate_test_case_6),
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_snow3g_hash_verify_test_case_1),
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_snow3g_hash_verify_test_case_2),
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_snow3g_hash_verify_test_case_3),
+		/* Tests with buffers which length is not byte-aligned */
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_snow3g_hash_verify_test_case_4),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_snow3g_hash_verify_test_case_5),
+		TEST_CASE_ST(ut_setup, ut_teardown,
+			test_snow3g_hash_verify_test_case_6),
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_snow3g_authenticated_encryption_test_case_1),
 		TEST_CASE_ST(ut_setup, ut_teardown,
diff --git a/app/test/test_cryptodev_snow3g_hash_test_vectors.h b/app/test/test_cryptodev_snow3g_hash_test_vectors.h
index fe4906b..a8a47db 100644
--- a/app/test/test_cryptodev_snow3g_hash_test_vectors.h
+++ b/app/test/test_cryptodev_snow3g_hash_test_vectors.h
@@ -438,4 +438,111 @@ struct snow3g_hash_test_data snow3g_hash_test_case_3 = {
 	}
 };
 
+struct snow3g_hash_test_data snow3g_hash_test_case_4 = {
+	.key = {
+		.data = {
+			0x2B, 0xD6, 0x45, 0x9F, 0x82, 0xC5, 0xB3, 0x00,
+			0x95, 0x2C, 0x49, 0x10, 0x48, 0x81, 0xFF, 0x48
+		},
+	.len = 16
+	},
+	.aad = {
+		.data = {
+			0x38, 0xA6, 0xF0, 0x56, 0x05, 0xD2, 0xEC, 0x49,
+			0x38, 0xA6, 0xF0, 0x56, 0x05, 0xD2, 0xEC, 0x49,
+		},
+		.len = 16
+	},
+	.plaintext = {
+		.data = {
+			0x6B, 0x22, 0x77, 0x37, 0x29, 0x6F, 0x39, 0x3C,
+			0x80, 0x79, 0x35, 0x3E, 0xDC, 0x87, 0xE2, 0xE8,
+			0x05, 0xD2, 0xEC, 0x49, 0xA4, 0xF2, 0xD8, 0xE0
+		},
+		.len = 189
+	},
+	.validAuthLenInBits = {
+		.len = 189
+		},
+	.validAuthOffsetLenInBits = {
+		.len = 128
+	},
+	.digest = {
+		.data = {0x2B, 0xCE, 0x18, 0x20},
+		.len  = 4
+	}
+};
+
+struct snow3g_hash_test_data snow3g_hash_test_case_5 = {
+	.key = {
+		.data = {
+			0xD4, 0x2F, 0x68, 0x24, 0x28, 0x20, 0x1C, 0xAF,
+			0xCD, 0x9F, 0x97, 0x94, 0x5E, 0x6D, 0xE7, 0xB7
+		},
+		.len = 16
+	},
+	.aad = {
+		.data = {
+			0x3E, 0xDC, 0x87, 0xE2, 0xA4, 0xF2, 0xD8, 0xE2,
+			0xBE, 0xDC, 0x87, 0xE2, 0xA4, 0xF2, 0x58, 0xE2
+		},
+		.len = 16
+	},
+	.plaintext = {
+		.data = {
+			0xB5, 0x92, 0x43, 0x84, 0x32, 0x8A, 0x4A, 0xE0,
+			0x0B, 0x73, 0x71, 0x09, 0xF8, 0xB6, 0xC8, 0xDD,
+			0x2B, 0x4D, 0xB6, 0x3D, 0xD5, 0x33, 0x98, 0x1C,
+			0xEB, 0x19, 0xAA, 0xD5, 0x2A, 0x5B, 0x2B, 0xC0
+		},
+		.len = 254
+	},
+	.validAuthLenInBits = {
+		.len = 254
+		},
+	.validAuthOffsetLenInBits = {
+		.len = 128
+	},
+	.digest = {
+		.data = {0xFC, 0x7B, 0x18, 0xBD},
+		.len  = 4
+	}
+};
+
+struct snow3g_hash_test_data snow3g_hash_test_case_6 = {
+	.key = {
+		.data = {
+			0xFD, 0xB9, 0xCF, 0xDF, 0x28, 0x93, 0x6C, 0xC4,
+			0x83, 0xA3, 0x18, 0x69, 0xD8, 0x1B, 0x8F, 0xAB
+		},
+		.len = 16
+	},
+	.aad = {
+		.data = {
+			0x36, 0xAF, 0x61, 0x44, 0x98, 0x38, 0xF0, 0x3A,
+			0xB6, 0xAF, 0x61, 0x44, 0x98, 0x38, 0x70, 0x3A
+		},
+		.len = 16
+	},
+	.plaintext = {
+		.data = {
+			0x59, 0x32, 0xBC, 0x0A, 0xCE, 0x2B, 0x0A, 0xBA,
+			0x33, 0xD8, 0xAC, 0x18, 0x8A, 0xC5, 0x4F, 0x34,
+			0x6F, 0xAD, 0x10, 0xBF, 0x9D, 0xEE, 0x29, 0x20,
+			0xB4, 0x3B, 0xD0, 0xC5, 0x3A, 0x91, 0x5C, 0xB7,
+			0xDF, 0x6C, 0xAA, 0x72, 0x05, 0x3A, 0xBF, 0xF2
+		},
+		.len = 319
+	},
+	.validAuthLenInBits = {
+		.len = 319
+		},
+	.validAuthOffsetLenInBits = {
+		.len = 128
+	},
+	.digest = {
+		.data = {0x02, 0xF1, 0xFA, 0xAF},
+		.len  = 4
+	}
+};
 #endif /* TEST_CRYPTODEV_SNOW3G_HASH_TEST_VECTORS_H_ */
-- 
2.5.0

  parent reply	other threads:[~2016-06-17 11:18 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-06 14:03 [dpdk-dev] [PATCH 0/8] Snow3G bit-level support Pablo de Lara
2016-05-06 14:03 ` [dpdk-dev] [PATCH 1/8] snow3g: rename libsso reference due to library update Pablo de Lara
2016-05-06 14:03 ` [dpdk-dev] [PATCH 2/8] doc: update build instructions for libsso_snow3g Pablo de Lara
2016-06-09 12:07   ` Mcnamara, John
2016-05-06 14:03 ` [dpdk-dev] [PATCH 3/8] snow3g: support bit-level operations Pablo de Lara
2016-05-06 14:03 ` [dpdk-dev] [PATCH 4/8] test: use new bit-level memcmp macro Pablo de Lara
2016-05-06 14:03 ` [dpdk-dev] [PATCH 5/8] test: fix buffer lengths for snow3G tests Pablo de Lara
2016-05-06 14:03 ` [dpdk-dev] [PATCH 6/8] test: add out-of-place crypto op tests for Snow3G PMD Pablo de Lara
2016-05-06 14:03 ` [dpdk-dev] [PATCH 7/8] test: add bit-level Snow3G UIA2 tests Pablo de Lara
2016-05-06 14:03 ` [dpdk-dev] [PATCH 8/8] test: add Snow3G UEA2 test with offset Pablo de Lara
2016-06-17 11:24 ` [dpdk-dev] [PATCH v2 00/11] Snow3G bit-level support Pablo de Lara
2016-06-17 11:24   ` [dpdk-dev] [PATCH v2 01/11] snow3g: rename libsso reference due to library update Pablo de Lara
2016-06-17 11:24   ` [dpdk-dev] [PATCH v2 02/11] doc: update build instructions for libsso_snow3g Pablo de Lara
2016-06-17 11:24   ` [dpdk-dev] [PATCH v2 03/11] snow3g: define IV/digest length macros Pablo de Lara
2016-06-17 11:24   ` [dpdk-dev] [PATCH v2 04/11] snow3g: support bit-level operations Pablo de Lara
2016-06-17 11:24   ` [dpdk-dev] [PATCH v2 05/11] snow3g: add missing feature flags Pablo de Lara
2016-06-17 11:24   ` [dpdk-dev] [PATCH v2 06/11] test: use new bit-level memcmp macro Pablo de Lara
2016-06-17 11:24   ` [dpdk-dev] [PATCH v2 07/11] test: fix buffer lengths for snow3G tests Pablo de Lara
2016-06-17 11:24   ` [dpdk-dev] [PATCH v2 08/11] test: add out-of-place crypto op tests for Snow3G PMD Pablo de Lara
2016-06-17 11:24   ` Pablo de Lara [this message]
2016-06-17 11:24   ` [dpdk-dev] [PATCH v2 10/11] test: add Snow3G UEA2 test with offset Pablo de Lara
2016-06-17 11:24   ` [dpdk-dev] [PATCH v2 11/11] test: refactor snow3g/kasumi tests Pablo de Lara
2016-06-17 13:41   ` [dpdk-dev] [PATCH v2 00/11] Snow3G bit-level support Jain, Deepak K
2016-06-20  9:27   ` [dpdk-dev] [PATCH v3 " Pablo de Lara
2016-06-20  9:27     ` [dpdk-dev] [PATCH v3 01/11] snow3g: rename libsso reference due to library update Pablo de Lara
2016-06-20  9:27     ` [dpdk-dev] [PATCH v3 02/11] doc: update build instructions for libsso_snow3g Pablo de Lara
2016-06-20  9:27     ` [dpdk-dev] [PATCH v3 03/11] snow3g: define IV/digest length macros Pablo de Lara
2016-06-20  9:27     ` [dpdk-dev] [PATCH v3 04/11] snow3g: support bit-level operations Pablo de Lara
2016-06-20  9:27     ` [dpdk-dev] [PATCH v3 05/11] snow3g: add missing feature flags Pablo de Lara
2016-06-20  9:27     ` [dpdk-dev] [PATCH v3 06/11] test: use new bit-level memcmp macro Pablo de Lara
2016-06-20  9:27     ` [dpdk-dev] [PATCH v3 07/11] test: fix buffer lengths for snow3G tests Pablo de Lara
2016-06-20  9:27     ` [dpdk-dev] [PATCH v3 08/11] test: add out-of-place crypto op tests for Snow3G PMD Pablo de Lara
2016-06-20  9:27     ` [dpdk-dev] [PATCH v3 09/11] test: add bit-level Snow3G UIA2 tests Pablo de Lara
2016-06-20  9:27     ` [dpdk-dev] [PATCH v3 10/11] test: add Snow3G UEA2 test with offset Pablo de Lara
2016-06-20  9:27     ` [dpdk-dev] [PATCH v3 11/11] test: refactor snow3g/kasumi tests Pablo de Lara
2016-06-20 14:44     ` [dpdk-dev] [PATCH v4 00/11] Snow3G bit-level support Pablo de Lara
2016-06-20 14:44       ` [dpdk-dev] [PATCH v4 01/11] snow3g: rename libsso reference due to library update Pablo de Lara
2016-06-20 14:44       ` [dpdk-dev] [PATCH v4 02/11] doc: update build instructions for libsso_snow3g Pablo de Lara
2016-06-20 14:44       ` [dpdk-dev] [PATCH v4 03/11] snow3g: define IV/digest length macros Pablo de Lara
2016-06-20 14:44       ` [dpdk-dev] [PATCH v4 04/11] snow3g: support bit-level operations Pablo de Lara
2016-06-20 14:44       ` [dpdk-dev] [PATCH v4 05/11] snow3g: add missing feature flags Pablo de Lara
2016-06-20 14:44       ` [dpdk-dev] [PATCH v4 06/11] test: use new bit-level memcmp macro Pablo de Lara
2016-06-20 14:44       ` [dpdk-dev] [PATCH v4 07/11] test: fix buffer lengths for snow3G tests Pablo de Lara
2016-06-20 14:44       ` [dpdk-dev] [PATCH v4 08/11] test: add out-of-place crypto op tests for Snow3G PMD Pablo de Lara
2016-06-20 14:45       ` [dpdk-dev] [PATCH v4 09/11] test: add bit-level Snow3G UIA2 tests Pablo de Lara
2016-06-20 14:45       ` [dpdk-dev] [PATCH v4 10/11] test: add Snow3G UEA2 test with offset Pablo de Lara
2016-06-20 14:45       ` [dpdk-dev] [PATCH v4 11/11] test: refactor snow3g/kasumi tests Pablo de Lara
2016-06-20 20:41       ` [dpdk-dev] [PATCH v4 00/11] Snow3G bit-level support Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1466162692-24654-10-git-send-email-pablo.de.lara.guarch@intel.com \
    --to=pablo.de.lara.guarch@intel.com \
    --cc=declan.doherty@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).