aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2015-01-05 14:02:08 (GMT)
committerJouni Malinen <j@w1.fi>2015-01-05 14:02:08 (GMT)
commit304d40e904612726506570e6ab12a5381e130b8b (patch)
treee8624b5970aa238d209a0553e091810f94d2d345 /tests
parent942b75468db873d1194d6ceecb2cf5015eadb29f (diff)
downloadhostap-304d40e904612726506570e6ab12a5381e130b8b.zip
hostap-304d40e904612726506570e6ab12a5381e130b8b.tar.gz
hostap-304d40e904612726506570e6ab12a5381e130b8b.tar.bz2
tests: Move OMAC1-AES test cases into hwsim module tests
This makes sure the test cases are executed automatically with rest of the hwsim tests. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'tests')
-rw-r--r--tests/test-aes.c92
1 files changed, 0 insertions, 92 deletions
diff --git a/tests/test-aes.c b/tests/test-aes.c
index 20d4b5d..4dd3962 100644
--- a/tests/test-aes.c
+++ b/tests/test-aes.c
@@ -438,68 +438,6 @@ static int test_gcm(void)
}
-/* OMAC1 AES-128 test vectors from
- * http://csrc.nist.gov/CryptoToolkit/modes/proposedmodes/omac/omac-ad.pdf
- * which are same as the examples from NIST SP800-38B
- * http://csrc.nist.gov/CryptoToolkit/modes/800-38_Series_Publications/SP800-38B.pdf
- */
-
-struct omac1_test_vector {
- u8 k[16];
- u8 msg[64];
- int msg_len;
- u8 tag[16];
-};
-
-static struct omac1_test_vector test_vectors[] =
-{
- {
- { 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6,
- 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c },
- { },
- 0,
- { 0xbb, 0x1d, 0x69, 0x29, 0xe9, 0x59, 0x37, 0x28,
- 0x7f, 0xa3, 0x7d, 0x12, 0x9b, 0x75, 0x67, 0x46 }
- },
- {
- { 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6,
- 0xab, 0xf7, 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 0x0a, 0x52, 0xef,
- 0xf6, 0x9f, 0x24, 0x45, 0xdf, 0x4f, 0x9b, 0x17,
- 0xad, 0x2b, 0x41, 0x7b, 0xe6, 0x6c, 0x37, 0x10 },
- 64,
- { 0x51, 0xf0, 0xbe, 0xbf, 0x7e, 0x3b, 0x9d, 0x92,
- 0xfc, 0x49, 0x74, 0x17, 0x79, 0x36, 0x3c, 0xfe }
- },
-};
-
-
static int test_key_wrap(void)
{
unsigned int i;
@@ -1029,10 +967,7 @@ static int test_nist_key_wrap_ad(const char *fname)
int main(int argc, char *argv[])
{
- u8 result[24];
int ret = 0;
- unsigned int i;
- struct omac1_test_vector *tv;
if (argc >= 3 && os_strcmp(argv[1], "NIST-KW-AE") == 0)
ret += test_nist_key_wrap_ae(argv[2]);
@@ -1043,33 +978,6 @@ int main(int argc, char *argv[])
test_aes_perf();
- for (i = 0; i < ARRAY_SIZE(test_vectors); i++) {
- tv = &test_vectors[i];
- if (omac1_aes_128(tv->k, tv->msg, tv->msg_len, result) ||
- memcmp(result, tv->tag, 16) != 0) {
- printf("OMAC1-AES-128 test vector %d failed\n", i);
- ret++;
- }
-
- if (tv->msg_len > 1) {
- const u8 *addr[2];
- size_t len[2];
-
- addr[0] = tv->msg;
- len[0] = 1;
- addr[1] = tv->msg + 1;
- len[1] = tv->msg_len - 1;
-
- if (omac1_aes_128_vector(tv->k, 2, addr, len,
- result) ||
- memcmp(result, tv->tag, 16) != 0) {
- printf("OMAC1-AES-128(vector) test vector %d "
- "failed\n", i);
- ret++;
- }
- }
- }
-
ret += test_eax();
ret += test_cbc();