summaryrefslogtreecommitdiff
path: root/cipher/mac-hmac.c
diff options
context:
space:
mode:
authorDmitry Eremin-Solenikov <dbaryshkov@gmail.com>2013-12-27 12:37:12 +0400
committerWerner Koch <wk@gnupg.org>2014-01-13 10:40:37 +0100
commit653b58cb5e85511b6c04c3f85ef3e372c2e9f74f (patch)
tree5dade8a8059d004398f35a3bc16782529206cc55 /cipher/mac-hmac.c
parent8439a379c86ef1088465ea70ac10840759a1638e (diff)
downloadlibgcrypt-653b58cb5e85511b6c04c3f85ef3e372c2e9f74f.tar.gz
Add MD2-HMAC calculation support
* src/gcrypt.h.in (GCRY_MAC_HMAC_MD2): New. * cipher/mac-hmac.c: Support GCRY_MAC_HMAC_MD2. Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Diffstat (limited to 'cipher/mac-hmac.c')
-rw-r--r--cipher/mac-hmac.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/cipher/mac-hmac.c b/cipher/mac-hmac.c
index 5edd7e82..2c660e98 100644
--- a/cipher/mac-hmac.c
+++ b/cipher/mac-hmac.c
@@ -35,6 +35,8 @@ map_mac_algo_to_md (int mac_algo)
{
default:
return GCRY_MD_NONE;
+ case GCRY_MAC_HMAC_MD2:
+ return GCRY_MD_MD2;
case GCRY_MAC_HMAC_MD4:
return GCRY_MD_MD4;
case GCRY_MAC_HMAC_MD5:
@@ -270,3 +272,9 @@ gcry_mac_spec_t _gcry_mac_type_spec_hmac_md4 = {
&hmac_ops
};
#endif
+#if USE_MD2
+gcry_mac_spec_t _gcry_mac_type_spec_hmac_md2 = {
+ GCRY_MAC_HMAC_MD2, {0, 0}, "HMAC_MD2",
+ &hmac_ops
+};
+#endif