aboutsummaryrefslogtreecommitdiff
path: root/include/libssh
diff options
context:
space:
mode:
authorJustus Winter <justus@g10code.com>2016-05-02 16:00:24 +0200
committerAndreas Schneider <asn@cryptomilk.org>2016-11-03 15:20:26 +0100
commit7e315629b9b70aae3b2a686def5cd053729652bd (patch)
treeea265a56309d35b160b91a565afb195288ed795e /include/libssh
parent3c2ea78a09fef43cc72fe6143b1bd6b10522c7f2 (diff)
downloadlibssh-7e315629b9b70aae3b2a686def5cd053729652bd.tar.gz
libssh-7e315629b9b70aae3b2a686def5cd053729652bd.tar.xz
libssh-7e315629b9b70aae3b2a686def5cd053729652bd.zip
libgcrypt: Implement the 'evp' interface
* include/libssh/libgcrypt.h (EVPCTX): Fix type. (NID_gcrypt_nistp{256,384,521}): New constants. * src/libgcrypt.c (nid_to_md_algo): New function mapping curves to digest algorithms. (evp{,_init,_update,_final}): New functions. Signed-off-by: Justus Winter <justus@g10code.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'include/libssh')
-rw-r--r--include/libssh/libgcrypt.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/libssh/libgcrypt.h b/include/libssh/libgcrypt.h
index 7556acae..ec353910 100644
--- a/include/libssh/libgcrypt.h
+++ b/include/libssh/libgcrypt.h
@@ -32,7 +32,7 @@ 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;
+typedef gcry_md_hd_t EVPCTX;
#define SHA_DIGEST_LENGTH 20
#define SHA_DIGEST_LEN SHA_DIGEST_LENGTH
#define MD5_DIGEST_LEN 16
@@ -51,6 +51,11 @@ typedef void *EVPCTX;
typedef gcry_mpi_t bignum;
+/* Constants for curves. */
+#define NID_gcrypt_nistp256 0
+#define NID_gcrypt_nistp384 1
+#define NID_gcrypt_nistp521 2
+
/* missing gcrypt functions */
int ssh_gcry_dec2bn(bignum *bn, const char *data);
char *ssh_gcry_bn2dec(bignum bn);