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.

106 lines
3.4 KiB

25 years ago
25 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
  1. /*
  2. +----------------------------------------------------------------------+
  3. | PHP Version 4 |
  4. +----------------------------------------------------------------------+
  5. | Copyright (c) 1997-2002 The PHP Group |
  6. +----------------------------------------------------------------------+
  7. | This source file is subject to version 2.02 of the PHP license, |
  8. | that is bundled with this package in the file LICENSE, and is |
  9. | available at through the world-wide-web at |
  10. | http://www.php.net/license/2_02.txt. |
  11. | If you did not receive a copy of the PHP license and are unable to |
  12. | obtain it through the world-wide-web, please send a note to |
  13. | license@php.net so we can mail you a copy immediately. |
  14. +----------------------------------------------------------------------+
  15. | Authors: Sascha Schumann <sascha@schumann.cx> |
  16. | Derick Rethans <d.rethans@jdimedia.nl> |
  17. +----------------------------------------------------------------------+
  18. */
  19. /* $Id$ */
  20. #ifndef PHP_MCRYPT_H
  21. #define PHP_MCRYPT_H
  22. #if HAVE_LIBMCRYPT
  23. #ifdef ZTS
  24. #include "TSRM.h"
  25. #endif
  26. #if PHP_API_VERSION < 19990421
  27. #define zend_module_entry zend_module_entry
  28. #include "zend_modules.h"
  29. #include "internal_functions.h"
  30. #endif
  31. extern zend_module_entry mcrypt_module_entry;
  32. #define mcrypt_module_ptr &mcrypt_module_entry
  33. /* Functions for both old and new API */
  34. PHP_FUNCTION(mcrypt_ecb);
  35. PHP_FUNCTION(mcrypt_cbc);
  36. PHP_FUNCTION(mcrypt_cfb);
  37. PHP_FUNCTION(mcrypt_ofb);
  38. PHP_FUNCTION(mcrypt_get_cipher_name);
  39. PHP_FUNCTION(mcrypt_get_block_size);
  40. PHP_FUNCTION(mcrypt_get_key_size);
  41. PHP_FUNCTION(mcrypt_create_iv);
  42. #if HAVE_LIBMCRYPT24
  43. /* Support functions for old API */
  44. PHP_FUNCTION(mcrypt_list_algorithms);
  45. PHP_FUNCTION(mcrypt_list_modes);
  46. PHP_FUNCTION(mcrypt_get_iv_size);
  47. PHP_FUNCTION(mcrypt_encrypt);
  48. PHP_FUNCTION(mcrypt_decrypt);
  49. /* Functions for new API */
  50. PHP_FUNCTION(mcrypt_module_open);
  51. PHP_FUNCTION(mcrypt_generic_init);
  52. PHP_FUNCTION(mcrypt_generic);
  53. PHP_FUNCTION(mdecrypt_generic);
  54. PHP_FUNCTION(mcrypt_generic_end);
  55. #if HAVE_MCRYPT_GENERIC_DEINIT
  56. PHP_FUNCTION(mcrypt_generic_deinit);
  57. #endif
  58. PHP_FUNCTION(mcrypt_enc_self_test);
  59. PHP_FUNCTION(mcrypt_enc_is_block_algorithm_mode);
  60. PHP_FUNCTION(mcrypt_enc_is_block_algorithm);
  61. PHP_FUNCTION(mcrypt_enc_is_block_mode);
  62. PHP_FUNCTION(mcrypt_enc_get_block_size);
  63. PHP_FUNCTION(mcrypt_enc_get_key_size);
  64. PHP_FUNCTION(mcrypt_enc_get_supported_key_sizes);
  65. PHP_FUNCTION(mcrypt_enc_get_iv_size);
  66. PHP_FUNCTION(mcrypt_enc_get_algorithms_name);
  67. PHP_FUNCTION(mcrypt_enc_get_modes_name);
  68. PHP_FUNCTION(mcrypt_module_self_test);
  69. PHP_FUNCTION(mcrypt_module_is_block_algorithm_mode);
  70. PHP_FUNCTION(mcrypt_module_is_block_algorithm);
  71. PHP_FUNCTION(mcrypt_module_is_block_mode);
  72. PHP_FUNCTION(mcrypt_module_get_algo_block_size);
  73. PHP_FUNCTION(mcrypt_module_get_algo_key_size);
  74. PHP_FUNCTION(mcrypt_module_get_supported_key_sizes);
  75. PHP_FUNCTION(mcrypt_module_close);
  76. ZEND_BEGIN_MODULE_GLOBALS(mcrypt)
  77. int le_h;
  78. char *modes_dir;
  79. char *algorithms_dir;
  80. ZEND_END_MODULE_GLOBALS(mcrypt)
  81. #ifdef ZTS
  82. # define MCG(v) TSRMG(mcrypt_globals_id, zend_mcrypt_globals *, v)
  83. #else
  84. # define MCG(v) (mcrypt_globals.v)
  85. #endif
  86. #endif
  87. #else
  88. #define mcrypt_module_ptr NULL
  89. #endif
  90. #define phpext_mcrypt_ptr mcrypt_module_ptr
  91. #endif