libcrypto.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #ifndef _LIBCRYPTO_H
  2. #define _LIBCRYPTO_H
  3. #include <openssl/crypto.h>
  4. #include <openssl/aes.h>
  5. #include <openssl/blowfish.h>
  6. #include <openssl/md5.h>
  7. #include <openssl/sha.h>
  8. #include "src/crypto/aes_util.h"
  9. #include "src/crypto/bf_util.h"
  10. #include "src/crypto/dh_util.h"
  11. #include "common.h"
  12. #include "dl.h"
  13. #include <bdlib/src/String.h>
  14. typedef void (*AES_cbc_encrypt_t)(const unsigned char*, unsigned char*, const unsigned long, const AES_KEY*, unsigned char*, const int);
  15. typedef void (*AES_decrypt_t)(const unsigned char*, unsigned char*, const AES_KEY*);
  16. typedef void (*AES_encrypt_t)(const unsigned char*, unsigned char*, const AES_KEY*);
  17. typedef int (*AES_set_decrypt_key_t)(const unsigned char*, const int, AES_KEY*);
  18. typedef int (*AES_set_encrypt_key_t)(const unsigned char*, const int, AES_KEY*);
  19. typedef void (*BF_decrypt_t)(BF_LONG*, const BF_KEY*);
  20. typedef void (*BF_encrypt_t)(BF_LONG*, const BF_KEY*);
  21. typedef void (*BF_set_key_t)(BF_KEY*, int, const unsigned char*);
  22. typedef char* (*ERR_error_string_t)(unsigned long, char*);
  23. typedef unsigned long (*ERR_get_error_t)(void);
  24. typedef void (*OPENSSL_cleanse_t)(void*, size_t);
  25. typedef const char* (*RAND_file_name_t)(char*, size_t);
  26. typedef int (*RAND_load_file_t)(const char*, long);
  27. typedef void (*RAND_seed_t)(const void*, int);
  28. typedef int (*RAND_status_t)(void);
  29. typedef int (*RAND_write_file_t)(const char*);
  30. typedef int (*MD5_Final_t)(unsigned char*, MD5_CTX*);
  31. typedef int (*MD5_Init_t)(MD5_CTX*);
  32. typedef int (*MD5_Update_t)(MD5_CTX*, const void*, size_t);
  33. typedef int (*SHA1_Final_t)(unsigned char*, SHA_CTX*);
  34. typedef int (*SHA1_Init_t)(SHA_CTX*);
  35. typedef int (*SHA1_Update_t)(SHA_CTX*, const void*, size_t);
  36. typedef int (*SHA256_Final_t)(unsigned char*, SHA256_CTX *);
  37. typedef int (*SHA256_Init_t)(SHA256_CTX*);
  38. typedef int (*SHA256_Update_t)(SHA256_CTX*, const void*, size_t);
  39. typedef BIGNUM* (*BN_bin2bn_t)(const unsigned char*, int, BIGNUM*);
  40. typedef BIGNUM* (*BN_dup_t)(const BIGNUM*);
  41. typedef int (*BN_bn2bin_t)(const BIGNUM*, unsigned char*);
  42. typedef int (*BN_dec2bn_t)(BIGNUM**, const char*);
  43. typedef int (*BN_hex2bn_t)(BIGNUM**, const char*);
  44. typedef int (*BN_num_bits_t)(const BIGNUM*);
  45. typedef void (*BN_clear_free_t)(BIGNUM*);
  46. typedef int (*DH_compute_key_t)(unsigned char*, const BIGNUM*, DH*);
  47. typedef void (*DH_free_t)(DH*);
  48. typedef int (*DH_generate_key_t)(DH*);
  49. typedef DH* (*DH_new_t)(void);
  50. typedef int (*DH_size_t)(const DH*);
  51. int load_libcrypto();
  52. int unload_libcrypto();
  53. #endif /* !_LIBCRYPTO_H */