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

Diff of /libmcrypt/lib/mcrypt_internal.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1.1.1 by nmav, Mon May 22 13:07:53 2000 UTC revision 1.13 by nmav, Sat Jul 6 10:18:18 2002 UTC
# Line 1  Line 1 
1    #ifndef LIBDEFS_H
2    #define LIBDEFS_H
3    #include <libdefs.h>
4    #endif
5    
6  /* Local Defines */  /* 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 {  typedef struct {
26          lt_dlhandle algorithm_handle;          mcrypt_dlhandle algorithm_handle;
27          lt_dlhandle mode_handle;          mcrypt_dlhandle mode_handle;
28    
29          /* Holds the algorithm's internal key */          /* Holds the algorithm's internal key */
30          word8 *akey;          byte *akey;
31    
32          word8 *abuf;          byte *abuf; /* holds the mode's internal buffers */
33    
34          /* holds the key */          /* holds the key */
35          word8 *keyword_given;          byte *keyword_given;
   
         /* holds a lock for the thread */  
36    
37  /* These were included to speed up encryption/decryption proccess, so  /* These were included to speed up encryption/decryption proccess, so
38   * there is not need for resolving symbols every time.   * there is not need for resolving symbols every time.
39   */   */
40          lt_ptr_t m_encrypt;          lt_ptr m_encrypt;
41          lt_ptr_t m_decrypt;          lt_ptr m_decrypt;
42          lt_ptr_t a_encrypt;          lt_ptr a_encrypt;
43          lt_ptr_t a_decrypt;          lt_ptr a_decrypt;
44          lt_ptr_t a_block_size;          lt_ptr a_block_size;
45  } CRYPT_STREAM;  } CRYPT_STREAM;
46    
47  typedef CRYPT_STREAM* MCRYPT;  typedef CRYPT_STREAM* MCRYPT;
48    
49  #define MCRYPT_FAILED 0x0  #define MCRYPT_FAILED 0x0
50    
 void mcrypt_block_encrypt(MCRYPT td, void *);  
 void mcrypt_block_decrypt(MCRYPT td, void *);  
 void mcrypt_stream_encrypt(MCRYPT td, void *, int);  
 void mcrypt_stream_decrypt(MCRYPT td, void *, int);  
   
51  int mcrypt_module_close(MCRYPT td);  int mcrypt_module_close(MCRYPT td);
52    
53  /* frontends */  /* frontends */
# Line 41  int mcrypt_module_close(MCRYPT td); Line 55  int mcrypt_module_close(MCRYPT td);
55  int end_mcrypt( MCRYPT td, void *buf);  int end_mcrypt( MCRYPT td, void *buf);
56  int mcrypt_enc_get_size(MCRYPT td);  int mcrypt_enc_get_size(MCRYPT td);
57  int mcrypt_mode_get_size(MCRYPT td);  int mcrypt_mode_get_size(MCRYPT td);
58  void mcrypt_set_key(MCRYPT td, void *a, void *b, int c, void *d, int e);  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);  int mcrypt_enc_get_block_size(MCRYPT td);
60  int __mcrypt_get_block_size(MCRYPT td);  int __mcrypt_get_block_size(MCRYPT td);
61  int mcrypt_enc_get_algo_iv_size(MCRYPT td);  int mcrypt_enc_get_algo_iv_size(MCRYPT td);
# Line 50  int mcrypt_enc_get_key_size(MCRYPT td); Line 64  int mcrypt_enc_get_key_size(MCRYPT td);
64  int* mcrypt_enc_get_supported_key_sizes(MCRYPT td, int* out_size);  int* mcrypt_enc_get_supported_key_sizes(MCRYPT td, int* out_size);
65  int mcrypt_enc_is_block_algorithm(MCRYPT td);  int mcrypt_enc_is_block_algorithm(MCRYPT td);
66  char *mcrypt_enc_get_algorithms_name(MCRYPT td);  char *mcrypt_enc_get_algorithms_name(MCRYPT td);
67  int init_mcrypt(MCRYPT td, void*buf, void *a, int b, void *c);  int init_mcrypt(MCRYPT td, void*buf, const void *, int, const void *);
68  int mcrypt(MCRYPT td, void* buf, void *a, int b);  int mcrypt(MCRYPT td, void* buf, void *a, int b);
69  int mdecrypt(MCRYPT td, void* buf, void *a, int b);  int mdecrypt(MCRYPT td, void* buf, void *a, int b);
70  char *mcrypt_enc_get_modes_name(MCRYPT td);  char *mcrypt_enc_get_modes_name(MCRYPT td);
71  int mcrypt_enc_is_block_mode(MCRYPT td);  int mcrypt_enc_is_block_mode(MCRYPT td);
72  int mcrypt_enc_mode_has_iv(MCRYPT td);  int mcrypt_enc_mode_has_iv(MCRYPT td);
73  int mcrypt_enc_is_block_algorithm_mode(MCRYPT td);  int mcrypt_enc_is_block_algorithm_mode(MCRYPT td);
74  int mcrypt_module_algorithm_version(char *algorithm, char *a_directory);  int mcrypt_module_algorithm_version(const char *algorithm, const char *a_directory);
75  int mcrypt_module_mode_version(char *mode, char *m_directory);  int mcrypt_module_mode_version(const char *mode, const char *m_directory);
76  int mcrypt_get_size(MCRYPT td);  int mcrypt_get_size(MCRYPT td);
 int *mcrypt_enc_get_supported_key_sizes(MCRYPT td, int *len);  
77    
78    
79  #define MCRYPT_UNKNOWN_ERROR -1  #define MCRYPT_UNKNOWN_ERROR -1
# Line 70  int *mcrypt_enc_get_supported_key_sizes( Line 83  int *mcrypt_enc_get_supported_key_sizes(
83  #define MCRYPT_UNKNOWN_MODE -5  #define MCRYPT_UNKNOWN_MODE -5
84  #define MCRYPT_UNKNOWN_ALGORITHM -6  #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);

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.13

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26