"Fossies" - the Fresh Open Source Software Archive

Member "libmcrypt-2.5.8/lib/mcrypt_internal.h" (8 Mar 2003, 2495 Bytes) of package /linux/privat/old/libmcrypt-2.5.8.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "mcrypt_internal.h" see the Fossies "Dox" file reference documentation.

    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);