summaryrefslogtreecommitdiff
path: root/cipher/mac-internal.h
diff options
context:
space:
mode:
authorJussi Kivilinna <jussi.kivilinna@iki.fi>2013-11-21 21:34:21 +0200
committerJussi Kivilinna <jussi.kivilinna@iki.fi>2013-11-21 21:34:21 +0200
commita34448c929b13bfb7b66d69169c89e7319a18b31 (patch)
treeb53d13266af4d87a0fda5353333f957e3fd0c0e1 /cipher/mac-internal.h
parentdbfa651618693da7ea73b4d2d00d4efd411bfb46 (diff)
downloadlibgcrypt-a34448c929b13bfb7b66d69169c89e7319a18b31.tar.gz
Add GMAC to MAC API
* cipher/Makefile.am: Add 'mac-gmac.c'. * cipher/mac-gmac.c: New. * cipher/mac-internal.h (gcry_mac_handle): Add 'u.gcm'. (_gcry_mac_type_spec_gmac_aes, _gcry_mac_type_spec_gmac_twofish) (_gcry_mac_type_spec_gmac_serpent, _gcry_mac_type_spec_gmac_seed) (_gcry_mac_type_spec_gmac_camellia): New externs. * cipher/mac.c (mac_list): Add GMAC specifications. * doc/gcrypt.texi: Add mention of GMAC. * src/gcrypt.h.in (gcry_mac_algos): Add GCM algorithms. * tests/basic.c (check_one_mac): Add support for MAC IVs. (check_mac): Add support for MAC IVs and add GMAC test vectors. * tests/bench-slope.c (mac_bench): Iterate algorithm numbers to 499. * tests/benchmark.c (mac_bench): Iterate algorithm numbers to 499. -- Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
Diffstat (limited to 'cipher/mac-internal.h')
-rw-r--r--cipher/mac-internal.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/cipher/mac-internal.h b/cipher/mac-internal.h
index 146b2180..2a5e7c67 100644
--- a/cipher/mac-internal.h
+++ b/cipher/mac-internal.h
@@ -103,6 +103,10 @@ struct gcry_mac_handle
int cipher_algo;
unsigned int blklen;
} cmac;
+ struct {
+ gcry_cipher_hd_t ctx;
+ int cipher_algo;
+ } gmac;
} u;
};
@@ -180,3 +184,22 @@ extern gcry_mac_spec_t _gcry_mac_type_spec_cmac_idea;
#if USE_GOST28147
extern gcry_mac_spec_t _gcry_mac_type_spec_cmac_gost28147;
#endif
+
+/*
+ * The GMAC algorithm specifications (mac-gmac.c).
+ */
+#if USE_AES
+extern gcry_mac_spec_t _gcry_mac_type_spec_gmac_aes;
+#endif
+#if USE_TWOFISH
+extern gcry_mac_spec_t _gcry_mac_type_spec_gmac_twofish;
+#endif
+#if USE_SERPENT
+extern gcry_mac_spec_t _gcry_mac_type_spec_gmac_serpent;
+#endif
+#if USE_SEED
+extern gcry_mac_spec_t _gcry_mac_type_spec_gmac_seed;
+#endif
+#if USE_CAMELLIA
+extern gcry_mac_spec_t _gcry_mac_type_spec_gmac_camellia;
+#endif