xref: /php-src/ext/hash/hash_arginfo.h (revision a47849de)
1 /* This is a generated file, edit the .stub.php file instead.
2  * Stub hash: 9c0f01839a287d394b78b0dfd37b278a59d1b366 */
3 
4 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_hash, 0, 2, IS_STRING, 0)
5 	ZEND_ARG_TYPE_INFO(0, algo, IS_STRING, 0)
6 	ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
7 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, binary, _IS_BOOL, 0, "false")
8 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]")
9 ZEND_END_ARG_INFO()
10 
11 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_hash_file, 0, 2, MAY_BE_STRING|MAY_BE_FALSE)
12 	ZEND_ARG_TYPE_INFO(0, algo, IS_STRING, 0)
13 	ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
14 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, binary, _IS_BOOL, 0, "false")
15 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]")
16 ZEND_END_ARG_INFO()
17 
18 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_hash_hmac, 0, 3, IS_STRING, 0)
19 	ZEND_ARG_TYPE_INFO(0, algo, IS_STRING, 0)
20 	ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
21 	ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0)
22 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, binary, _IS_BOOL, 0, "false")
23 ZEND_END_ARG_INFO()
24 
25 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_hash_hmac_file, 0, 3, MAY_BE_STRING|MAY_BE_FALSE)
26 	ZEND_ARG_TYPE_INFO(0, algo, IS_STRING, 0)
27 	ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
28 	ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0)
29 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, binary, _IS_BOOL, 0, "false")
30 ZEND_END_ARG_INFO()
31 
32 ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_hash_init, 0, 1, HashContext, 0)
33 	ZEND_ARG_TYPE_INFO(0, algo, IS_STRING, 0)
34 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "0")
35 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, key, IS_STRING, 0, "\"\"")
36 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]")
37 ZEND_END_ARG_INFO()
38 
39 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_hash_update, 0, 2, IS_TRUE, 0)
40 	ZEND_ARG_OBJ_INFO(0, context, HashContext, 0)
41 	ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
42 ZEND_END_ARG_INFO()
43 
44 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_hash_update_stream, 0, 2, IS_LONG, 0)
45 	ZEND_ARG_OBJ_INFO(0, context, HashContext, 0)
46 	ZEND_ARG_INFO(0, stream)
47 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 0, "-1")
48 ZEND_END_ARG_INFO()
49 
50 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_hash_update_file, 0, 2, _IS_BOOL, 0)
51 	ZEND_ARG_OBJ_INFO(0, context, HashContext, 0)
52 	ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
53 	ZEND_ARG_INFO_WITH_DEFAULT_VALUE(0, stream_context, "null")
54 ZEND_END_ARG_INFO()
55 
56 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_hash_final, 0, 1, IS_STRING, 0)
57 	ZEND_ARG_OBJ_INFO(0, context, HashContext, 0)
58 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, binary, _IS_BOOL, 0, "false")
59 ZEND_END_ARG_INFO()
60 
61 ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_hash_copy, 0, 1, HashContext, 0)
62 	ZEND_ARG_OBJ_INFO(0, context, HashContext, 0)
63 ZEND_END_ARG_INFO()
64 
65 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_hash_algos, 0, 0, IS_ARRAY, 0)
66 ZEND_END_ARG_INFO()
67 
68 #define arginfo_hash_hmac_algos arginfo_hash_algos
69 
70 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_hash_pbkdf2, 0, 4, IS_STRING, 0)
71 	ZEND_ARG_TYPE_INFO(0, algo, IS_STRING, 0)
72 	ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0)
73 	ZEND_ARG_TYPE_INFO(0, salt, IS_STRING, 0)
74 	ZEND_ARG_TYPE_INFO(0, iterations, IS_LONG, 0)
75 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 0, "0")
76 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, binary, _IS_BOOL, 0, "false")
77 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]")
78 ZEND_END_ARG_INFO()
79 
80 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_hash_equals, 0, 2, _IS_BOOL, 0)
81 	ZEND_ARG_TYPE_INFO(0, known_string, IS_STRING, 0)
82 	ZEND_ARG_TYPE_INFO(0, user_string, IS_STRING, 0)
83 ZEND_END_ARG_INFO()
84 
85 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_hash_hkdf, 0, 2, IS_STRING, 0)
86 	ZEND_ARG_TYPE_INFO(0, algo, IS_STRING, 0)
87 	ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0)
88 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, length, IS_LONG, 0, "0")
89 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, info, IS_STRING, 0, "\"\"")
90 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, salt, IS_STRING, 0, "\"\"")
91 ZEND_END_ARG_INFO()
92 
93 #if defined(PHP_MHASH_BC)
94 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mhash_get_block_size, 0, 1, MAY_BE_LONG|MAY_BE_FALSE)
95 	ZEND_ARG_TYPE_INFO(0, algo, IS_LONG, 0)
96 ZEND_END_ARG_INFO()
97 #endif
98 
99 #if defined(PHP_MHASH_BC)
100 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mhash_get_hash_name, 0, 1, MAY_BE_STRING|MAY_BE_FALSE)
101 	ZEND_ARG_TYPE_INFO(0, algo, IS_LONG, 0)
102 ZEND_END_ARG_INFO()
103 #endif
104 
105 #if defined(PHP_MHASH_BC)
106 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mhash_keygen_s2k, 0, 4, MAY_BE_STRING|MAY_BE_FALSE)
107 	ZEND_ARG_TYPE_INFO(0, algo, IS_LONG, 0)
108 	ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0)
109 	ZEND_ARG_TYPE_INFO(0, salt, IS_STRING, 0)
110 	ZEND_ARG_TYPE_INFO(0, length, IS_LONG, 0)
111 ZEND_END_ARG_INFO()
112 #endif
113 
114 #if defined(PHP_MHASH_BC)
115 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mhash_count, 0, 0, IS_LONG, 0)
116 ZEND_END_ARG_INFO()
117 #endif
118 
119 #if defined(PHP_MHASH_BC)
120 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mhash, 0, 2, MAY_BE_STRING|MAY_BE_FALSE)
121 	ZEND_ARG_TYPE_INFO(0, algo, IS_LONG, 0)
122 	ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
123 	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, key, IS_STRING, 1, "null")
124 ZEND_END_ARG_INFO()
125 #endif
126 
127 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_HashContext___construct, 0, 0, 0)
128 ZEND_END_ARG_INFO()
129 
130 #define arginfo_class_HashContext___serialize arginfo_hash_algos
131 
132 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_HashContext___unserialize, 0, 1, IS_VOID, 0)
133 	ZEND_ARG_TYPE_INFO(0, data, IS_ARRAY, 0)
134 ZEND_END_ARG_INFO()
135 
136 ZEND_FUNCTION(hash);
137 ZEND_FUNCTION(hash_file);
138 ZEND_FUNCTION(hash_hmac);
139 ZEND_FUNCTION(hash_hmac_file);
140 ZEND_FUNCTION(hash_init);
141 ZEND_FUNCTION(hash_update);
142 ZEND_FUNCTION(hash_update_stream);
143 ZEND_FUNCTION(hash_update_file);
144 ZEND_FUNCTION(hash_final);
145 ZEND_FUNCTION(hash_copy);
146 ZEND_FUNCTION(hash_algos);
147 ZEND_FUNCTION(hash_hmac_algos);
148 ZEND_FUNCTION(hash_pbkdf2);
149 ZEND_FUNCTION(hash_equals);
150 ZEND_FUNCTION(hash_hkdf);
151 #if defined(PHP_MHASH_BC)
152 ZEND_FUNCTION(mhash_get_block_size);
153 #endif
154 #if defined(PHP_MHASH_BC)
155 ZEND_FUNCTION(mhash_get_hash_name);
156 #endif
157 #if defined(PHP_MHASH_BC)
158 ZEND_FUNCTION(mhash_keygen_s2k);
159 #endif
160 #if defined(PHP_MHASH_BC)
161 ZEND_FUNCTION(mhash_count);
162 #endif
163 #if defined(PHP_MHASH_BC)
164 ZEND_FUNCTION(mhash);
165 #endif
166 ZEND_METHOD(HashContext, __construct);
167 ZEND_METHOD(HashContext, __serialize);
168 ZEND_METHOD(HashContext, __unserialize);
169 
170 static const zend_function_entry ext_functions[] = {
171 	ZEND_FE(hash, arginfo_hash)
172 	ZEND_FE(hash_file, arginfo_hash_file)
173 	ZEND_FE(hash_hmac, arginfo_hash_hmac)
174 	ZEND_FE(hash_hmac_file, arginfo_hash_hmac_file)
175 	ZEND_FE(hash_init, arginfo_hash_init)
176 	ZEND_FE(hash_update, arginfo_hash_update)
177 	ZEND_FE(hash_update_stream, arginfo_hash_update_stream)
178 	ZEND_FE(hash_update_file, arginfo_hash_update_file)
179 	ZEND_FE(hash_final, arginfo_hash_final)
180 	ZEND_FE(hash_copy, arginfo_hash_copy)
181 	ZEND_RAW_FENTRY("hash_algos", zif_hash_algos, arginfo_hash_algos, ZEND_ACC_COMPILE_TIME_EVAL, NULL, NULL)
182 	ZEND_RAW_FENTRY("hash_hmac_algos", zif_hash_hmac_algos, arginfo_hash_hmac_algos, ZEND_ACC_COMPILE_TIME_EVAL, NULL, NULL)
183 	ZEND_FE(hash_pbkdf2, arginfo_hash_pbkdf2)
184 	ZEND_FE(hash_equals, arginfo_hash_equals)
185 	ZEND_FE(hash_hkdf, arginfo_hash_hkdf)
186 #if defined(PHP_MHASH_BC)
187 	ZEND_RAW_FENTRY("mhash_get_block_size", zif_mhash_get_block_size, arginfo_mhash_get_block_size, ZEND_ACC_DEPRECATED, NULL, NULL)
188 #endif
189 #if defined(PHP_MHASH_BC)
190 	ZEND_RAW_FENTRY("mhash_get_hash_name", zif_mhash_get_hash_name, arginfo_mhash_get_hash_name, ZEND_ACC_DEPRECATED, NULL, NULL)
191 #endif
192 #if defined(PHP_MHASH_BC)
193 	ZEND_RAW_FENTRY("mhash_keygen_s2k", zif_mhash_keygen_s2k, arginfo_mhash_keygen_s2k, ZEND_ACC_DEPRECATED, NULL, NULL)
194 #endif
195 #if defined(PHP_MHASH_BC)
196 	ZEND_RAW_FENTRY("mhash_count", zif_mhash_count, arginfo_mhash_count, ZEND_ACC_DEPRECATED, NULL, NULL)
197 #endif
198 #if defined(PHP_MHASH_BC)
199 	ZEND_RAW_FENTRY("mhash", zif_mhash, arginfo_mhash, ZEND_ACC_DEPRECATED, NULL, NULL)
200 #endif
201 	ZEND_FE_END
202 };
203 
204 static const zend_function_entry class_HashContext_methods[] = {
205 	ZEND_ME(HashContext, __construct, arginfo_class_HashContext___construct, ZEND_ACC_PRIVATE)
206 	ZEND_ME(HashContext, __serialize, arginfo_class_HashContext___serialize, ZEND_ACC_PUBLIC)
207 	ZEND_ME(HashContext, __unserialize, arginfo_class_HashContext___unserialize, ZEND_ACC_PUBLIC)
208 	ZEND_FE_END
209 };
210 
register_hash_symbols(int module_number)211 static void register_hash_symbols(int module_number)
212 {
213 	REGISTER_LONG_CONSTANT("HASH_HMAC", PHP_HASH_HMAC, CONST_PERSISTENT);
214 
215 
216 	zend_add_parameter_attribute(zend_hash_str_find_ptr(CG(function_table), "hash_hmac", sizeof("hash_hmac") - 1), 2, ZSTR_KNOWN(ZEND_STR_SENSITIVEPARAMETER), 0);
217 
218 	zend_add_parameter_attribute(zend_hash_str_find_ptr(CG(function_table), "hash_hmac_file", sizeof("hash_hmac_file") - 1), 2, ZSTR_KNOWN(ZEND_STR_SENSITIVEPARAMETER), 0);
219 
220 	zend_add_parameter_attribute(zend_hash_str_find_ptr(CG(function_table), "hash_init", sizeof("hash_init") - 1), 2, ZSTR_KNOWN(ZEND_STR_SENSITIVEPARAMETER), 0);
221 
222 	zend_add_parameter_attribute(zend_hash_str_find_ptr(CG(function_table), "hash_pbkdf2", sizeof("hash_pbkdf2") - 1), 1, ZSTR_KNOWN(ZEND_STR_SENSITIVEPARAMETER), 0);
223 
224 	zend_add_parameter_attribute(zend_hash_str_find_ptr(CG(function_table), "hash_equals", sizeof("hash_equals") - 1), 0, ZSTR_KNOWN(ZEND_STR_SENSITIVEPARAMETER), 0);
225 
226 	zend_add_parameter_attribute(zend_hash_str_find_ptr(CG(function_table), "hash_equals", sizeof("hash_equals") - 1), 1, ZSTR_KNOWN(ZEND_STR_SENSITIVEPARAMETER), 0);
227 
228 	zend_add_parameter_attribute(zend_hash_str_find_ptr(CG(function_table), "hash_hkdf", sizeof("hash_hkdf") - 1), 1, ZSTR_KNOWN(ZEND_STR_SENSITIVEPARAMETER), 0);
229 }
230 
register_class_HashContext(void)231 static zend_class_entry *register_class_HashContext(void)
232 {
233 	zend_class_entry ce, *class_entry;
234 
235 	INIT_CLASS_ENTRY(ce, "HashContext", class_HashContext_methods);
236 	class_entry = zend_register_internal_class_ex(&ce, NULL);
237 	class_entry->ce_flags |= ZEND_ACC_FINAL;
238 
239 	return class_entry;
240 }
241