|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2009-05-24 02:48 UTC] alias301 at gmail dot com
Description: ------------ The documentation for mcrypt_get_key_size() says that it wants the $module as the second parameter, but should be $mode Also, were it says "Example #1 mcrypt_get_block_size() example" it should be "Example #1 mcrypt_get_key_size() example" See: http://us3.php.net/function.mcrypt_get_key_size PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Wed Jun 17 02:00:02 2026 UTC |
The prototype says: int mcrypt_get_key_size ( string $cipher , string $module ) where $module = 'ecb'; however the prototype: resource mcrypt_module_open ( string $algorithm , string $algorithm_directory , string $mode , string $mode_directory ) says $mode = 'ofb'; // which could also be 'ecb' which means that the documentation is not connsistent shich can lead to others believing (like me at first) that $module was the module resource that had been opened with mcrypt_module_open() and part of documentation is being conssistent, so I believe that it should be a prototype of: int mcrypt_get_key_size ( string $cipher , string $mode ) so as to convey the correct message to those who will use this documentation. Also, to add to this I have checked with the source for the mcrypt extension as in the code is shows this call: td = mcrypt_module_open(cipher, cipher_dir_string, module, module_dir_string); So, I guess my question is why is it that the extension uses module when clearly the documentation shows mode. This clearly need to be fixed so that the function calls have matching documentation. ---- Also, this clearly shows that in the C source that mcrypt_module_open() does use that variable as mode *not* module if (zend_parse_parameters (ZEND_NUM_ARGS() TSRMLS_CC, "ssss", &cipher, &cipher_len, &cipher_dir, &cipher_dir_len, &mode, &mode_len, &mode_dir, &mode_dir_len)) { return; } Thank You