File: digest.h

package info (click to toggle)
xymon 4.3.30-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 11,384 kB
  • sloc: ansic: 69,137; sh: 3,601; makefile: 863; javascript: 452; perl: 48
file content (31 lines) | stat: -rw-r--r-- 1,371 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*----------------------------------------------------------------------------*/
/* Xymon monitor library.                                                     */
/*                                                                            */
/* This is used to implement the message digest functions.                    */
/*                                                                            */
/* Copyright (C) 2003-2011 Henrik Storner <henrik@hswn.dk>                    */
/*                                                                            */
/* This program is released under the GNU General Public License (GPL),       */
/* version 2. See the file "COPYING" for details.                             */
/*                                                                            */
/*----------------------------------------------------------------------------*/

#ifndef __DIGEST_H_
#define __DIGEST_H_

typedef enum { D_MD5, D_SHA1, D_SHA256, D_SHA512, D_SHA224, D_SHA384, D_RMD160 } digesttype_t;

typedef struct digestctx_t {
	char *digestname;
	digesttype_t digesttype;
	void *mdctx;
} digestctx_t;

extern char *md5hash(char *input);
extern digestctx_t *digest_init(char *digest);
extern int digest_data(digestctx_t *ctx, unsigned char *buf, int buflen);
extern char *digest_done(digestctx_t *ctx);

#define dohash(P) md5hash(P)

#endif