]> git.mxchange.org Git - friendica.git/blobdiff - library/phpsec/PHP/Compat/Function/bcpowmod.php
Issue 3142: mcrypt is no more (as well as phpseclib)
[friendica.git] / library / phpsec / PHP / Compat / Function / bcpowmod.php
diff --git a/library/phpsec/PHP/Compat/Function/bcpowmod.php b/library/phpsec/PHP/Compat/Function/bcpowmod.php
deleted file mode 100644 (file)
index 6ec1b18..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-<?php\r
-// $Id: bcpowmod.php,v 1.1 2007/07/02 04:19:55 terrafrost Exp $\r
-\r
-\r
-/**\r
- * Replace bcpowmod()\r
- *\r
- * @category    PHP\r
- * @package     PHP_Compat\r
- * @license     LGPL - http://www.gnu.org/licenses/lgpl.html\r
- * @copyright   2004-2007 Aidan Lister <aidan@php.net>, Arpad Ray <arpad@php.net>\r
- * @link        http://php.net/function.bcpowmod\r
- * @author      Sara Golemon <pollita@php.net>\r
- * @version     $Revision: 1.1 $\r
- * @since       PHP 5.0.0\r
- * @require     PHP 4.0.0 (user_error)\r
- */\r
-function php_compat_bcpowmod($x, $y, $modulus, $scale = 0)\r
-{\r
-    // Sanity check\r
-    if (!is_scalar($x)) {\r
-        user_error('bcpowmod() expects parameter 1 to be string, ' .\r
-            gettype($x) . ' given', E_USER_WARNING);\r
-        return false;\r
-    }\r
-\r
-    if (!is_scalar($y)) {\r
-        user_error('bcpowmod() expects parameter 2 to be string, ' .\r
-            gettype($y) . ' given', E_USER_WARNING);\r
-        return false;\r
-    }\r
-\r
-    if (!is_scalar($modulus)) {\r
-        user_error('bcpowmod() expects parameter 3 to be string, ' .\r
-            gettype($modulus) . ' given', E_USER_WARNING);\r
-        return false;\r
-    }\r
-\r
-    if (!is_scalar($scale)) {\r
-        user_error('bcpowmod() expects parameter 4 to be integer, ' .\r
-            gettype($scale) . ' given', E_USER_WARNING);\r
-        return false;\r
-    }\r
-\r
-    $t = '1';\r
-    while (bccomp($y, '0')) {\r
-        if (bccomp(bcmod($y, '2'), '0')) {\r
-            $t = bcmod(bcmul($t, $x), $modulus);\r
-            $y = bcsub($y, '1');\r
-        }\r
-\r
-        $x = bcmod(bcmul($x, $x), $modulus);\r
-        $y = bcdiv($y, '2');\r
-    }\r
-\r
-    return $t;    \r
-}\r
-\r
-\r
-// Define\r
-if (!function_exists('bcpowmod')) {\r
-    function bcpowmod($x, $y, $modulus, $scale = 0)\r
-    {\r
-        return php_compat_bcpowmod($x, $y, $modulus, $scale);\r
-    }\r
-}\r
-?>
\ No newline at end of file