/[mcrypt]/libmcrypt/lib/mcrypt_internal.h
ViewVC logotype

Contents of /libmcrypt/lib/mcrypt_internal.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.13 - (show annotations)
Sat Jul 6 10:18:18 2002 UTC (18 years, 9 months ago) by nmav
Branch: MAIN
CVS Tags: libmcrypt_2_5_3, libmcrypt_2_5_7, libmcrypt_2_5_6, libmcrypt_2_5_5, libmcrypt_2_5_4, libmcrypt_2_5_5rc1, HEAD
Changes since 1.12: +4 -4 lines
File MIME type: text/plain
introduced the use of the const keyword in the exported functions

1 #ifndef LIBDEFS_H
2 #define LIBDEFS_H
3 #include <libdefs.h>
4 #endif
5
6 /* Local Defines */
7
8 #ifndef lt_ptr
9 /* older version of libltdl */
10 # define lt_ptr lt_ptr_t
11 #endif
12
13 typedef struct {
14 char* name;
15 lt_ptr address;
16 } mcrypt_preloaded;
17
18 typedef struct {
19 lt_dlhandle handle;
20 char name[64];
21 } mcrypt_dlhandle;
22
23 #define MCRYPT_INTERNAL_HANDLER (void*)-1
24
25 typedef struct {
26 mcrypt_dlhandle algorithm_handle;
27 mcrypt_dlhandle mode_handle;
28
29 /* Holds the algorithm's internal key */
30 byte *akey;
31
32 byte *abuf; /* holds the mode's internal buffers */
33
34 /* holds the key */
35 byte *keyword_given;
36
37 /* These were included to speed up encryption/decryption proccess, so
38 * there is not need for resolving symbols every time.
39 */
40 lt_ptr m_encrypt;
41 lt_ptr m_decrypt;
42 lt_ptr a_encrypt;
43 lt_ptr a_decrypt;
44 lt_ptr a_block_size;
45 } CRYPT_STREAM;
46
47 typedef CRYPT_STREAM* MCRYPT;
48
49 #define MCRYPT_FAILED 0x0
50
51 int mcrypt_module_close(MCRYPT td);
52
53 /* frontends */
54
55 int end_mcrypt( MCRYPT td, void *buf);
56 int mcrypt_enc_get_size(MCRYPT td);
57 int mcrypt_mode_get_size(MCRYPT td);
58 int mcrypt_set_key(MCRYPT td, void *a, const void *, int c, const void *, int e);
59 int mcrypt_enc_get_block_size(MCRYPT td);
60 int __mcrypt_get_block_size(MCRYPT td);
61 int mcrypt_enc_get_algo_iv_size(MCRYPT td);
62 int mcrypt_enc_get_iv_size(MCRYPT td);
63 int mcrypt_enc_get_key_size(MCRYPT td);
64 int* mcrypt_enc_get_supported_key_sizes(MCRYPT td, int* out_size);
65 int mcrypt_enc_is_block_algorithm(MCRYPT td);
66 char *mcrypt_enc_get_algorithms_name(MCRYPT td);
67 int init_mcrypt(MCRYPT td, void*buf, const void *, int, const void *);
68 int mcrypt(MCRYPT td, void* buf, void *a, int b);
69 int mdecrypt(MCRYPT td, void* buf, void *a, int b);
70 char *mcrypt_enc_get_modes_name(MCRYPT td);
71 int mcrypt_enc_is_block_mode(MCRYPT td);
72 int mcrypt_enc_mode_has_iv(MCRYPT td);
73 int mcrypt_enc_is_block_algorithm_mode(MCRYPT td);
74 int mcrypt_module_algorithm_version(const char *algorithm, const char *a_directory);
75 int mcrypt_module_mode_version(const char *mode, const char *m_directory);
76 int mcrypt_get_size(MCRYPT td);
77
78
79 #define MCRYPT_UNKNOWN_ERROR -1
80 #define MCRYPT_ALGORITHM_MODE_INCOMPATIBILITY -2
81 #define MCRYPT_KEY_LEN_ERROR -3
82 #define MCRYPT_MEMORY_ALLOCATION_ERROR -4
83 #define MCRYPT_UNKNOWN_MODE -5
84 #define MCRYPT_UNKNOWN_ALGORITHM -6
85
86 lt_ptr mcrypt_dlsym( mcrypt_dlhandle, char* str);
87 void mcrypt_dlclose( mcrypt_dlhandle mod);
88 lt_ptr _mcrypt_search_symlist_lib(const char* name);
89 lt_ptr _mcrypt_search_symlist_sym(mcrypt_dlhandle handle, const char* _name);

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26