6 * Copyright (C) 2010-11 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
24 #define SIPE_DIGEST_MD5_LENGTH 16
25 void sipe_digest_md5(const guchar
*data
, gsize length
, guchar
*digest
);
27 #define SIPE_DIGEST_SHA1_LENGTH 20
28 void sipe_digest_sha1(const guchar
*data
, gsize length
, guchar
*digest
);
31 #define SIPE_DIGEST_HMAC_MD5_LENGTH SIPE_DIGEST_MD5_LENGTH
32 void sipe_digest_hmac_md5(const guchar
*key
, gsize key_length
,
33 const guchar
*data
, gsize data_length
,
36 #define SIPE_DIGEST_HMAC_SHA1_LENGTH SIPE_DIGEST_SHA1_LENGTH
37 void sipe_digest_hmac_sha1(const guchar
*key
, gsize key_length
,
38 const guchar
*data
, gsize data_length
,
41 /* Stream HMAC(SHA1) digest for file transfer */
42 #define SIPE_DIGEST_FILETRANSFER_LENGTH SIPE_DIGEST_SHA1_LENGTH
43 gpointer
sipe_digest_ft_start(const guchar
*sha1_digest
);
44 void sipe_digest_ft_update(gpointer context
, const guchar
*data
, gsize length
);
45 void sipe_digest_ft_end(gpointer context
, guchar
*digest
);
46 void sipe_digest_ft_destroy(gpointer context
);
48 /* Stream digests, e.g. for TLS */
49 gpointer
sipe_digest_md5_start(void);
50 void sipe_digest_md5_update(gpointer context
, const guchar
*data
, gsize length
);
51 void sipe_digest_md5_end(gpointer context
, guchar
*digest
);
52 void sipe_digest_md5_destroy(gpointer context
);
53 gpointer
sipe_digest_sha1_start(void);
54 void sipe_digest_sha1_update(gpointer context
, const guchar
*data
, gsize length
);
55 void sipe_digest_sha1_end(gpointer context
, guchar
*digest
);
56 void sipe_digest_sha1_destroy(gpointer context
);