summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/gnutls_hmac_fast.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/gnutls_hmac_fast.c b/tests/gnutls_hmac_fast.c
index 604ffcd396..459557e69e 100644
--- a/tests/gnutls_hmac_fast.c
+++ b/tests/gnutls_hmac_fast.c
@@ -81,6 +81,37 @@ void doit(void)
}
}
+ err =
+ gnutls_hmac_fast(GNUTLS_MAC_AES_GMAC_128, "keykeykeykeykeyk", 16, "abcdefghabc", 8,
+ digest);
+ if (err >= 0)
+ fail("gnutls_hmac_fast(GMAC-128) succeeded unexpectedly: %d\n", err);
+ else if (err != GNUTLS_E_INVALID_REQUEST)
+ fail("gnutls_hmac_fast(GMAC-128) failure: %d\n", err);
+ else if (debug)
+ success("gnutls_hmac_fast(GMAC-128) OK\n");
+
+ err =
+ gnutls_hmac_fast(GNUTLS_MAC_AES_GMAC_192, "keykeykeykeykeykeykeykey", 24,
+ "abcdefghabc", 8,
+ digest);
+ if (err >= 0)
+ fail("gnutls_hmac_fast(GMAC-192) succeeded unexpectedly: %d\n", err);
+ else if (err != GNUTLS_E_INVALID_REQUEST)
+ fail("gnutls_hmac_fast(GMAC-192) failure: %d\n", err);
+ else if (debug)
+ success("gnutls_hmac_fast(GMAC-192) OK\n");
+
+ err =
+ gnutls_hmac_fast(GNUTLS_MAC_AES_GMAC_256, "keykeykeykeykeykeykeykeykeykeyke", 32,
+ "abcdefghabc", 8,
+ digest);
+ if (err >= 0)
+ fail("gnutls_hmac_fast(GMAC-256) succeeded unexpectedly: %d\n", err);
+ else if (err != GNUTLS_E_INVALID_REQUEST)
+ fail("gnutls_hmac_fast(GMAC-256) failure: %d\n", err);
+ else if (debug)
+ success("gnutls_hmac_fast(GMAC-256) OK\n");
gnutls_global_deinit();
}