xref: /PHP-8.2/ext/hash/hash_arginfo.h (revision bd03c034)
1 /* This is a generated file, edit the .stub.php file instead.
2  * Stub hash: f4531ebc6817042a2729c3dd1502631656c29f05 */
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_BOOL, 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 
137 ZEND_FUNCTION(hash);
138 ZEND_FUNCTION(hash_file);
139 ZEND_FUNCTION(hash_hmac);
140 ZEND_FUNCTION(hash_hmac_file);
141 ZEND_FUNCTION(hash_init);
142 ZEND_FUNCTION(hash_update);
143 ZEND_FUNCTION(hash_update_stream);
144 ZEND_FUNCTION(hash_update_file);
145 ZEND_FUNCTION(hash_final);
146 ZEND_FUNCTION(hash_copy);
147 ZEND_FUNCTION(hash_algos);
148 ZEND_FUNCTION(hash_hmac_algos);
149 ZEND_FUNCTION(hash_pbkdf2);
150 ZEND_FUNCTION(hash_equals);
151 ZEND_FUNCTION(hash_hkdf);
152 #if defined(PHP_MHASH_BC)
153 ZEND_FUNCTION(mhash_get_block_size);
154 #endif
155 #if defined(PHP_MHASH_BC)
156 ZEND_FUNCTION(mhash_get_hash_name);
157 #endif
158 #if defined(PHP_MHASH_BC)
159 ZEND_FUNCTION(mhash_keygen_s2k);
160 #endif
161 #if defined(PHP_MHASH_BC)
162 ZEND_FUNCTION(mhash_count);
163 #endif
164 #if defined(PHP_MHASH_BC)
165 ZEND_FUNCTION(mhash);
166 #endif
167 ZEND_METHOD(HashContext, __construct);
168 ZEND_METHOD(HashContext, __serialize);
169 ZEND_METHOD(HashContext, __unserialize);
170 
171 
172 static const zend_function_entry ext_functions[] = {
173 	ZEND_FE(hash, arginfo_hash)
174 	ZEND_FE(hash_file, arginfo_hash_file)
175 	ZEND_FE(hash_hmac, arginfo_hash_hmac)
176 	ZEND_FE(hash_hmac_file, arginfo_hash_hmac_file)
177 	ZEND_FE(hash_init, arginfo_hash_init)
178 	ZEND_FE(hash_update, arginfo_hash_update)
179 	ZEND_FE(hash_update_stream, arginfo_hash_update_stream)
180 	ZEND_FE(hash_update_file, arginfo_hash_update_file)
181 	ZEND_FE(hash_final, arginfo_hash_final)
182 	ZEND_FE(hash_copy, arginfo_hash_copy)
183 	ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(hash_algos, arginfo_hash_algos)
184 	ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE(hash_hmac_algos, arginfo_hash_hmac_algos)
185 	ZEND_FE(hash_pbkdf2, arginfo_hash_pbkdf2)
186 	ZEND_FE(hash_equals, arginfo_hash_equals)
187 	ZEND_FE(hash_hkdf, arginfo_hash_hkdf)
188 #if defined(PHP_MHASH_BC)
189 	ZEND_DEP_FE(mhash_get_block_size, arginfo_mhash_get_block_size)
190 #endif
191 #if defined(PHP_MHASH_BC)
192 	ZEND_DEP_FE(mhash_get_hash_name, arginfo_mhash_get_hash_name)
193 #endif
194 #if defined(PHP_MHASH_BC)
195 	ZEND_DEP_FE(mhash_keygen_s2k, arginfo_mhash_keygen_s2k)
196 #endif
197 #if defined(PHP_MHASH_BC)
198 	ZEND_DEP_FE(mhash_count, arginfo_mhash_count)
199 #endif
200 #if defined(PHP_MHASH_BC)
201 	ZEND_DEP_FE(mhash, arginfo_mhash)
202 #endif
203 	ZEND_FE_END
204 };
205 
206 
207 static const zend_function_entry class_HashContext_methods[] = {
208 	ZEND_ME(HashContext, __construct, arginfo_class_HashContext___construct, ZEND_ACC_PRIVATE)
209 	ZEND_ME(HashContext, __serialize, arginfo_class_HashContext___serialize, ZEND_ACC_PUBLIC)
210 	ZEND_ME(HashContext, __unserialize, arginfo_class_HashContext___unserialize, ZEND_ACC_PUBLIC)
211 	ZEND_FE_END
212 };
213 
register_hash_symbols(int module_number)214 static void register_hash_symbols(int module_number)
215 {
216 	REGISTER_LONG_CONSTANT("HASH_HMAC", PHP_HASH_HMAC, CONST_PERSISTENT);
217 
218 
219 	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);
220 
221 	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);
222 
223 	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);
224 
225 	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);
226 
227 	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);
228 
229 	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);
230 
231 	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);
232 }
233 
register_class_HashContext(void)234 static zend_class_entry *register_class_HashContext(void)
235 {
236 	zend_class_entry ce, *class_entry;
237 
238 	INIT_CLASS_ENTRY(ce, "HashContext", class_HashContext_methods);
239 	class_entry = zend_register_internal_class_ex(&ce, NULL);
240 	class_entry->ce_flags |= ZEND_ACC_FINAL;
241 
242 	return class_entry;
243 }
244