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.

94 lines
3.2 KiB

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 5 |
  4. +----------------------------------------------------------------------+
  5. | Copyright (c) 1997-2009 The PHP Group |
  6. +----------------------------------------------------------------------+
  7. | This source file is subject to version 3.01 of the PHP license, |
  8. | that is bundled with this package in the file LICENSE, and is |
  9. | available through the world-wide-web at the following url: |
  10. | http://www.php.net/license/3_01.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 <derick@derickrethans.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. extern zend_module_entry mcrypt_module_entry;
  27. #define mcrypt_module_ptr &mcrypt_module_entry
  28. /* Functions for both old and new API */
  29. PHP_FUNCTION(mcrypt_ecb);
  30. PHP_FUNCTION(mcrypt_cbc);
  31. PHP_FUNCTION(mcrypt_cfb);
  32. PHP_FUNCTION(mcrypt_ofb);
  33. PHP_FUNCTION(mcrypt_get_cipher_name);
  34. PHP_FUNCTION(mcrypt_get_block_size);
  35. PHP_FUNCTION(mcrypt_get_key_size);
  36. PHP_FUNCTION(mcrypt_create_iv);
  37. /* Support functions for old API */
  38. PHP_FUNCTION(mcrypt_list_algorithms);
  39. PHP_FUNCTION(mcrypt_list_modes);
  40. PHP_FUNCTION(mcrypt_get_iv_size);
  41. PHP_FUNCTION(mcrypt_encrypt);
  42. PHP_FUNCTION(mcrypt_decrypt);
  43. /* Functions for new API */
  44. PHP_FUNCTION(mcrypt_module_open);
  45. PHP_FUNCTION(mcrypt_generic_init);
  46. PHP_FUNCTION(mcrypt_generic);
  47. PHP_FUNCTION(mdecrypt_generic);
  48. PHP_FUNCTION(mcrypt_generic_deinit);
  49. PHP_FUNCTION(mcrypt_enc_self_test);
  50. PHP_FUNCTION(mcrypt_enc_is_block_algorithm_mode);
  51. PHP_FUNCTION(mcrypt_enc_is_block_algorithm);
  52. PHP_FUNCTION(mcrypt_enc_is_block_mode);
  53. PHP_FUNCTION(mcrypt_enc_get_block_size);
  54. PHP_FUNCTION(mcrypt_enc_get_key_size);
  55. PHP_FUNCTION(mcrypt_enc_get_supported_key_sizes);
  56. PHP_FUNCTION(mcrypt_enc_get_iv_size);
  57. PHP_FUNCTION(mcrypt_enc_get_algorithms_name);
  58. PHP_FUNCTION(mcrypt_enc_get_modes_name);
  59. PHP_FUNCTION(mcrypt_module_self_test);
  60. PHP_FUNCTION(mcrypt_module_is_block_algorithm_mode);
  61. PHP_FUNCTION(mcrypt_module_is_block_algorithm);
  62. PHP_FUNCTION(mcrypt_module_is_block_mode);
  63. PHP_FUNCTION(mcrypt_module_get_algo_block_size);
  64. PHP_FUNCTION(mcrypt_module_get_algo_key_size);
  65. PHP_FUNCTION(mcrypt_module_get_supported_key_sizes);
  66. PHP_FUNCTION(mcrypt_module_close);
  67. ZEND_BEGIN_MODULE_GLOBALS(mcrypt)
  68. int le_h;
  69. char *modes_dir;
  70. char *algorithms_dir;
  71. ZEND_END_MODULE_GLOBALS(mcrypt)
  72. #ifdef ZTS
  73. # define MCG(v) TSRMG(mcrypt_globals_id, zend_mcrypt_globals *, v)
  74. #else
  75. # define MCG(v) (mcrypt_globals.v)
  76. #endif
  77. #else
  78. #define mcrypt_module_ptr NULL
  79. #endif
  80. #define phpext_mcrypt_ptr mcrypt_module_ptr
  81. #endif