ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
Auth_OpenID_BcMathWrapper Class Reference
+ Inheritance diagram for Auth_OpenID_BcMathWrapper:
+ Collaboration diagram for Auth_OpenID_BcMathWrapper:

Public Member Functions

 add ($x, $y)
 sub ($x, $y)
 pow ($base, $exponent)
 cmp ($x, $y)
 init ($number, $base=10)
 mod ($base, $modulus)
 mul ($x, $y)
 div ($x, $y)
 _powmod ($base, $exponent, $modulus)
 Same as bcpowmod when bcpowmod is missing.
 powmod ($base, $exponent, $modulus)
 toString ($num)
- Public Member Functions inherited from Auth_OpenID_MathLibrary
 longToBinary ($long)
 Given a long integer, returns the number converted to a binary string.
 binaryToLong ($str)
 Given a binary string, returns the binary string converted to a long number.
 base64ToLong ($str)
 longToBase64 ($str)
 rand ($stop)
 Returns a random number in the specified range.

Data Fields

 $type = 'bcmath'

Detailed Description

Definition at line 190 of file BigMath.php.

Member Function Documentation

Auth_OpenID_BcMathWrapper::_powmod (   $base,
  $exponent,
  $modulus 
)

Same as bcpowmod when bcpowmod is missing.

private

Definition at line 238 of file BigMath.php.

References $result, cmp(), div(), mod(), and mul().

Referenced by powmod().

{
$square = $this->mod($base, $modulus);
$result = 1;
while($this->cmp($exponent, 0) > 0) {
if ($this->mod($exponent, 2)) {
$result = $this->mod($this->mul($result, $square), $modulus);
}
$square = $this->mod($this->mul($square, $square), $modulus);
$exponent = $this->div($exponent, 2);
}
return $result;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Auth_OpenID_BcMathWrapper::add (   $x,
  $y 
)

Definition at line 193 of file BigMath.php.

{
return bcadd($x, $y);
}
Auth_OpenID_BcMathWrapper::cmp (   $x,
  $y 
)

Definition at line 208 of file BigMath.php.

Referenced by _powmod().

{
return bccomp($x, $y);
}

+ Here is the caller graph for this function:

Auth_OpenID_BcMathWrapper::div (   $x,
  $y 
)

Definition at line 228 of file BigMath.php.

Referenced by _powmod().

{
return bcdiv($x, $y);
}

+ Here is the caller graph for this function:

Auth_OpenID_BcMathWrapper::init (   $number,
  $base = 10 
)

Definition at line 213 of file BigMath.php.

{
return $number;
}
Auth_OpenID_BcMathWrapper::mod (   $base,
  $modulus 
)

Definition at line 218 of file BigMath.php.

Referenced by _powmod().

{
return bcmod($base, $modulus);
}

+ Here is the caller graph for this function:

Auth_OpenID_BcMathWrapper::mul (   $x,
  $y 
)

Definition at line 223 of file BigMath.php.

Referenced by _powmod().

{
return bcmul($x, $y);
}

+ Here is the caller graph for this function:

Auth_OpenID_BcMathWrapper::pow (   $base,
  $exponent 
)

Definition at line 203 of file BigMath.php.

{
return bcpow($base, $exponent);
}
Auth_OpenID_BcMathWrapper::powmod (   $base,
  $exponent,
  $modulus 
)

Definition at line 252 of file BigMath.php.

References _powmod().

{
if (function_exists('bcpowmod')) {
return bcpowmod($base, $exponent, $modulus);
} else {
return $this->_powmod($base, $exponent, $modulus);
}
}

+ Here is the call graph for this function:

Auth_OpenID_BcMathWrapper::sub (   $x,
  $y 
)

Definition at line 198 of file BigMath.php.

{
return bcsub($x, $y);
}
Auth_OpenID_BcMathWrapper::toString (   $num)

Definition at line 261 of file BigMath.php.

{
return $num;
}

Field Documentation

Auth_OpenID_BcMathWrapper::$type = 'bcmath'

Definition at line 191 of file BigMath.php.


The documentation for this class was generated from the following file: