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},
};
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)
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