Fix heredoc/nowdoc bugs with large docs, docs crossing buffer boundaries
[hiphop-php.git] / hphp / idl / mcrypt.idl.php
blob93c4f178f898b6580a130452c96e2bfbe4ac26a3
1 <?php
2 /**
3 * Automatically generated by running "php schema.php mcrypt".
5 * You may modify the file, but re-running schema.php against this file will
6 * standardize the format without losing your schema changes. It does lose
7 * any changes that are not part of schema. Use "note" field to comment on
8 * schema itself, and "note" fields are not used in any code generation but
9 * only staying within this file.
11 ///////////////////////////////////////////////////////////////////////////////
12 // Preamble: C++ code inserted at beginning of ext_{name}.h
14 DefinePreamble(<<<CPP
16 CPP
19 ///////////////////////////////////////////////////////////////////////////////
20 // Constants
22 // array (
23 // 'name' => name of the constant
24 // 'type' => type of the constant
25 // 'note' => additional note about this constant's schema
26 // )
29 ///////////////////////////////////////////////////////////////////////////////
30 // Functions
32 // array (
33 // 'name' => name of the function
34 // 'desc' => description of the function's purpose
35 // 'flags' => attributes of the function, see base.php for possible values
36 // 'opt' => optimization callback function's name for compiler
37 // 'note' => additional note about this function's schema
38 // 'return' =>
39 // array (
40 // 'type' => return type, use Reference for ref return
41 // 'desc' => description of the return value
42 // )
43 // 'args' => arguments
44 // array (
45 // 'name' => name of the argument
46 // 'type' => type of the argument, use Reference for output parameter
47 // 'value' => default value of the argument
48 // 'desc' => description of the argument
49 // )
50 // )
52 DefineFunction(
53 array(
54 'name' => "mcrypt_module_open",
55 'desc' => "This function opens the module of the algorithm and the mode to be used. The name of the algorithm is specified in algorithm, e.g. \"twofish\" or is one of the MCRYPT_ciphername constants. The module is closed by calling mcrypt_module_close().",
56 'flags' => HasDocComment,
57 'return' => array(
58 'type' => Variant,
59 'desc' => "Normally it returns an encryption descriptor, or FALSE on error.",
61 'args' => array(
62 array(
63 'name' => "algorithm",
64 'type' => String,
65 'desc' => "The algorithm to be used.",
67 array(
68 'name' => "algorithm_directory",
69 'type' => String,
70 'desc' => "The algorithm_directory and mode_directory are used to locate the encryption modules. When you supply a directory name, it is used. When you set one of these to the empty string (\"\"), the value set by the mcrypt.algorithms_dir or mcrypt.modes_dir ini-directive is used. When these are not set, the default directories that are used are the ones that were compiled in into libmcrypt (usually /usr/local/lib/libmcrypt).",
72 array(
73 'name' => "mode",
74 'type' => String,
75 'desc' => "The mode to be used.",
77 array(
78 'name' => "mode_directory",
79 'type' => String,
82 'taint_observer' => false,
83 ));
85 DefineFunction(
86 array(
87 'name' => "mcrypt_module_close",
88 'desc' => "Closes the specified encryption handle.",
89 'flags' => HasDocComment,
90 'return' => array(
91 'type' => Boolean,
92 'desc' => "Returns TRUE on success or FALSE on failure.",
94 'args' => array(
95 array(
96 'name' => "td",
97 'type' => Resource,
98 'desc' => "The encryption descriptor.",
101 'taint_observer' => false,
104 DefineFunction(
105 array(
106 'name' => "mcrypt_list_algorithms",
107 'desc' => "Gets the list of all supported algorithms in the lib_dir parameter.",
108 'flags' => HasDocComment,
109 'return' => array(
110 'type' => StringVec,
111 'desc' => "Returns an array with all the supported algorithms.",
113 'args' => array(
114 array(
115 'name' => "lib_dir",
116 'type' => String,
117 'value' => "null_string",
118 'desc' => "Specifies the directory where all algorithms are located. If not specifies, the value of the mcrypt.algorithms_dir php.ini directive is used.",
121 'taint_observer' => false,
124 DefineFunction(
125 array(
126 'name' => "mcrypt_list_modes",
127 'desc' => "Gets the list of all supported modes in the lib_dir parameter.",
128 'flags' => HasDocComment,
129 'return' => array(
130 'type' => StringVec,
131 'desc' => "Returns an array with all the supported modes.",
133 'args' => array(
134 array(
135 'name' => "lib_dir",
136 'type' => String,
137 'value' => "null_string",
138 'desc' => "Specifies the directory where all modes are located. If not specifies, the value of the mcrypt.modes_dir php.ini directive is used.",
141 'taint_observer' => false,
144 DefineFunction(
145 array(
146 'name' => "mcrypt_module_get_algo_block_size",
147 'desc' => "Gets the blocksize of the specified algorithm.",
148 'flags' => HasDocComment,
149 'return' => array(
150 'type' => Int64,
151 'desc' => "Returns the block size of the algorithm specified in bytes.",
153 'args' => array(
154 array(
155 'name' => "algorithm",
156 'type' => String,
157 'desc' => "The algorithm name.",
159 array(
160 'name' => "lib_dir",
161 'type' => String,
162 'value' => "null_string",
163 'desc' => "This optional parameter can contain the location where the mode module is on the system.",
166 'taint_observer' => false,
169 DefineFunction(
170 array(
171 'name' => "mcrypt_module_get_algo_key_size",
172 'desc' => "Gets the maximum supported keysize of the opened mode.",
173 'flags' => HasDocComment,
174 'return' => array(
175 'type' => Int64,
176 'desc' => "This function returns the maximum supported key size of the algorithm specified in bytes.",
178 'args' => array(
179 array(
180 'name' => "algorithm",
181 'type' => String,
182 'desc' => "The algorithm name.",
184 array(
185 'name' => "lib_dir",
186 'type' => String,
187 'value' => "null_string",
188 'desc' => "This optional parameter can contain the location where the mode module is on the system.",
191 'taint_observer' => false,
194 DefineFunction(
195 array(
196 'name' => "mcrypt_module_get_supported_key_sizes",
197 'desc' => "Returns an array with the key sizes supported by the specified algorithm. If it returns an empty array then all key sizes between 1 and mcrypt_module_get_algo_key_size() are supported by the algorithm.",
198 'flags' => HasDocComment,
199 'return' => array(
200 'type' => Int64Vec,
201 'desc' => "Returns an array with the key sizes supported by the specified algorithm. If it returns an empty array then all key sizes between 1 and mcrypt_module_get_algo_key_size() are supported by the algorithm.",
203 'args' => array(
204 array(
205 'name' => "algorithm",
206 'type' => String,
207 'desc' => "The algorithm to used.",
209 array(
210 'name' => "lib_dir",
211 'type' => String,
212 'value' => "null_string",
213 'desc' => "The optional lib_dir parameter can contain the location of where the algorithm module is on the system.",
216 'taint_observer' => false,
219 DefineFunction(
220 array(
221 'name' => "mcrypt_module_is_block_algorithm_mode",
222 'desc' => "This function returns TRUE if the mode is for use with block algorithms, otherwise it returns FALSE. (e.g. FALSE for stream, and TRUE for cbc, cfb, ofb).",
223 'flags' => HasDocComment,
224 'return' => array(
225 'type' => Boolean,
226 'desc' => "This function returns TRUE if the mode is for use with block algorithms, otherwise it returns FALSE. (e.g. FALSE for stream, and TRUE for cbc, cfb, ofb).",
228 'args' => array(
229 array(
230 'name' => "mode",
231 'type' => String,
232 'desc' => "The mode to check.",
234 array(
235 'name' => "lib_dir",
236 'type' => String,
237 'value' => "null_string",
238 'desc' => "The optional lib_dir parameter can contain the location of where the algorithm module is on the system.",
241 'taint_observer' => false,
244 DefineFunction(
245 array(
246 'name' => "mcrypt_module_is_block_algorithm",
247 'desc' => "This function returns TRUE if the specified algorithm is a block algorithm, or FALSE is it is a stream algorithm.",
248 'flags' => HasDocComment,
249 'return' => array(
250 'type' => Boolean,
251 'desc' => "This function returns TRUE if the specified algorithm is a block algorithm, or FALSE is it is a stream algorithm.",
253 'args' => array(
254 array(
255 'name' => "algorithm",
256 'type' => String,
257 'desc' => "The algorithm to check.",
259 array(
260 'name' => "lib_dir",
261 'type' => String,
262 'value' => "null_string",
263 'desc' => "The optional lib_dir parameter can contain the location of where the algorithm module is on the system.",
266 'taint_observer' => false,
269 DefineFunction(
270 array(
271 'name' => "mcrypt_module_is_block_mode",
272 'desc' => "This function returns TRUE if the mode outputs blocks of bytes or FALSE if it outputs just bytes. (e.g. TRUE for cbc and ecb, and FALSE for cfb and stream).",
273 'flags' => HasDocComment,
274 'return' => array(
275 'type' => Boolean,
276 'desc' => "This function returns TRUE if the mode outputs blocks of bytes or FALSE if it outputs just bytes. (e.g. TRUE for cbc and ecb, and FALSE for cfb and stream).",
278 'args' => array(
279 array(
280 'name' => "mode",
281 'type' => String,
282 'desc' => "The mode to check.",
284 array(
285 'name' => "lib_dir",
286 'type' => String,
287 'value' => "null_string",
288 'desc' => "The optional lib_dir parameter can contain the location of where the algorithm module is on the system.",
291 'taint_observer' => false,
294 DefineFunction(
295 array(
296 'name' => "mcrypt_module_self_test",
297 'desc' => "This function runs the self test on the algorithm specified.",
298 'flags' => HasDocComment,
299 'return' => array(
300 'type' => Boolean,
301 'desc' => "The function returns TRUE if the self test succeeds, or FALSE when if fails.",
303 'args' => array(
304 array(
305 'name' => "algorithm",
306 'type' => String,
307 'desc' => "The algorithm to test.",
309 array(
310 'name' => "lib_dir",
311 'type' => String,
312 'value' => "null_string",
313 'desc' => "The optional lib_dir parameter can contain the location of where the algorithm module is on the system.",
316 'taint_observer' => false,
319 DefineFunction(
320 array(
321 'name' => "mcrypt_create_iv",
322 'desc' => "Create an initialization vector (IV) from a random source.\n\nThe IV is only meant to give an alternative seed to the encryption routines. This IV does not need to be secret at all, though it can be desirable. You even can send it along with your ciphertext without losing security.",
323 'flags' => HasDocComment,
324 'return' => array(
325 'type' => Variant,
326 'desc' => "Returns the initialization vector, or FALSE on error.",
328 'args' => array(
329 array(
330 'name' => "size",
331 'type' => Int32,
332 'desc' => "Determines the size of the IV, parameter source (defaults to random value) specifies the source of the IV.",
334 array(
335 'name' => "source",
336 'type' => Int32,
337 'value' => "0",
338 'desc' => "The source can be MCRYPT_RAND (system random number generator), MCRYPT_DEV_RANDOM (read data from /dev/random) and MCRYPT_DEV_URANDOM (read data from /dev/urandom). Prior to 5.3.0, MCRYPT_RAND was the only one supported on Windows.",
341 'taint_observer' => false,
344 DefineFunction(
345 array(
346 'name' => "mcrypt_encrypt",
347 'desc' => "Encrypts the data and returns it.",
348 'flags' => HasDocComment,
349 'return' => array(
350 'type' => Variant,
351 'desc' => "Returns the encrypted data, as a string.",
353 'args' => array(
354 array(
355 'name' => "cipher",
356 'type' => String,
357 'desc' => "One of the MCRYPT_ciphername constants of the name of the algorithm as string.",
359 array(
360 'name' => "key",
361 'type' => String,
362 'desc' => "The key with which the data will be encrypted. If it's smaller that the required keysize, it is padded with '\\0'. It is better not to use ASCII strings for keys.\n\nIt is recommended to use the mhash functions to create a key from a string.",
364 array(
365 'name' => "data",
366 'type' => String,
367 'desc' => "The data that will be encrypted with the given cipher and mode. If the size of the data is not n * blocksize, the data will be padded with '\\0'.\n\nThe returned crypttext can be larger that the size of the data that is given by data.",
369 array(
370 'name' => "mode",
371 'type' => String,
372 'desc' => "One of the MCRYPT_MODE_modename constants of one of \"ecb\", \"cbc\", \"cfb\", \"ofb\", \"nofb\" or \"stream\".",
374 array(
375 'name' => "iv",
376 'type' => String,
377 'value' => "null_string",
378 'desc' => "Used for the initialisation in CBC, CFB, OFB modes, and in some algorithms in STREAM mode. If you do not supply an IV, while it is needed for an algorithm, the function issues a warning and uses an IV with all bytes set to '\\0'.",
381 'taint_observer' => array(
382 'set_mask' => "TAINT_BIT_MUTATED",
383 'clear_mask' => "TAINT_BIT_NONE",
387 DefineFunction(
388 array(
389 'name' => "mcrypt_decrypt",
390 'desc' => "Decrypts the data and returns the unencrypted data.",
391 'flags' => HasDocComment,
392 'return' => array(
393 'type' => Variant,
394 'desc' => "Returns the decrypted data as a string.",
396 'args' => array(
397 array(
398 'name' => "cipher",
399 'type' => String,
400 'desc' => "cipher is one of the MCRYPT_ciphername constants of the name of the algorithm as string.",
402 array(
403 'name' => "key",
404 'type' => String,
405 'desc' => "key is the key with which the data is encrypted. If it's smaller that the required keysize, it is padded with '\\0'.",
407 array(
408 'name' => "data",
409 'type' => String,
410 'desc' => "data is the data that will be decrypted with the given cipher and mode. If the size of the data is not n * blocksize, the data will be padded with '\\0'.",
412 array(
413 'name' => "mode",
414 'type' => String,
415 'desc' => "mode is one of the MCRYPT_MODE_modename constants of one of \"ecb\", \"cbc\", \"cfb\", \"ofb\", \"nofb\" or \"stream\".",
417 array(
418 'name' => "iv",
419 'type' => String,
420 'value' => "null_string",
421 'desc' => "The iv parameter is used for the initialisation in CBC, CFB, OFB modes, and in some algorithms in STREAM mode. If you do not supply an IV, while it is needed for an algorithm, the function issues a warning and uses an IV with all bytes set to '\\0'.",
424 'taint_observer' => array(
425 'set_mask' => "TAINT_BIT_MUTATED",
426 'clear_mask' => "TAINT_BIT_NONE",
430 DefineFunction(
431 array(
432 'name' => "mcrypt_cbc",
433 'flags' => HasDocComment,
434 'return' => array(
435 'type' => Variant,
437 'args' => array(
438 array(
439 'name' => "cipher",
440 'type' => String,
442 array(
443 'name' => "key",
444 'type' => String,
446 array(
447 'name' => "data",
448 'type' => String,
450 array(
451 'name' => "mode",
452 'type' => Int32,
454 array(
455 'name' => "iv",
456 'type' => String,
457 'value' => "null_string",
460 'taint_observer' => array(
461 'set_mask' => "TAINT_BIT_MUTATED",
462 'clear_mask' => "TAINT_BIT_NONE",
466 DefineFunction(
467 array(
468 'name' => "mcrypt_cfb",
469 'flags' => HasDocComment,
470 'return' => array(
471 'type' => Variant,
473 'args' => array(
474 array(
475 'name' => "cipher",
476 'type' => String,
478 array(
479 'name' => "key",
480 'type' => String,
482 array(
483 'name' => "data",
484 'type' => String,
486 array(
487 'name' => "mode",
488 'type' => Int32,
490 array(
491 'name' => "iv",
492 'type' => String,
493 'value' => "null_string",
496 'taint_observer' => array(
497 'set_mask' => "TAINT_BIT_MUTATED",
498 'clear_mask' => "TAINT_BIT_NONE",
502 DefineFunction(
503 array(
504 'name' => "mcrypt_ecb",
505 'flags' => HasDocComment,
506 'return' => array(
507 'type' => Variant,
509 'args' => array(
510 array(
511 'name' => "cipher",
512 'type' => String,
514 array(
515 'name' => "key",
516 'type' => String,
518 array(
519 'name' => "data",
520 'type' => String,
522 array(
523 'name' => "mode",
524 'type' => Int32,
526 array(
527 'name' => "iv",
528 'type' => String,
529 'value' => "null_string",
532 'taint_observer' => array(
533 'set_mask' => "TAINT_BIT_MUTATED",
534 'clear_mask' => "TAINT_BIT_NONE",
538 DefineFunction(
539 array(
540 'name' => "mcrypt_ofb",
541 'flags' => HasDocComment,
542 'return' => array(
543 'type' => Variant,
545 'args' => array(
546 array(
547 'name' => "cipher",
548 'type' => String,
550 array(
551 'name' => "key",
552 'type' => String,
554 array(
555 'name' => "data",
556 'type' => String,
558 array(
559 'name' => "mode",
560 'type' => Int32,
562 array(
563 'name' => "iv",
564 'type' => String,
565 'value' => "null_string",
568 'taint_observer' => array(
569 'set_mask' => "TAINT_BIT_MUTATED",
570 'clear_mask' => "TAINT_BIT_NONE",
574 DefineFunction(
575 array(
576 'name' => "mcrypt_get_block_size",
577 'desc' => "The first prototype is when linked against libmcrypt 2.2.x, the second when linked against libmcrypt 2.4.x or 2.5.x.\n\nmcrypt_get_block_size() is used to get the size of a block of the specified cipher (in combination with an encryption mode).\n\nIt is more useful to use the mcrypt_enc_get_block_size() function as this uses the resource returned by mcrypt_module_open().",
578 'flags' => HasDocComment,
579 'return' => array(
580 'type' => Variant,
581 'desc' => "Gets the block size, as an integer.",
583 'args' => array(
584 array(
585 'name' => "cipher",
586 'type' => String,
587 'desc' => "One of the MCRYPT_ciphername constants or the name of the algorithm as string.",
589 array(
590 'name' => "module",
591 'type' => String,
592 'value' => "null_string",
593 'desc' => "The module.",
596 'taint_observer' => false,
599 DefineFunction(
600 array(
601 'name' => "mcrypt_get_cipher_name",
602 'desc' => "mcrypt_get_cipher_name() is used to get the name of the specified cipher.\n\nmcrypt_get_cipher_name() takes the cipher number as an argument (libmcrypt 2.2.x) or takes the cipher name as an argument (libmcrypt 2.4.x or higher) and returns the name of the cipher or FALSE, if the cipher does not exist.",
603 'flags' => HasDocComment,
604 'return' => array(
605 'type' => Variant,
606 'desc' => "This function returns the name of the cipher or FALSE, if the cipher does not exist.",
608 'args' => array(
609 array(
610 'name' => "cipher",
611 'type' => String,
612 'desc' => "One of the MCRYPT_ciphername constants or the name of the algorithm as string.",
615 'taint_observer' => false,
618 DefineFunction(
619 array(
620 'name' => "mcrypt_get_iv_size",
621 'desc' => "Gets the size of the IV belonging to a specific cipher/mode combination.\n\nIt is more useful to use the mcrypt_enc_get_iv_size() function as this uses the resource returned by mcrypt_module_open().",
622 'flags' => HasDocComment,
623 'return' => array(
624 'type' => Variant,
625 'desc' => "Returns the size of the Initialisation Vector (IV) in bytes. On error the function returns FALSE. If the IV is ignored in the specified cipher/mode combination zero is returned.",
627 'args' => array(
628 array(
629 'name' => "cipher",
630 'type' => String,
631 'desc' => "One of the MCRYPT_ciphername constants of the name of the algorithm as string.",
633 array(
634 'name' => "mode",
635 'type' => String,
636 'desc' => "mode is one of the MCRYPT_MODE_modename constants or one of \"ecb\", \"cbc\", \"cfb\", \"ofb\", \"nofb\" or \"stream\". The IV is ignored in ECB mode as this mode does not require it. You will need to have the same IV (think: starting point) both at encryption and decryption stages, otherwise your encryption will fail.",
639 'taint_observer' => false,
642 DefineFunction(
643 array(
644 'name' => "mcrypt_get_key_size",
645 'flags' => HasDocComment,
646 'return' => array(
647 'type' => Int64,
649 'args' => array(
650 array(
651 'name' => "cipher",
652 'type' => String,
654 array(
655 'name' => "module",
656 'type' => String,
659 'taint_observer' => false,
662 DefineFunction(
663 array(
664 'name' => "mcrypt_enc_get_algorithms_name",
665 'desc' => "This function returns the name of the algorithm.",
666 'flags' => HasDocComment,
667 'return' => array(
668 'type' => String,
669 'desc' => "Returns the name of the opened algorithm as a string.",
671 'args' => array(
672 array(
673 'name' => "td",
674 'type' => Resource,
675 'desc' => "The encryption descriptor.",
678 'taint_observer' => false,
681 DefineFunction(
682 array(
683 'name' => "mcrypt_enc_get_block_size",
684 'desc' => "Gets the blocksize of the opened algorithm.",
685 'flags' => HasDocComment,
686 'return' => array(
687 'type' => Int64,
688 'desc' => "Returns the block size of the specified algorithm in bytes.",
690 'args' => array(
691 array(
692 'name' => "td",
693 'type' => Resource,
694 'desc' => "The encryption descriptor.",
697 'taint_observer' => false,
700 DefineFunction(
701 array(
702 'name' => "mcrypt_enc_get_iv_size",
703 'desc' => "This function returns the size of the IV of the algorithm specified by the encryption descriptor in bytes. An IV is used in cbc, cfb and ofb modes, and in some algorithms in stream mode.",
704 'flags' => HasDocComment,
705 'return' => array(
706 'type' => Int64,
707 'desc' => "Returns the size of the IV, or 0 if the IV is ignored in the algorithm.",
709 'args' => array(
710 array(
711 'name' => "td",
712 'type' => Resource,
713 'desc' => "The encryption descriptor.",
716 'taint_observer' => false,
719 DefineFunction(
720 array(
721 'name' => "mcrypt_enc_get_key_size",
722 'desc' => "Gets the maximum supported key size of the algorithm in bytes.",
723 'flags' => HasDocComment,
724 'return' => array(
725 'type' => Int64,
726 'desc' => "Returns the maximum supported key size of the algorithm in bytes.",
728 'args' => array(
729 array(
730 'name' => "td",
731 'type' => Resource,
732 'desc' => "The encryption descriptor.",
735 'taint_observer' => false,
738 DefineFunction(
739 array(
740 'name' => "mcrypt_enc_get_modes_name",
741 'desc' => "This function returns the name of the mode.",
742 'flags' => HasDocComment,
743 'return' => array(
744 'type' => String,
745 'desc' => "Returns the name as a string.",
747 'args' => array(
748 array(
749 'name' => "td",
750 'type' => Resource,
751 'desc' => "The encryption descriptor.",
754 'taint_observer' => false,
757 DefineFunction(
758 array(
759 'name' => "mcrypt_enc_get_supported_key_sizes",
760 'desc' => "Gets the supported key sizes of the opened algorithm.",
761 'flags' => HasDocComment,
762 'return' => array(
763 'type' => Int64Vec,
764 'desc' => "Returns an array with the key sizes supported by the algorithm specified by the encryption descriptor. If it returns an empty array then all key sizes between 1 and mcrypt_enc_get_key_size() are supported by the algorithm.",
766 'args' => array(
767 array(
768 'name' => "td",
769 'type' => Resource,
770 'desc' => "The encryption descriptor.",
773 'taint_observer' => false,
776 DefineFunction(
777 array(
778 'name' => "mcrypt_enc_is_block_algorithm_mode",
779 'desc' => "Tells whether the algorithm of the opened mode works on blocks (e.g. FALSE for stream, and TRUE for cbc, cfb, ofb)..",
780 'flags' => HasDocComment,
781 'return' => array(
782 'type' => Boolean,
783 'desc' => "Returns TRUE if the mode is for use with block algorithms, otherwise it returns FALSE.",
785 'args' => array(
786 array(
787 'name' => "td",
788 'type' => Resource,
789 'desc' => "The encryption descriptor.",
792 'taint_observer' => false,
795 DefineFunction(
796 array(
797 'name' => "mcrypt_enc_is_block_algorithm",
798 'desc' => "Tells whether the algorithm of the opened mode is a block algorithm.",
799 'flags' => HasDocComment,
800 'return' => array(
801 'type' => Boolean,
802 'desc' => "Returns TRUE if the algorithm is a block algorithm or FALSE if it is a stream one.",
804 'args' => array(
805 array(
806 'name' => "td",
807 'type' => Resource,
808 'desc' => "The encryption descriptor.",
811 'taint_observer' => false,
814 DefineFunction(
815 array(
816 'name' => "mcrypt_enc_is_block_mode",
817 'desc' => "Tells whether the opened mode outputs blocks (e.g. TRUE for cbc and ecb, and FALSE for cfb and stream).",
818 'flags' => HasDocComment,
819 'return' => array(
820 'type' => Boolean,
821 'desc' => "Returns TRUE if the mode outputs blocks of bytes or FALSE if it outputs bytes.",
823 'args' => array(
824 array(
825 'name' => "td",
826 'type' => Resource,
827 'desc' => "The encryption descriptor.",
830 'taint_observer' => false,
833 DefineFunction(
834 array(
835 'name' => "mcrypt_enc_self_test",
836 'desc' => "This function runs the self test on the algorithm specified by the descriptor td.",
837 'flags' => HasDocComment,
838 'return' => array(
839 'type' => Int64,
840 'desc' => "If the self test succeeds it returns FALSE. In case of an error, it returns TRUE.",
842 'args' => array(
843 array(
844 'name' => "td",
845 'type' => Resource,
846 'desc' => "The encryption descriptor.",
849 'taint_observer' => false,
852 DefineFunction(
853 array(
854 'name' => "mcrypt_generic",
855 'desc' => "This function encrypts data. The data is padded with \"\\0\" to make sure the length of the data is n * blocksize. This function returns the encrypted data. Note that the length of the returned string can in fact be longer then the input, due to the padding of the data.\n\nIf you want to store the encrypted data in a database make sure to store the entire string as returned by mcrypt_generic, or the string will not entirely decrypt properly. If your original string is 10 characters long and the block size is 8 (use mcrypt_enc_get_block_size() to determine the blocksize), you would need at least 16 characters in your database field. Note the string returned by mdecrypt_generic() will be 16 characters as well...use rtrim(\$str, \"\\0\") to remove the padding.\n\nIf you are for example storing the data in a MySQL database remember that varchar fields automatically have trailing spaces removed during insertion. As encrypted data can end in a space (ASCII 32), the data will be damaged by this removal. Store data in a tinyblob/tinytext (or larger) field instead.",
856 'flags' => HasDocComment,
857 'return' => array(
858 'type' => Variant,
859 'desc' => "Returns the encrypted data.",
861 'args' => array(
862 array(
863 'name' => "td",
864 'type' => Resource,
865 'desc' => "The encryption descriptor.\n\nThe encryption handle should always be initialized with mcrypt_generic_init() with a key and an IV before calling this function. Where the encryption is done, you should free the encryption buffers by calling mcrypt_generic_deinit(). See mcrypt_module_open() for an example.",
867 array(
868 'name' => "data",
869 'type' => String,
870 'desc' => "The data to encrypt.",
873 'taint_observer' => array(
874 'set_mask' => "TAINT_BIT_MUTATED",
875 'clear_mask' => "TAINT_BIT_NONE",
879 DefineFunction(
880 array(
881 'name' => "mcrypt_generic_init",
882 'desc' => "You need to call this function before every call to mcrypt_generic() or mdecrypt_generic().",
883 'flags' => HasDocComment,
884 'return' => array(
885 'type' => Int64,
886 'desc' => "The function returns a negative value on error, -3 when the key length was incorrect, -4 when there was a memory allocation problem and any other return value is an unknown error. If an error occurs a warning will be displayed accordingly. FALSE is returned if incorrect parameters were passed.",
888 'args' => array(
889 array(
890 'name' => "td",
891 'type' => Resource,
892 'desc' => "The encryption descriptor.",
894 array(
895 'name' => "key",
896 'type' => String,
897 'desc' => "The maximum length of the key should be the one obtained by calling mcrypt_enc_get_key_size() and every value smaller than this is legal.",
899 array(
900 'name' => "iv",
901 'type' => String,
902 'desc' => "The IV should normally have the size of the algorithms block size, but you must obtain the size by calling mcrypt_enc_get_iv_size(). IV is ignored in ECB. IV MUST exist in CFB, CBC, STREAM, nOFB and OFB modes. It needs to be random and unique (but not secret). The same IV must be used for encryption/decryption. If you do not want to use it you should set it to zeros, but this is not recommended.",
905 'taint_observer' => false,
908 DefineFunction(
909 array(
910 'name' => "mdecrypt_generic",
911 'desc' => "This function decrypts data. Note that the length of the returned string can in fact be longer then the unencrypted string, due to the padding of the data.",
912 'flags' => HasDocComment,
913 'return' => array(
914 'type' => Variant,
916 'args' => array(
917 array(
918 'name' => "td",
919 'type' => Resource,
920 'desc' => "An encryption descriptor returned by mcrypt_module_open()",
922 array(
923 'name' => "data",
924 'type' => String,
925 'desc' => "Encrypted data.",
928 'taint_observer' => array(
929 'set_mask' => "TAINT_BIT_MUTATED",
930 'clear_mask' => "TAINT_BIT_NONE",
934 DefineFunction(
935 array(
936 'name' => "mcrypt_generic_deinit",
937 'desc' => "This function terminates encryption specified by the encryption descriptor (td). It clears all buffers, but does not close the module. You need to call mcrypt_module_close() yourself. (But PHP does this for you at the end of the script.)",
938 'flags' => HasDocComment,
939 'return' => array(
940 'type' => Boolean,
941 'desc' => "Returns TRUE on success or FALSE on failure.",
943 'args' => array(
944 array(
945 'name' => "td",
946 'type' => Resource,
947 'desc' => "The encryption descriptor.",
950 'taint_observer' => false,
953 DefineFunction(
954 array(
955 'name' => "mcrypt_generic_end",
956 'flags' => HasDocComment,
957 'return' => array(
958 'type' => Boolean,
960 'args' => array(
961 array(
962 'name' => "td",
963 'type' => Resource,
966 'taint_observer' => false,
970 ///////////////////////////////////////////////////////////////////////////////
971 // Classes
973 // BeginClass
974 // array (
975 // 'name' => name of the class
976 // 'desc' => description of the class's purpose
977 // 'flags' => attributes of the class, see base.php for possible values
978 // 'note' => additional note about this class's schema
979 // 'parent' => parent class name, if any
980 // 'ifaces' => array of interfaces tihs class implements
981 // 'bases' => extra internal and special base classes this class requires
982 // 'footer' => extra C++ inserted at end of class declaration
983 // )
985 // DefineConstant(..)
986 // DefineConstant(..)
987 // ...
988 // DefineFunction(..)
989 // DefineFunction(..)
990 // ...
991 // DefineProperty
992 // DefineProperty
994 // array (
995 // 'name' => name of the property
996 // 'type' => type of the property
997 // 'flags' => attributes of the property
998 // 'desc' => description of the property
999 // 'note' => additional note about this property's schema
1000 // )
1002 // EndClass()