aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test-aes.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2012-09-09 10:37:50 (GMT)
committerJouni Malinen <j@w1.fi>2012-09-09 10:37:50 (GMT)
commit77b2c81275e8081dbba30ee9b9aa1a0bf65c4cd4 (patch)
treef526d47c288613c01220d634e361934667e37196 /tests/test-aes.c
parentd140db6adf7b3b439f71e1ac2c72e637157bfc4a (diff)
downloadhostap-77b2c81275e8081dbba30ee9b9aa1a0bf65c4cd4.zip
hostap-77b2c81275e8081dbba30ee9b9aa1a0bf65c4cd4.tar.gz
hostap-77b2c81275e8081dbba30ee9b9aa1a0bf65c4cd4.tar.bz2
Add aes_gmac() as a wrapper for AES GMAC operations using GCM
This is otherwise identical to aes_gcm_ae() but does not use the plain/crypt pointers since no data is encrypted. Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'tests/test-aes.c')
-rw-r--r--tests/test-aes.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test-aes.c b/tests/test-aes.c
index d917b73..84c959c 100644
--- a/tests/test-aes.c
+++ b/tests/test-aes.c
@@ -407,6 +407,20 @@ static int test_gcm(void)
ret++;
}
+ if (p_len == 0) {
+ if (aes_gmac(k, k_len, iv, iv_len, aad, aad_len, tag) <
+ 0) {
+ printf("GMAC failed (test case %d)\n", i);
+ ret++;
+ continue;
+ }
+
+ if (os_memcmp(tag, t, sizeof(tag)) != 0) {
+ printf("GMAC tag mismatch (test case %d)\n", i);
+ ret++;
+ }
+ }
+
if (aes_gcm_ad(k, k_len, iv, iv_len, c, p_len, aad, aad_len,
t, tmp) < 0) {
printf("GCM-AD failed (test case %d)\n", i);