1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 #ifndef PHP_MCRYPT_H
22 #define PHP_MCRYPT_H
23
24 #if HAVE_LIBMCRYPT
25
26 #ifdef ZTS
27 #include "TSRM.h"
28 #endif
29
30 extern zend_module_entry mcrypt_module_entry;
31 #define mcrypt_module_ptr &mcrypt_module_entry
32
33
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
43
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
50
51 PHP_FUNCTION(mcrypt_module_open);
52 PHP_FUNCTION(mcrypt_generic_init);
53 PHP_FUNCTION(mcrypt_generic);
54 PHP_FUNCTION(mdecrypt_generic);
55 PHP_FUNCTION(mcrypt_generic_deinit);
56
57 PHP_FUNCTION(mcrypt_enc_self_test);
58 PHP_FUNCTION(mcrypt_enc_is_block_algorithm_mode);
59 PHP_FUNCTION(mcrypt_enc_is_block_algorithm);
60 PHP_FUNCTION(mcrypt_enc_is_block_mode);
61 PHP_FUNCTION(mcrypt_enc_get_block_size);
62 PHP_FUNCTION(mcrypt_enc_get_key_size);
63 PHP_FUNCTION(mcrypt_enc_get_supported_key_sizes);
64 PHP_FUNCTION(mcrypt_enc_get_iv_size);
65 PHP_FUNCTION(mcrypt_enc_get_algorithms_name);
66 PHP_FUNCTION(mcrypt_enc_get_modes_name);
67 PHP_FUNCTION(mcrypt_module_self_test);
68 PHP_FUNCTION(mcrypt_module_is_block_algorithm_mode);
69 PHP_FUNCTION(mcrypt_module_is_block_algorithm);
70 PHP_FUNCTION(mcrypt_module_is_block_mode);
71 PHP_FUNCTION(mcrypt_module_get_algo_block_size);
72 PHP_FUNCTION(mcrypt_module_get_algo_key_size);
73 PHP_FUNCTION(mcrypt_module_get_supported_key_sizes);
74 PHP_FUNCTION(mcrypt_module_close);
75
76 ZEND_BEGIN_MODULE_GLOBALS(mcrypt)
77 int le_h;
78 char *modes_dir;
79 char *algorithms_dir;
80 int fd[2];
81 ZEND_END_MODULE_GLOBALS(mcrypt)
82
83 #ifdef ZTS
84 # define MCG(v) TSRMG(mcrypt_globals_id, zend_mcrypt_globals *, v)
85 #else
86 # define MCG(v) (mcrypt_globals.v)
87 #endif
88
89 #else
90 #define mcrypt_module_ptr NULL
91 #endif
92
93 #define phpext_mcrypt_ptr mcrypt_module_ptr
94
95 #endif