mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
add get_(key|block)_size
This commit is contained in:
parent
10710c046d
commit
7d1ee82d79
@ -38,6 +38,8 @@
|
||||
function_entry mcrypt_functions[] = {
|
||||
PHP_FE(mcrypt_ecb, NULL)
|
||||
PHP_FE(mcrypt_cbc, NULL)
|
||||
PHP_FE(mcrypt_get_block_size, NULL)
|
||||
PHP_FE(mcrypt_get_key_size, NULL)
|
||||
{0},
|
||||
};
|
||||
|
||||
@ -85,6 +87,36 @@ static int php3_minit_mcrypt(INIT_FUNC_ARGS)
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
/* proto mcrypt_get_key_size(int cipher)
|
||||
get the key size of cipher */
|
||||
PHP_FUNCTION(mcrypt_get_key_size)
|
||||
{
|
||||
pval *cipher;
|
||||
|
||||
if(ARG_COUNT(ht) != 1 || getParameters(ht, 1, &cipher) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
convert_to_long(cipher);
|
||||
|
||||
RETURN_LONG(get_key_size(cipher->value.lval));
|
||||
}
|
||||
|
||||
/* proto mcrypt_get_block_size(int cipher)
|
||||
get the block size of cipher */
|
||||
PHP_FUNCTION(mcrypt_get_block_size)
|
||||
{
|
||||
pval *cipher;
|
||||
|
||||
if(ARG_COUNT(ht) != 1 || getParameters(ht, 1, &cipher) == FAILURE) {
|
||||
WRONG_PARAM_COUNT;
|
||||
}
|
||||
|
||||
convert_to_long(cipher);
|
||||
|
||||
RETURN_LONG(get_block_size(cipher->value.lval));
|
||||
}
|
||||
|
||||
/* proto mcrypt_cbc(int cipher, string key, string data, int mode)
|
||||
CBC crypt/decrypt data using key key with cipher cipher */
|
||||
PHP_FUNCTION(mcrypt_cbc)
|
||||
|
@ -8,6 +8,8 @@ extern zend_module_entry mcrypt_module_entry;
|
||||
|
||||
PHP_FUNCTION(mcrypt_ecb);
|
||||
PHP_FUNCTION(mcrypt_cbc);
|
||||
PHP_FUNCTION(mcrypt_get_block_size);
|
||||
PHP_FUNCTION(mcrypt_get_key_size);
|
||||
|
||||
#else
|
||||
#define mcrypt_module_ptr NULL
|
||||
|
Loading…
Reference in New Issue
Block a user