[PHP4BETA] CVS update: php4/ext/mcrypt
| From: | sas | Date: | Sun, 25 Apr 1999 20:32:16 +0000 |
| Subject: | [PHP4BETA] CVS update: php4/ext/mcrypt | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-522@lists.php.net to get a copy of this message | ||
Date: Sunday April 25, 1999 @ 16:32
Author: sas
Update of /repository/php4/ext/mcrypt
In directory php:/tmp/cvs-serv14502
Modified Files:
mcrypt.c php_mcrypt.h
Log Message:
add get_(key|block)_size
Index: php4/ext/mcrypt/mcrypt.c
diff -u php4/ext/mcrypt/mcrypt.c:1.2 php4/ext/mcrypt/mcrypt.c:1.3
--- php4/ext/mcrypt/mcrypt.c:1.2 Sun Apr 25 13:04:49 1999
+++ php4/ext/mcrypt/mcrypt.c Sun Apr 25 16:32:15 1999
@@ -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},
};
@@ -83,6 +85,36 @@
MCRYPT_ENTRY(CRYPT);
#endif
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)
Index: php4/ext/mcrypt/php_mcrypt.h
diff -u php4/ext/mcrypt/php_mcrypt.h:1.2 php4/ext/mcrypt/php_mcrypt.h:1.3
--- php4/ext/mcrypt/php_mcrypt.h:1.2 Sun Apr 25 13:04:56 1999
+++ php4/ext/mcrypt/php_mcrypt.h Sun Apr 25 16:32:15 1999
@@ -8,6 +8,8 @@
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
--
PHP 4 Beta