/[cvs]/eggdrop1.9/src/cryptapi.h
ViewVC logotype

Contents of /eggdrop1.9/src/cryptapi.h

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (show annotations) (download) (as text)
Tue Dec 16 21:45:35 2003 UTC (15 years, 10 months ago) by wcc
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +24 -3 lines
File MIME type: text/x-csrc
* src/ cleanups.

1 /* cryptapi.h: API for modules that want to provide hash/crypto
2 *
3 * Copyright (C) 2002, 2003, 2004 Eggheads Development Team
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 *
19 * $Id: $
20 */
21
22 #ifndef _EGG_CRYPTAPI_H_
23 #define _EGG_CRYPTAPI_H_
24
25 /* Interface definitions for encryption and hash functions. */
26
27 typedef struct {
28 char *name;
29 void *(*hash_begin)();
30 int (*hash_update)(void *context, char *buf, int len);
31 int (*hash_end)(void *context, char **digest, int *len);
32 int (*hash_size)();
33 } hash_interface_t;
34
35 typedef struct {
36 char *name;
37 void *(*crypto_begin)();
38 int *(crypto_set_key)(void *context, char *key, int len);
39 int *(*crypto_encrypt)(void *context, char *inbuf, char *outbuf, int len);
40 int *(*crypto_decrypt)(void *context, char *inbuf, char *outbuf, int len);
41 int (*crypto_end)(void *context);
42 } crypto_interface_t;
43
44 int crypto_register_module(hash_interface_t *hash, crypto_interface_t *crypto);
45 int crypto_unregister_module(hash_interface_t *hash, crypto_interface_t *crypto);
46
47 #endif /* !_EGG_CRYPTAPI_H_ */

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23