summaryrefslogtreecommitdiffstats
path: root/include/libssh/libgcrypt.h
diff options
context:
space:
mode:
authorDirkjan Bussink <d.bussink@gmail.com>2014-04-20 09:53:47 +0000
committerAndreas Schneider <asn@cryptomilk.org>2014-04-22 10:55:59 +0200
commit4a089026647073be32ddb0885c12f47496bc709b (patch)
treecec94a4f40b1555aff10f7333ce274334c24d3c5 /include/libssh/libgcrypt.h
parentd6e6a453fc2b362174e9e0a8669574283b515245 (diff)
downloadlibssh-4a089026647073be32ddb0885c12f47496bc709b.tar.gz
libssh-4a089026647073be32ddb0885c12f47496bc709b.tar.xz
libssh-4a089026647073be32ddb0885c12f47496bc709b.zip
Add SHA2 algorithms for HMAC
BUG: https://red.libssh.org/issues/91 Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'include/libssh/libgcrypt.h')
-rw-r--r--include/libssh/libgcrypt.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/libssh/libgcrypt.h b/include/libssh/libgcrypt.h
index c1844a53..8e52a681 100644
--- a/include/libssh/libgcrypt.h
+++ b/include/libssh/libgcrypt.h
@@ -27,6 +27,9 @@
#include <gcrypt.h>
typedef gcry_md_hd_t SHACTX;
+typedef gcry_md_hd_t SHA256CTX;
+typedef gcry_md_hd_t SHA384CTX;
+typedef gcry_md_hd_t SHA512CTX;
typedef gcry_md_hd_t MD5CTX;
typedef gcry_md_hd_t HMACCTX;
typedef void *EVPCTX;
@@ -34,11 +37,14 @@ typedef void *EVPCTX;
#define SHA_DIGEST_LEN SHA_DIGEST_LENGTH
#define MD5_DIGEST_LEN 16
#define SHA256_DIGEST_LENGTH 32
+#define SHA256_DIGEST_LEN SHA256_DIGEST_LENGTH
#define SHA384_DIGEST_LENGTH 48
+#define SHA384_DIGEST_LEN SHA384_DIGEST_LENGTH
#define SHA512_DIGEST_LENGTH 64
+#define SHA512_DIGEST_LEN SHA512_DIGEST_LENGTH
#ifndef EVP_MAX_MD_SIZE
-#define EVP_MAX_MD_SIZE 36
+#define EVP_MAX_MD_SIZE 64
#endif
#define EVP_DIGEST_LEN EVP_MAX_MD_SIZE