libcrypto.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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 "common.h"
  11. #include "dl.h"
  12. #include <bdlib/src/String.h>
  13. typedef void (*AES_cbc_encrypt_t)(const unsigned char*, unsigned char*, const unsigned long, const AES_KEY*, unsigned char*, const int);
  14. typedef void (*AES_decrypt_t)(const unsigned char*, unsigned char*, const AES_KEY*);
  15. typedef void (*AES_encrypt_t)(const unsigned char*, unsigned char*, const AES_KEY*);
  16. typedef int (*AES_set_decrypt_key_t)(const unsigned char*, const int, AES_KEY*);
  17. typedef int (*AES_set_encrypt_key_t)(const unsigned char*, const int, AES_KEY*);
  18. typedef void (*BF_decrypt_t)(BF_LONG*, const BF_KEY*);
  19. typedef void (*BF_encrypt_t)(BF_LONG*, const BF_KEY*);
  20. typedef void (*BF_set_key_t)(BF_KEY*, int, const unsigned char*);
  21. typedef char* (*ERR_error_string_t)(unsigned long, char*);
  22. typedef unsigned long (*ERR_get_error_t)(void);
  23. typedef void (*OPENSSL_cleanse_t)(void*, size_t);
  24. typedef const char* (*RAND_file_name_t)(char*, size_t);
  25. typedef int (*RAND_load_file_t)(const char*, long);
  26. typedef void (*RAND_seed_t)(const void*, int);
  27. typedef int (*RAND_status_t)(void);
  28. typedef int (*RAND_write_file_t)(const char*);
  29. typedef int (*MD5_Final_t)(unsigned char*, MD5_CTX*);
  30. typedef int (*MD5_Init_t)(MD5_CTX*);
  31. typedef int (*MD5_Update_t)(MD5_CTX*, const void*, size_t);
  32. typedef int (*SHA1_Final_t)(unsigned char*, SHA_CTX*);
  33. typedef int (*SHA1_Init_t)(SHA_CTX*);
  34. typedef int (*SHA1_Update_t)(SHA_CTX*, const void*, size_t);
  35. typedef int (*SHA256_Final_t)(unsigned char*, SHA256_CTX *);
  36. typedef int (*SHA256_Init_t)(SHA256_CTX*);
  37. typedef int (*SHA256_Update_t)(SHA256_CTX*, const void*, size_t);
  38. #include ".defs/libcrypto_defs.h"
  39. int load_libcrypto();
  40. int unload_libcrypto();
  41. #endif /* !_LIBCRYPTO_H */