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>
This commit is contained in:
Jouni Malinen 2012-09-09 13:37:50 +03:00
parent d140db6adf
commit 77b2c81275
3 changed files with 25 additions and 0 deletions

View file

@ -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);