You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

83 lines
2.1 KiB

28 years ago
28 years ago
28 years ago
28 years ago
28 years ago
28 years ago
28 years ago
28 years ago
  1. #ifndef PHP_MCRYPT_H
  2. #define PHP_MCRYPT_H
  3. #if HAVE_LIBMCRYPT
  4. #ifdef ZTS
  5. #include "TSRM.h"
  6. #endif
  7. #if PHP_API_VERSION < 19990421
  8. #define zend_module_entry zend_module_entry
  9. #include "zend_modules.h"
  10. #include "internal_functions.h"
  11. #endif
  12. extern zend_module_entry mcrypt_module_entry;
  13. #define mcrypt_module_ptr &mcrypt_module_entry
  14. /* Functions for both old and new API */
  15. PHP_FUNCTION(mcrypt_ecb);
  16. PHP_FUNCTION(mcrypt_cbc);
  17. PHP_FUNCTION(mcrypt_cfb);
  18. PHP_FUNCTION(mcrypt_ofb);
  19. PHP_FUNCTION(mcrypt_get_cipher_name);
  20. PHP_FUNCTION(mcrypt_get_block_size);
  21. PHP_FUNCTION(mcrypt_get_key_size);
  22. PHP_FUNCTION(mcrypt_create_iv);
  23. #if HAVE_LIBMCRYPT24
  24. /* Support functions for old API */
  25. PHP_FUNCTION(mcrypt_list_algorithms);
  26. PHP_FUNCTION(mcrypt_list_modes);
  27. PHP_FUNCTION(mcrypt_get_iv_size);
  28. PHP_FUNCTION(mcrypt_encrypt);
  29. PHP_FUNCTION(mcrypt_decrypt);
  30. /* Functions for new API */
  31. PHP_FUNCTION(mcrypt_module_open);
  32. PHP_FUNCTION(mcrypt_generic_init);
  33. PHP_FUNCTION(mcrypt_generic);
  34. PHP_FUNCTION(mdecrypt_generic);
  35. PHP_FUNCTION(mcrypt_generic_end);
  36. PHP_FUNCTION(mcrypt_enc_self_test);
  37. PHP_FUNCTION(mcrypt_enc_is_block_algorithm_mode);
  38. PHP_FUNCTION(mcrypt_enc_is_block_algorithm);
  39. PHP_FUNCTION(mcrypt_enc_is_block_mode);
  40. PHP_FUNCTION(mcrypt_enc_get_block_size);
  41. PHP_FUNCTION(mcrypt_enc_get_key_size);
  42. PHP_FUNCTION(mcrypt_enc_get_supported_key_sizes);
  43. PHP_FUNCTION(mcrypt_enc_get_iv_size);
  44. PHP_FUNCTION(mcrypt_enc_get_algorithms_name);
  45. PHP_FUNCTION(mcrypt_enc_get_modes_name);
  46. PHP_FUNCTION(mcrypt_module_self_test);
  47. PHP_FUNCTION(mcrypt_module_is_block_algorithm_mode);
  48. PHP_FUNCTION(mcrypt_module_is_block_algorithm);
  49. PHP_FUNCTION(mcrypt_module_is_block_mode);
  50. PHP_FUNCTION(mcrypt_module_get_algo_block_size);
  51. PHP_FUNCTION(mcrypt_module_get_algo_key_size);
  52. PHP_FUNCTION(mcrypt_module_get_supported_key_sizes);
  53. PHP_FUNCTION(mcrypt_module_close);
  54. ZEND_BEGIN_MODULE_GLOBALS(mcrypt)
  55. int le_h;
  56. char *modes_dir;
  57. char *algorithms_dir;
  58. ZEND_END_MODULE_GLOBALS(mcrypt)
  59. #ifdef ZTS
  60. # define MCG(v) TSRMG(mcrypt_globals_id, zend_mcrypt_globals *, v)
  61. #else
  62. # define MCG(v) (mcrypt_globals.v)
  63. #endif
  64. #endif
  65. #else
  66. #define mcrypt_module_ptr NULL
  67. #endif
  68. #define phpext_mcrypt_ptr mcrypt_module_ptr
  69. #endif