digest: add support for OpenSSL 1.1.0
[siplcs.git] / src / core / sipe-digest.h
blob53220b4ef44a5f361b0fb30c82f88e9e9ec66d77
1 /**
2 * @file sipe-digest.h
4 * pidgin-sipe
6 * Copyright (C) 2010-2016 SIPE Project <http://sipe.sourceforge.net/>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 /* Plain digests */
24 /* NOTE: can only be used by internal NTLMv2 implementation */
25 #define SIPE_DIGEST_MD4_LENGTH 16
26 void sipe_digest_md4(const guchar *data, gsize length, guchar *digest);
28 #define SIPE_DIGEST_MD5_LENGTH 16
29 void sipe_digest_md5(const guchar *data, gsize length, guchar *digest);
31 #define SIPE_DIGEST_SHA1_LENGTH 20
32 void sipe_digest_sha1(const guchar *data, gsize length, guchar *digest);
34 /* HMAC digests */
35 #define SIPE_DIGEST_HMAC_MD5_LENGTH SIPE_DIGEST_MD5_LENGTH
36 void sipe_digest_hmac_md5(const guchar *key, gsize key_length,
37 const guchar *data, gsize data_length,
38 guchar *digest);
40 #define SIPE_DIGEST_HMAC_SHA1_LENGTH SIPE_DIGEST_SHA1_LENGTH
41 void sipe_digest_hmac_sha1(const guchar *key, gsize key_length,
42 const guchar *data, gsize data_length,
43 guchar *digest);
45 /* Stream HMAC(SHA1) digest for file transfer */
46 #define SIPE_DIGEST_FILETRANSFER_LENGTH SIPE_DIGEST_SHA1_LENGTH
47 gpointer sipe_digest_ft_start(const guchar *sha1_digest);
48 void sipe_digest_ft_update(gpointer context, const guchar *data, gsize length);
49 void sipe_digest_ft_end(gpointer context, guchar *digest);
50 void sipe_digest_ft_destroy(gpointer context);
52 /* Stream digests, e.g. for TLS */
53 gpointer sipe_digest_md5_start(void);
54 void sipe_digest_md5_update(gpointer context, const guchar *data, gsize length);
55 void sipe_digest_md5_end(gpointer context, guchar *digest);
56 void sipe_digest_md5_destroy(gpointer context);
57 gpointer sipe_digest_sha1_start(void);
58 void sipe_digest_sha1_update(gpointer context, const guchar *data, gsize length);
59 void sipe_digest_sha1_end(gpointer context, guchar *digest);
60 void sipe_digest_sha1_destroy(gpointer context);