Lots of PHPDoc fixes

This commit is contained in:
Sokolovskyy Roman 2017-10-25 11:44:14 +02:00
parent 12f7358c67
commit f40ea062c2
37 changed files with 356 additions and 176 deletions

View File

@ -26,7 +26,7 @@ abstract class Objects
/**
* Accesses a private variable from an object
*
* @param Object $obj
* @param object $obj
* @param string $var
* @return mixed
* @access public
@ -42,7 +42,7 @@ abstract class Objects
/**
* Sets the value of a private variable in an object
*
* @param Object $obj
* @param object $obj
* @param string $var
* @param mixed $val
* @access public
@ -58,7 +58,7 @@ abstract class Objects
/**
* Accesses a private method from an object
*
* @param Object $obj
* @param object $obj
* @param string $func
* @param array $params
* @return mixed

View File

@ -103,10 +103,10 @@ abstract class Strings
*
* uint64 is not supported.
*
* @param string $string
* @param int $index
* @access public
* @param string $format
* @param $data
* @return mixed
* @access public
*/
public static function unpackSSH2($format, $data)
{

View File

@ -180,6 +180,7 @@ abstract class AsymmetricKey
/**
* Tests engine validity
*
* @returns boolean
* @access public
* @param int $val
*/
@ -254,8 +255,8 @@ abstract class AsymmetricKey
/**
* Load Plugins
*
* @params $format
* @access private
* @param $format
*/
private static function loadPlugins($format)
{
@ -539,7 +540,7 @@ abstract class AsymmetricKey
* @see self::createKey()
* @see self::load()
* @access public
* @param string $password
* @param string|boolean $password
*/
public function setPassword($password = false)
{

View File

@ -103,6 +103,7 @@ abstract class OpenSSH
* Returns the comment for the key
*
* @access public
* @param $key
* @return mixed
*/
public static function getComment($key)

View File

@ -28,6 +28,7 @@
namespace phpseclib\Crypt\Common\Keys;
use ParagonIE\ConstantTime\Base64;
use phpseclib\Crypt\Common\SymmetricKey;
use phpseclib\Crypt\DES;
use phpseclib\Crypt\RC2;
use phpseclib\Crypt\RC4;
@ -138,7 +139,7 @@ abstract class PKCS8 extends PKCS
/**
* Returns a SymmetricKey object based on a PBES1 $algo
*
* @returns SymmetricKey
* @access public
* @param string $algo
*/
@ -188,6 +189,7 @@ abstract class PKCS8 extends PKCS
/**
* Returns a hash based on a PBES1 $algo
*
* @returns string
* @access public
* @param string $algo
*/
@ -203,6 +205,7 @@ abstract class PKCS8 extends PKCS
/**
* Returns a KDF baesd on a PBES1 $algo
*
* @returns string
* @access public
* @param string $algo
*/
@ -224,6 +227,7 @@ abstract class PKCS8 extends PKCS
/**
* Returns a SymmetricKey object baesd on a PBES2 $algo
*
* @returns SymmetricKey
* @access public
* @param string $algo
*/

View File

@ -74,8 +74,6 @@ abstract class PuTTY
*
* @access public
* @param string $key
* @param string $publicHandler
* @param string $type
* @param string $password
* @return array|bool
*/

View File

@ -213,10 +213,10 @@ class DSA extends AsymmetricKey
* Loads a public or private key
*
* Returns true on success and false on failure (ie. an incorrect password was provided or the key was malformed)
*
* @return boolean
* @access public
* @param string $key
* @param int $type optional
* @param int|boolean $type optional
*/
public function load($key, $type = false)
{
@ -460,6 +460,7 @@ class DSA extends AsymmetricKey
* @see self::verify()
* @access public
* @param string $message
* @param $signature
* @param string $format optional
* @return mixed
*/

View File

@ -90,9 +90,6 @@ abstract class PuTTY extends Progenitor
* @param \phpseclib\Math\BigInteger $g
* @param \phpseclib\Math\BigInteger $y
* @param \phpseclib\Math\BigInteger $x
* @param array $primes
* @param array $exponents
* @param array $coefficients
* @param string $password optional
* @return string
*/

View File

@ -67,9 +67,6 @@ abstract class Raw
* @param \phpseclib\Math\BigInteger $g
* @param \phpseclib\Math\BigInteger $y
* @param \phpseclib\Math\BigInteger $x
* @param array $primes
* @param array $exponents
* @param array $coefficients
* @param string $password optional
* @return string
*/

View File

@ -35,7 +35,7 @@ abstract class PKCS
* Loads a signature
*
* @access public
* @param array $key
* @param $sig
* @return array|bool
*/
public static function load($sig)

View File

@ -331,9 +331,10 @@ class Hash
/**
* Pure-PHP implementation of SHA512
*
* @access private
* @param string $m
* @param $hash
* @return string
*/
private static function sha512($m, $hash)
{

View File

@ -344,7 +344,7 @@ class RC2 extends BlockCipher
* @see \phpseclib\Crypt\Common\SymmetricKey::setKey()
* @access public
* @param string $key
* @param int $t1 optional Effective key length in bits.
* @param int|boolean $t1 optional Effective key length in bits.
* @throws \LengthException if the key length isn't supported
*/
public function setKey($key, $t1 = false)

View File

@ -204,8 +204,7 @@ class RC4 extends StreamCipher
* Keys can be between 1 and 256 bytes long.
*
* @access public
* @param int $length
* @throws \LengthException if the key length is invalid
* @param string $key
*/
public function setKey($key)
{
@ -256,7 +255,7 @@ class RC4 extends StreamCipher
/**
* Encrypts a block
*
* @return null
* @access private
* @param string $in
*/
@ -267,7 +266,7 @@ class RC4 extends StreamCipher
/**
* Decrypts a block
*
* @return null
* @access private
* @param string $in
*/

View File

@ -320,9 +320,10 @@ class RSA extends AsymmetricKey
* - 'privatekey': The private key.
* - 'publickey': The public key.
*
* @return array
* @access public
* @param int $bits
* @param array $p
*
*/
public static function createKey($bits = 2048)
{
@ -455,9 +456,10 @@ class RSA extends AsymmetricKey
*
* Returns true on success and false on failure (ie. an incorrect password was provided or the key was malformed)
*
* @return boolean
* @access public
* @param string $key
* @param int $type optional
* @param int|boolean $type optional
*/
public function load($key, $type = false)
{
@ -652,8 +654,8 @@ class RSA extends AsymmetricKey
*
* @see self::getPublicKey()
* @access public
* @param string $key optional
* @param int $type optional
* @param string|boolean $key optional
* @param int|boolean $type optional
* @return bool
*/
public function setPublicKey($key = false, $type = false)
@ -696,8 +698,8 @@ class RSA extends AsymmetricKey
*
* @see self::getPublicKey()
* @access public
* @param string $key optional
* @param int $type optional
* @param string|boolean $key optional
* @param int|boolean $type optional
* @return bool
*/
public function setPrivateKey($key = false, $type = false)
@ -836,7 +838,8 @@ class RSA extends AsymmetricKey
* of the hash function Hash) and 0.
*
* @access public
* @param int $format
* @param $sLen
* @internal param int $format
*/
public function setSaltLength($sLen)
{
@ -1079,7 +1082,7 @@ class RSA extends AsymmetricKey
*
* @access private
* @param string $mgfSeed
* @param int $mgfLen
* @param int $maskLen
* @return string
*/
private function mgf1($mgfSeed, $maskLen)
@ -1345,6 +1348,7 @@ class RSA extends AsymmetricKey
*
* See {@link http://tools.ietf.org/html/rfc3447#section-9.1.1 RFC3447#section-9.1.1}.
*
* @returns string
* @access private
* @param string $m
* @throws \RuntimeException on encoding error
@ -1740,7 +1744,7 @@ class RSA extends AsymmetricKey
*
* @see self::encrypt()
* @access public
* @param string $plaintext
* @param string $ciphertext
* @param int $padding optional
* @return bool|string
*/

View File

@ -190,7 +190,7 @@ abstract class Random
* Safely serialize variables
*
* If a class has a private __sleep() it'll emit a warning
*
* @return mixed
* @param mixed $arr
* @access public
*/

View File

@ -604,6 +604,7 @@ class Rijndael extends BlockCipher
/**
* Performs S-Box substitutions
*
* @returns array
* @access private
* @param int $word
*/

View File

@ -203,8 +203,7 @@ class ANSI
/**
* Set the number of lines that should be logged past the terminal height
*
* @param int $x
* @param int $y
* @param $history
* @access public
*/
public function setHistory($history)
@ -461,6 +460,9 @@ class ANSI
* Returns the current coordinate without preformating
*
* @access private
* @param $last_attr
* @param $cur_attr
* @param $char
* @return string
*/
private function processCoordinate($last_attr, $cur_attr, $char)

View File

@ -814,8 +814,8 @@ abstract class ASN1
* "Special" mappings can be applied via $special.
*
* @param string $source
* @param string $mapping
* @param int $idx
* @param array $mapping
* @param array $special
* @return string
* @access public
*/
@ -831,8 +831,8 @@ abstract class ASN1
* @param string $source
* @param array $mapping
* @param int $idx
* @param array $special
* @return string
* @throws \RuntimeException if the input has an error in it
* @access private
*/
private static function encode_der($source, $mapping, $idx = null, $special = [])
@ -1387,6 +1387,7 @@ abstract class ASN1
* getOID('zzz') == 'zzz'
*
* @access public
* @param $name
* @return string
*/
static function getOID($name)

View File

@ -1924,8 +1924,9 @@ class X509
* Load a Certificate Signing Request
*
* @param string $csr
* @access public
* @param int $mode
* @return mixed
* @access public
*/
public function loadCSR($csr, $mode = self::FORMAT_AUTO_DETECT)
{
@ -2162,8 +2163,9 @@ class X509
* Load a Certificate Revocation List
*
* @param string $crl
* @access public
* @param int $mode
* @return mixed
* @access public
*/
public function loadCRL($crl, $mode = self::FORMAT_AUTO_DETECT)
{
@ -2496,6 +2498,7 @@ class X509
* Sign a CSR
*
* @access public
* @param string $signatureAlgorithm
* @return mixed
*/
public function signCSR($signatureAlgorithm = 'sha1WithRSAEncryption')
@ -2554,6 +2557,7 @@ class X509
* Sign a SPKAC
*
* @access public
* @param string $signatureAlgorithm
* @return mixed
*/
public function signSPKAC($signatureAlgorithm = 'sha1WithRSAEncryption')
@ -2752,7 +2756,6 @@ class X509
* X.509 certificate signing helper function.
*
* @param object $key
* @param \phpseclib\File\X509 $subject
* @param string $signatureAlgorithm
* @access public
* @throws \phpseclib\Exception\UnsupportedAlgorithmException if the algorithm is unsupported
@ -3297,7 +3300,7 @@ class X509
*
* @param string $id
* @param mixed $value
* @param bool $disposition optional
* @param int $disposition optional
* @access public
* @return bool
*/

View File

@ -76,7 +76,7 @@ class BigInteger implements \Serializable
* Throws an exception if the type is invalid
*
* @param string $main
* @param array $modexp optional
* @param array $modexps optional
*/
public static function setEngine($main, $modexps = ['DefaultEngine'])
{
@ -219,7 +219,8 @@ class BigInteger implements \Serializable
/**
* Adds two BigIntegers.
*
* @return \phpseclib\Math\BigInteger
* @param BigInteger $y
* @return BigInteger
*/
public function add(BigInteger $y)
{
@ -229,7 +230,8 @@ class BigInteger implements \Serializable
/**
* Subtracts two BigIntegers.
*
* @return \phpseclib\Math\BigInteger
* @param BigInteger $y
* @return BigInteger
*/
function subtract(BigInteger $y)
{
@ -270,7 +272,7 @@ class BigInteger implements \Serializable
* </code>
*
* @param \phpseclib\Math\BigInteger $y
* @return \phpseclib\Math\BigInteger
* @return \phpseclib\Math\BigInteger[]
*/
public function divide(BigInteger $y)
{
@ -285,7 +287,7 @@ class BigInteger implements \Serializable
* Calculates modular inverses.
*
* Say you have (30 mod 17 * x mod 17) mod 17 == 1. x can be found using modular inverses.
*
* @return BigInteger
* @param \phpseclib\Math\BigInteger $n
*/
public function modInverse(BigInteger $n)
@ -297,7 +299,7 @@ class BigInteger implements \Serializable
* Calculates modular inverses.
*
* Say you have (30 mod 17 * x mod 17) mod 17 == 1. x can be found using modular inverses.
*
* @return array
* @param \phpseclib\Math\BigInteger $n
*/
public function extendedGCD(BigInteger $n)
@ -315,7 +317,8 @@ class BigInteger implements \Serializable
*
* Say you have 693 and 609. The GCD is 21.
*
* @return \phpseclib\Math\BigInteger
* @param BigInteger $n
* @return BigInteger
*/
public function gcd(BigInteger $n)
{
@ -402,7 +405,9 @@ class BigInteger implements \Serializable
/**
* Performs modular exponentiation.
*
* @return \phpseclib\Math\BigInteger
* @param BigInteger $e
* @param BigInteger $n
* @return BigInteger
*/
public function powMod(BigInteger $e, BigInteger $n)
{
@ -412,7 +417,9 @@ class BigInteger implements \Serializable
/**
* Performs modular exponentiation.
*
* @return \phpseclib\Math\BigInteger
* @param BigInteger $e
* @param BigInteger $n
* @return BigInteger
*/
public function modPow(BigInteger $e, BigInteger $n)
{
@ -447,6 +454,7 @@ class BigInteger implements \Serializable
*
* If you need to see if one number is greater than or less than another number, use BigInteger::compare()
*
* @param BigInteger $x
* @return bool
*/
public function equals(BigInteger $x)
@ -467,7 +475,8 @@ class BigInteger implements \Serializable
/**
* Logical And
*
* @return \phpseclib\Math\BigInteger
* @param BigInteger $x
* @return BigInteger
*/
public function bitwise_and(BigInteger $x)
{
@ -477,7 +486,8 @@ class BigInteger implements \Serializable
/**
* Logical Or
*
* @return \phpseclib\Math\BigInteger
* @param BigInteger $x
* @return BigInteger
*/
public function bitwise_or(BigInteger $x)
{
@ -487,7 +497,8 @@ class BigInteger implements \Serializable
/**
* Logical Exlusive Or
*
* @return \phpseclib\Math\BigInteger
* @param BigInteger $x
* @return BigInteger
*/
public function bitwise_xor(BigInteger $x)
{
@ -615,7 +626,9 @@ class BigInteger implements \Serializable
*
* If there's not a prime within the given range, false will be returned.
*
* @return \phpseclib\Math\BigInteger|false
* @param BigInteger $min
* @param BigInteger $max
* @return false|BigInteger
*/
public static function randomRangePrime(BigInteger $min, BigInteger $max)
{
@ -632,7 +645,9 @@ class BigInteger implements \Serializable
* BigInteger::randomRange($min, $max)
* BigInteger::randomRange($max, $min)
*
* @return \phpseclib\Math\BigInteger
* @param BigInteger $min
* @param BigInteger $max
* @return BigInteger
*/
public static function randomRange(BigInteger $min, BigInteger $max)
{
@ -647,7 +662,7 @@ class BigInteger implements \Serializable
* $t parameter is distributability. BigInteger::randomPrime() can be distributed across multiple pageloads
* on a website instead of just one.
*
* @param int $t
* @param int|boolean $t
* @return bool
*/
public function isPrime($t = false)
@ -671,7 +686,8 @@ class BigInteger implements \Serializable
/**
* Performs exponentiation.
*
* @return \phpseclib\Math\BigInteger
* @param BigInteger $n
* @return BigInteger
*/
public function pow(BigInteger $n)
{
@ -681,7 +697,8 @@ class BigInteger implements \Serializable
/**
* Return the minimum BigInteger between an arbitrary number of BigIntegers.
*
* @return \phpseclib\Math\BigInteger
* @param BigInteger[] $nums
* @return BigInteger
*/
public static function min(BigInteger ...$nums)
{
@ -693,7 +710,8 @@ class BigInteger implements \Serializable
/**
* Return the maximum BigInteger between an arbitrary number of BigIntegers.
*
* @return \phpseclib\Math\BigInteger
* @param BigInteger[] $nums
* @return BigInteger
*/
public static function max(BigInteger ...$nums)
{
@ -705,7 +723,9 @@ class BigInteger implements \Serializable
/**
* Tests BigInteger to see if it is between two integers, inclusive
*
* @return boolean
* @param BigInteger $min
* @param BigInteger $max
* @return bool
*/
public function between(BigInteger $min, BigInteger $max)
{

View File

@ -204,7 +204,8 @@ class BCMath extends Engine
/**
* Adds two BigIntegers.
*
* @return \phpseclib\Math\BigInteger\Engines\BCMath
* @param BCMath $y
* @return BCMath
*/
public function add(BCMath $y)
{
@ -217,7 +218,8 @@ class BCMath extends Engine
/**
* Subtracts two BigIntegers.
*
* @return \phpseclib\Math\BigInteger\Engines\BCMath
* @param BCMath $y
* @return BCMath
*/
public function subtract(BCMath $y)
{
@ -230,7 +232,8 @@ class BCMath extends Engine
/**
* Multiplies two BigIntegers.
*
* @return \phpseclib\Math\BigInteger\Engines\BCMath
* @param BCMath $x
* @return BCMath
*/
public function multiply(BCMath $x)
{
@ -248,7 +251,8 @@ class BCMath extends Engine
* same. If the remainder would be negative, the "common residue" is equal to the sum of the remainder
* and the divisor (basically, the "common residue" is the first positive modulo).
*
* @return \phpseclib\Math\BigInteger\Engines\BCMath
* @param BCMath $y
* @return BCMath
*/
public function divide(BCMath $y)
{
@ -270,6 +274,7 @@ class BCMath extends Engine
*
* Say you have (30 mod 17 * x mod 17) mod 17 == 1. x can be found using modular inverses.
*
* @returns Engine|boolean
* @param \phpseclib\Math\BigInteger\Engines\BCMath $n
*/
public function modInverse(BCMath $n)
@ -285,7 +290,8 @@ class BCMath extends Engine
* combination is returned is dependent upon which mode is in use. See
* {@link http://en.wikipedia.org/wiki/B%C3%A9zout%27s_identity Bezout's identity - Wikipedia} for more information.
*
* @return \phpseclib\Math\BigInteger\Engines\BCMath
* @param BCMath $n
* @return BCMath
*/
public function extendedGCD(BCMath $n)
{
@ -329,7 +335,8 @@ class BCMath extends Engine
*
* Say you have 693 and 609. The GCD is 21.
*
* @return \phpseclib\Math\BigInteger\Engines\BCMath
* @param BCMath $n
* @return BCMath
*/
public function gcd(BCMath $n)
{
@ -355,7 +362,8 @@ class BCMath extends Engine
/**
* Logical And
*
* @return \phpseclib\Math\BigInteger\Engines\BCMath
* @param BCMath $x
* @return BCMath
*/
public function bitwise_and(BCMath $x)
{
@ -373,7 +381,8 @@ class BCMath extends Engine
/**
* Logical Or
*
* @return \phpseclib\Math\BigInteger\Engines\BCMath
* @param BCMath $x
* @return BCMath
*/
public function bitwise_or(BCMath $x)
{
@ -391,7 +400,8 @@ class BCMath extends Engine
/**
* Logical Exlusive Or
*
* @return \phpseclib\Math\BigInteger\Engines\BCMath
* @param BCMath $x
* @return BCMath
*/
public function bitwise_xor(BCMath $x)
{
@ -450,7 +460,7 @@ class BCMath extends Engine
*
* Note how the same comparison operator is used. If you want to test for equality, use $x->equals($y).
*
* @param \phpseclib\Math\BigInteger $y
* @param BCMath $y
* @return int < 0 if $this is less than $y; > 0 if $this is greater than $y, and 0 if they are equal.
* @see self::equals()
* @internal Could return $this->subtract($x), but that's not as fast as what we do do.
@ -465,6 +475,7 @@ class BCMath extends Engine
*
* If you need to see if one number is greater than or less than another number, use BigInteger::compare()
*
* @param BCMath $x
* @return bool
*/
public function equals(BCMath $x)
@ -475,7 +486,9 @@ class BCMath extends Engine
/**
* Performs modular exponentiation.
*
* @return \phpseclib\Math\BigInteger\Engines\BCMath
* @param BCMath $e
* @param BCMath $n
* @return BCMath
*/
public function modPow(BCMath $e, BCMath $n)
{
@ -487,7 +500,9 @@ class BCMath extends Engine
*
* Alias for modPow().
*
* @return \phpseclib\Math\BigInteger\Engines\BCMath
* @param BCMath $e
* @param BCMath $n
* @return BCMath
*/
public function powMod(BCMath $e, BCMath $n)
{
@ -497,7 +512,9 @@ class BCMath extends Engine
/**
* Performs modular exponentiation.
*
* @return \phpseclib\Math\BigInteger\Engines\BCMath
* @param BCMath $e
* @param BCMath $n
* @return BCMath
*/
protected function powModInner(BCMath $e, BCMath $n)
{
@ -514,7 +531,8 @@ class BCMath extends Engine
*
* Removes leading zeros and truncates (if necessary) to maintain the appropriate precision
*
* @return \phpseclib\Math\BigInteger\Engines\BCMath
* @param BCMath $result
* @return BCMath
*/
protected function normalize(BCMath $result)
{
@ -533,7 +551,9 @@ class BCMath extends Engine
*
* If there's not a prime within the given range, false will be returned.
*
* @return \phpseclib\Math\BigInteger\Engines\BCMath|false
* @param BCMath $min
* @param BCMath $max
* @return false|BCMath
*/
public static function randomRangePrime(BCMath $min, BCMath $max)
{
@ -549,7 +569,9 @@ class BCMath extends Engine
* BigInteger::randomRange($min, $max)
* BigInteger::randomRange($max, $min)
*
* @return \phpseclib\Math\BigInteger\Engines\BCMath
* @param BCMath $min
* @param BCMath $max
* @return BCMath
*/
public static function randomRange(BCMath $min, BCMath $max)
{
@ -605,6 +627,7 @@ class BCMath extends Engine
* ie. $s = gmp_scan1($n, 0) and $r = gmp_div_q($n, gmp_pow(gmp_init('2'), $s));
*
* @see self::isPrime()
* @param $r
* @return int
*/
protected static function scan1divide($r)
@ -623,7 +646,8 @@ class BCMath extends Engine
/**
* Performs exponentiation.
*
* @return \phpseclib\Math\BigInteger\Engines\BCMath
* @param BCMath $n
* @return BCMath
*/
public function pow(BCMath $n)
{
@ -636,7 +660,8 @@ class BCMath extends Engine
/**
* Return the minimum BigInteger between an arbitrary number of BigIntegers.
*
* @return \phpseclib\Math\BigInteger\Engines\BCMath
* @param BCMath[] $nums
* @return BCMath
*/
public static function min(BCMath ...$nums)
{
@ -646,7 +671,8 @@ class BCMath extends Engine
/**
* Return the maximum BigInteger between an arbitrary number of BigIntegers.
*
* @return \phpseclib\Math\BigInteger\Engines\BCMath
* @param BCMath[] $nums
* @return BCMath
*/
public static function max(BCMath ...$nums)
{
@ -656,7 +682,9 @@ class BCMath extends Engine
/**
* Tests BigInteger to see if it is between two integers, inclusive
*
* @return boolean
* @param BCMath $min
* @param BCMath $max
* @return bool
*/
public function between(BCMath $min, BCMath $max)
{
@ -666,6 +694,7 @@ class BCMath extends Engine
/**
* Set Bitmask
*
* @returns Engine
* @param int $bits
* @see self::setPrecision()
*/

View File

@ -29,7 +29,10 @@ abstract class BuiltIn extends BCMath
/**
* Performs modular exponentiation.
*
* @return \phpseclib\Math\BigInteger\Engines\BCMath
* @param BCMath $x
* @param BCMath $e
* @param BCMath $n
* @return BCMath
*/
protected static function powModHelper(BCMath $x, BCMath $e, BCMath $n)
{

View File

@ -53,7 +53,7 @@ abstract class EvalBarrett extends Base
/**
* Generate Custom Reduction
*
* @param array $m
* @param BCMath $m
* @param string $class
* @return callable|void
*/

View File

@ -61,7 +61,6 @@ abstract class Engine implements \Serializable
*
* @param $x integer Base-10 number or base-$base number if $base set.
* @param int $base
* @return \phpseclib\Math\BigInteger\Engines\Engine
*/
public function __construct($x, $base)
{
@ -194,8 +193,6 @@ abstract class Engine implements \Serializable
*
* Negative numbers are saved as positive numbers, unless $twos_compliment is set to true, at which point, they're
* saved as two's compliment.
*
* @param bool $twos_compliment
* @return string
*/
protected function toBytesHelper()
@ -384,7 +381,7 @@ abstract class Engine implements \Serializable
/**
* Set Bitmask
*
* @returns Engine
* @param int $bits
* @see self::setPrecision()
*/
@ -563,6 +560,8 @@ abstract class Engine implements \Serializable
/**
* Performs some pre-processing for powMod
*
* @param Engine $e
* @param Engine $n
* @return bool|Engine
*/
protected function powModOuter(Engine $e, Engine $n)
@ -691,6 +690,8 @@ abstract class Engine implements \Serializable
/**
* Performs some pre-processing for randomRangePrime
*
* @param Engine $min
* @param Engine $max
* @return bool|Engine
*/
protected static function randomRangePrimeOuter(Engine $min, Engine $max)
@ -720,7 +721,9 @@ abstract class Engine implements \Serializable
* BigInteger::randomRange($min, $max)
* BigInteger::randomRange($max, $min)
*
* @return \phpseclib\Math\BigInteger\Engines\Engine
* @param Engine $min
* @param Engine $max
* @return Engine
*/
protected static function randomRangeHelper(Engine $min, Engine $max)
{
@ -781,6 +784,9 @@ abstract class Engine implements \Serializable
/**
* Performs some post-processing for randomRangePrime
*
* @param Engine $x
* @param Engine $min
* @param Engine $max
* @return bool|Engine
*/
protected static function randomRangePrimeInner(Engine $x, Engine $min, Engine $max)
@ -900,7 +906,7 @@ abstract class Engine implements \Serializable
* $t parameter is distributability. BigInteger::randomPrime() can be distributed across multiple pageloads
* on a website instead of just one.
*
* @param int $t
* @param int|boolean $t
* @return bool
*/
public function isPrime($t = false)
@ -996,7 +1002,8 @@ abstract class Engine implements \Serializable
/**
* Calculates the nth root of a biginteger.
*
* @return \phpseclib\Math\BigInteger\Engines\Engine
* @param int $n
* @return Engine
*/
public function root($n = 2)
{
@ -1006,7 +1013,8 @@ abstract class Engine implements \Serializable
/**
* Return the minimum BigInteger between an arbitrary number of BigIntegers.
*
* @return \phpseclib\Math\BigInteger\Engines\Engine
* @param array $nums
* @return Engine
*/
protected static function minHelper(array $nums)
{
@ -1023,7 +1031,8 @@ abstract class Engine implements \Serializable
/**
* Return the minimum BigInteger between an arbitrary number of BigIntegers.
*
* @return \phpseclib\Math\BigInteger\Engines\Engine
* @param array $nums
* @return Engine
*/
protected static function maxHelper(array $nums)
{

View File

@ -186,7 +186,8 @@ class GMP extends Engine
/**
* Adds two BigIntegers.
*
* @return \phpseclib\Math\BigInteger\Engines\GMP
* @param GMP $y
* @return GMP
*/
public function add(GMP $y)
{
@ -199,7 +200,8 @@ class GMP extends Engine
/**
* Subtracts two BigIntegers.
*
* @return \phpseclib\Math\BigInteger\Engines\GMP
* @param GMP $y
* @return GMP
*/
public function subtract(GMP $y)
{
@ -212,7 +214,8 @@ class GMP extends Engine
/**
* Multiplies two BigIntegers.
*
* @return \phpseclib\Math\BigInteger\Engines\GMP
* @param GMP $x
* @return GMP
*/
public function multiply(GMP $x)
{
@ -230,7 +233,8 @@ class GMP extends Engine
* same. If the remainder would be negative, the "common residue" is equal to the sum of the remainder
* and the divisor (basically, the "common residue" is the first positive modulo).
*
* @return \phpseclib\Math\BigInteger\Engines\GMP
* @param GMP $y
* @return GMP
*/
public function divide(GMP $y)
{
@ -258,6 +262,7 @@ class GMP extends Engine
*
* Note how the same comparison operator is used. If you want to test for equality, use $x->equals($y).
*
* @param GMP $y
* @return int < 0 if $this is less than $y; > 0 if $this is greater than $y, and 0 if they are equal.
* @access public
* @see self::equals()
@ -273,6 +278,7 @@ class GMP extends Engine
*
* If you need to see if one number is greater than or less than another number, use BigInteger::compare()
*
* @param GMP $x
* @return bool
*/
public function equals(GMP $x)
@ -285,7 +291,8 @@ class GMP extends Engine
*
* Say you have (30 mod 17 * x mod 17) mod 17 == 1. x can be found using modular inverses.
*
* @return \phpseclib\Math\BigInteger\Engines\GMP|false
* @param GMP $n
* @return false|GMP
*/
public function modInverse(GMP $n)
{
@ -322,7 +329,8 @@ class GMP extends Engine
*
* Say you have 693 and 609. The GCD is 21.
*
* @return \phpseclib\Math\BigInteger\Engines\GMP
* @param GMP $n
* @return GMP
*/
public function gcd(GMP $n)
{
@ -347,7 +355,8 @@ class GMP extends Engine
/**
* Logical And
*
* @return \phpseclib\Math\BigInteger\Engines\GMP
* @param GMP $x
* @return GMP
*/
public function bitwise_and(GMP $x)
{
@ -360,7 +369,8 @@ class GMP extends Engine
/**
* Logical Or
*
* @return \phpseclib\Math\BigInteger\Engines\GMP
* @param GMP $x
* @return GMP
*/
public function bitwise_or(GMP $x)
{
@ -373,7 +383,8 @@ class GMP extends Engine
/**
* Logical Exclusive Or
*
* @return \phpseclib\Math\BigInteger\Engines\GMP
* @param GMP $x
* @return GMP
*/
public function bitwise_xor(GMP $x)
{
@ -421,7 +432,9 @@ class GMP extends Engine
/**
* Performs modular exponentiation.
*
* @return \phpseclib\Math\BigInteger\Engines\GMP
* @param GMP $e
* @param GMP $n
* @return GMP
*/
public function modPow(GMP $e, GMP $n)
{
@ -433,7 +446,9 @@ class GMP extends Engine
*
* Alias for modPow().
*
* @return \phpseclib\Math\BigInteger\Engines\GMP
* @param GMP $e
* @param GMP $n
* @return GMP
*/
public function powMod(GMP $e, GMP $n)
{
@ -443,7 +458,9 @@ class GMP extends Engine
/**
* Performs modular exponentiation.
*
* @return \phpseclib\Math\BigInteger\Engines\GMP
* @param GMP $e
* @param GMP $n
* @return GMP
*/
protected function powModInner(GMP $e, GMP $n)
{
@ -456,7 +473,8 @@ class GMP extends Engine
*
* Removes leading zeros and truncates (if necessary) to maintain the appropriate precision
*
* @return \phpseclib\Math\BigInteger\Engines\GMP
* @param GMP $result
* @return GMP
*/
protected function normalize(GMP $result)
{
@ -473,7 +491,10 @@ class GMP extends Engine
/**
* Performs some post-processing for randomRangePrime
*
* @return \phpseclib\Math\BigInteger\Engines\GMP
* @param Engine $x
* @param Engine $min
* @param Engine $max
* @return GMP
*/
protected static function randomRangePrimeInner(Engine $x, Engine $min, Engine $max)
{
@ -495,7 +516,9 @@ class GMP extends Engine
*
* If there's not a prime within the given range, false will be returned.
*
* @return \phpseclib\Math\BigInteger\Engines\GMP|false
* @param GMP $min
* @param GMP $max
* @return false|GMP
*/
public static function randomRangePrime(GMP $min, GMP $max)
{
@ -511,7 +534,9 @@ class GMP extends Engine
* BigInteger::randomRange($min, $max)
* BigInteger::randomRange($max, $min)
*
* @return \phpseclib\Math\BigInteger\Engines\GMP
* @param GMP $min
* @param GMP $max
* @return GMP
*/
public static function randomRange(GMP $min, GMP $max)
{
@ -546,7 +571,8 @@ class GMP extends Engine
*
* Returns the nth root of a positive biginteger, where n defaults to 2
*
* @return \phpseclib\Math\BigInteger\Engines\GMP
* @param int $n
* @return GMP
*/
protected function rootInner($n)
{
@ -558,7 +584,8 @@ class GMP extends Engine
/**
* Performs exponentiation.
*
* @return \phpseclib\Math\BigInteger\Engines\GMP
* @param GMP $n
* @return GMP
*/
public function pow(GMP $n)
{
@ -571,7 +598,8 @@ class GMP extends Engine
/**
* Return the minimum BigInteger between an arbitrary number of BigIntegers.
*
* @return \phpseclib\Math\BigInteger\Engines\GMP
* @param GMP[] $nums
* @return GMP
*/
public static function min(GMP ...$nums)
{
@ -581,7 +609,8 @@ class GMP extends Engine
/**
* Return the maximum BigInteger between an arbitrary number of BigIntegers.
*
* @return \phpseclib\Math\BigInteger\Engines\GMP
* @param GMP[] $nums
* @return GMP
*/
public static function max(GMP ...$nums)
{
@ -591,7 +620,9 @@ class GMP extends Engine
/**
* Tests BigInteger to see if it is between two integers, inclusive
*
* @return boolean
* @param GMP $min
* @param GMP $max
* @return bool
*/
public function between(GMP $min, GMP $max)
{

View File

@ -29,7 +29,10 @@ abstract class DefaultEngine extends GMP
/**
* Performs modular exponentiation.
*
* @return \phpseclib\Math\BigInteger\Engines\GMP
* @param GMP $x
* @param GMP $e
* @param GMP $n
* @return GMP
*/
protected static function powModHelper(GMP $x, GMP $e, GMP $n)
{

View File

@ -40,7 +40,10 @@ abstract class OpenSSL
/**
* Performs modular exponentiation.
*
* @return \phpseclib\Math\BigInteger\Engines\Engine
* @param Engine $x
* @param Engine $e
* @param Engine $n
* @return Engine
*/
public static function powModHelper(Engine $x, Engine $e, Engine $n)
{

View File

@ -141,6 +141,7 @@ abstract class PHP extends Engine
/**
* Pads strings so that unpack may be used on them
*
* @param $str
* @return string
*/
protected function pad($str)
@ -673,6 +674,7 @@ abstract class PHP extends Engine
*
* abc / x = a00 / x + b0 / x + c / x
*
* @param array $dividend
* @param int $divisor
* @return array
*/
@ -732,7 +734,8 @@ abstract class PHP extends Engine
*
* Removes leading zeros and truncates (if necessary) to maintain the appropriate precision
*
* @return \phpseclib\Math\BigInteger\Engines\PHP
* @param $result
* @return PHP
*/
protected function normalize($result)
{
@ -802,7 +805,8 @@ abstract class PHP extends Engine
* combination is returned is dependent upon which mode is in use. See
* {@link http://en.wikipedia.org/wiki/B%C3%A9zout%27s_identity Bezout's identity - Wikipedia} for more information.
*
* @return \phpseclib\Math\BigInteger\Engines\PHP
* @param PHP $n
* @return PHP[]
* @internal Calculates the GCD using the binary xGCD algorithim described in
* {@link http://www.cacr.math.uwaterloo.ca/hac/about/chap14.pdf#page=19 HAC 14.61}. As the text above 14.61 notes,
* the more traditional algorithim requires "relatively costly multiple-precision divisions".
@ -886,7 +890,8 @@ abstract class PHP extends Engine
/**
* Logical And
*
* @return \phpseclib\Math\BigInteger\Engines\PHP
* @param PHP $x
* @return PHP
*/
protected function bitwiseAndHelper(PHP $x)
{
@ -906,7 +911,8 @@ abstract class PHP extends Engine
/**
* Logical Or
*
* @return \phpseclib\Math\BigInteger\Engines\PHP
* @param PHP $x
* @return PHP
*/
protected function bitwiseOrHelper(PHP $x)
{
@ -925,7 +931,8 @@ abstract class PHP extends Engine
/**
* Logical Exlusive Or
*
* @return \phpseclib\Math\BigInteger\Engines\PHP
* @param PHP $x
* @return PHP
*/
protected function bitwiseXorHelper(PHP $x)
{
@ -946,7 +953,8 @@ abstract class PHP extends Engine
*
* Removes leading zeros
*
* @return \phpseclib\Math\BigInteger\Engines\PHP
* @param array $value
* @return PHP
*/
protected static function trim(array $value)
{
@ -1144,7 +1152,9 @@ abstract class PHP extends Engine
/**
* Performs modular exponentiation.
*
* @return \phpseclib\Math\BigInteger\Engines\PHP
* @param PHP $e
* @param PHP $n
* @return PHP
*/
protected function powModInner(PHP $e, PHP $n)
{
@ -1159,6 +1169,7 @@ abstract class PHP extends Engine
/**
* Performs squaring
*
* @param array $x
* @return array
*/
protected static function square(array $x)
@ -1175,6 +1186,7 @@ abstract class PHP extends Engine
* {@link http://www.cacr.math.uwaterloo.ca/hac/about/chap14.pdf#page=7 HAC 14.2.4} /
* {@link http://math.libtomcrypt.com/files/tommath.pdf#page=141 MPM 5.3} for more information.
*
* @param array $value
* @return array
*/
protected static function baseSquare(array $value)
@ -1212,6 +1224,7 @@ abstract class PHP extends Engine
* See {@link http://en.wikipedia.org/wiki/Karatsuba_algorithm Karatsuba algorithm} and
* {@link http://math.libtomcrypt.com/files/tommath.pdf#page=151 MPM 5.3.4}.
*
* @param array $value
* @return array
*/
protected static function karatsubaSquare(array $value)
@ -1288,6 +1301,7 @@ abstract class PHP extends Engine
* ie. $s = gmp_scan1($n, 0) and $r = gmp_div_q($n, gmp_pow(gmp_init('2'), $s));
*
* @see self::isPrime()
* @param $r
* @return int
*/
protected static function scan1divide($r)
@ -1309,7 +1323,8 @@ abstract class PHP extends Engine
/**
* Performs exponentiation.
*
* @return \phpseclib\Math\BigInteger\Engines\PHP
* @param PHP $n
* @return PHP
*/
protected function powHelper(PHP $n)
{

View File

@ -444,10 +444,7 @@ abstract class EvalBarrett extends Base
* If you do echo floatval(pow(2, 52)) you'll get 4.6116860184274E+18. It /can/ be displayed without a loss of
* precision but displayed in this way there will be precision loss, hence the need for this method.
*
* @param string $x
* @param string $y
* @param string $result
* @param string $class
* @param $num
* @return string
*/
private static function float2string($num)

View File

@ -106,7 +106,8 @@ class PHP32 extends PHP
/**
* Adds two BigIntegers.
*
* @return \phpseclib\Math\BigInteger\Engines\PHP32
* @param PHP32 $y
* @return PHP32
*/
public function add(PHP32 $y)
{
@ -118,7 +119,8 @@ class PHP32 extends PHP
/**
* Subtracts two BigIntegers.
*
* @return \phpseclib\Math\BigInteger\Engines\PHP32
* @param PHP32 $y
* @return PHP32
*/
public function subtract(PHP32 $y)
{
@ -130,7 +132,8 @@ class PHP32 extends PHP
/**
* Multiplies two BigIntegers.
*
* @return \phpseclib\Math\BigInteger\Engines\PHP32
* @param PHP32 $y
* @return PHP32
*/
public function multiply(PHP32 $y)
{
@ -147,7 +150,8 @@ class PHP32 extends PHP
* same. If the remainder would be negative, the "common residue" is equal to the sum of the remainder
* and the divisor (basically, the "common residue" is the first positive modulo).
*
* @return \phpseclib\Math\BigInteger\Engines\PHP32
* @param PHP32 $y
* @return PHP32
*/
public function divide(PHP32 $y)
{
@ -158,6 +162,8 @@ class PHP32 extends PHP
* Calculates modular inverses.
*
* Say you have (30 mod 17 * x mod 17) mod 17 == 1. x can be found using modular inverses.
* @param PHP32 $n
* @return false|Engine
*/
public function modInverse(PHP32 $n)
{
@ -168,6 +174,8 @@ class PHP32 extends PHP
* Calculates modular inverses.
*
* Say you have (30 mod 17 * x mod 17) mod 17 == 1. x can be found using modular inverses.
* @param PHP32 $n
* @return PHP[]
*/
public function extendedGCD(PHP32 $n)
{
@ -179,7 +187,8 @@ class PHP32 extends PHP
*
* Say you have 693 and 609. The GCD is 21.
*
* @return \phpseclib\Math\BigInteger\Engines\PHP32
* @param PHP32 $n
* @return PHP32
*/
public function gcd(PHP32 $n)
{
@ -190,7 +199,8 @@ class PHP32 extends PHP
/**
* Logical And
*
* @return \phpseclib\Math\BigInteger\Engines\PHP32
* @param PHP32 $x
* @return PHP32
*/
public function bitwise_and(PHP32 $x)
{
@ -200,7 +210,8 @@ class PHP32 extends PHP
/**
* Logical Or
*
* @return \phpseclib\Math\BigInteger\Engines\PHP32
* @param PHP32 $x
* @return PHP32
*/
public function bitwise_or(PHP32 $x)
{
@ -210,7 +221,8 @@ class PHP32 extends PHP
/**
* Logical Exlusive Or
*
* @return \phpseclib\Math\BigInteger\Engines\PHP32
* @param PHP32 $x
* @return PHP32
*/
public function bitwise_xor(PHP32 $x)
{
@ -229,6 +241,7 @@ class PHP32 extends PHP
*
* Note how the same comparison operator is used. If you want to test for equality, use $x->equals($y).
*
* @param PHP32 $y
* @return int < 0 if $this is less than $y; > 0 if $this is greater than $y, and 0 if they are equal.
* @access public
* @see self::equals()
@ -244,6 +257,7 @@ class PHP32 extends PHP
*
* If you need to see if one number is greater than or less than another number, use BigInteger::compare()
*
* @param PHP32 $x
* @return bool
*/
public function equals(PHP32 $x)
@ -254,7 +268,9 @@ class PHP32 extends PHP
/**
* Performs modular exponentiation.
*
* @return \phpseclib\Math\BigInteger\Engines\PHP32
* @param PHP32 $e
* @param PHP32 $n
* @return PHP32
*/
public function modPow(PHP32 $e, PHP32 $n)
{
@ -266,7 +282,9 @@ class PHP32 extends PHP
*
* Alias for modPow().
*
* @return \phpseclib\Math\BigInteger\Engines\PHP32
* @param PHP32 $e
* @param PHP32 $n
* @return PHP32
*/
public function powMod(PHP32 $e, PHP32 $n)
{
@ -278,7 +296,9 @@ class PHP32 extends PHP
*
* If there's not a prime within the given range, false will be returned.
*
* @return \phpseclib\Math\BigInteger\Engines\PHP32|false
* @param PHP32 $min
* @param PHP32 $max
* @return false|PHP32
*/
public static function randomRangePrime(PHP32 $min, PHP32 $max)
{
@ -294,7 +314,9 @@ class PHP32 extends PHP
* BigInteger::randomRange($min, $max)
* BigInteger::randomRange($max, $min)
*
* @return \phpseclib\Math\BigInteger\Engines\PHP32
* @param PHP32 $min
* @param PHP32 $max
* @return PHP32
*/
public static function randomRange(PHP32 $min, PHP32 $max)
{
@ -304,7 +326,8 @@ class PHP32 extends PHP
/**
* Performs exponentiation.
*
* @return \phpseclib\Math\BigInteger\Engines\PHP64
* @param PHP32 $n
* @return PHP64
*/
public function pow(PHP32 $n)
{
@ -314,7 +337,8 @@ class PHP32 extends PHP
/**
* Return the minimum BigInteger between an arbitrary number of BigIntegers.
*
* @return \phpseclib\Math\BigInteger\Engines\PHP32
* @param PHP32[] $nums
* @return PHP32
*/
public static function min(PHP32 ...$nums)
{
@ -324,7 +348,8 @@ class PHP32 extends PHP
/**
* Return the maximum BigInteger between an arbitrary number of BigIntegers.
*
* @return \phpseclib\Math\BigInteger\Engines\PHP32
* @param PHP32[] $nums
* @return PHP32
*/
public static function max(PHP32 ...$nums)
{
@ -334,7 +359,9 @@ class PHP32 extends PHP
/**
* Tests BigInteger to see if it is between two integers, inclusive
*
* @return boolean
* @param PHP32 $min
* @param PHP32 $max
* @return bool
*/
public function between(PHP32 $min, PHP32 $max)
{

View File

@ -106,7 +106,8 @@ class PHP64 extends PHP
/**
* Adds two BigIntegers.
*
* @return \phpseclib\Math\BigInteger\Engines\PHP64
* @param PHP64 $y
* @return PHP64
*/
public function add(PHP64 $y)
{
@ -118,7 +119,8 @@ class PHP64 extends PHP
/**
* Subtracts two BigIntegers.
*
* @return \phpseclib\Math\BigInteger\Engines\PHP64
* @param PHP64 $y
* @return PHP64
*/
public function subtract(PHP64 $y)
{
@ -130,7 +132,8 @@ class PHP64 extends PHP
/**
* Multiplies two BigIntegers.
*
* @return \phpseclib\Math\BigInteger\Engines\PHP64
* @param PHP64 $y
* @return PHP64
*/
public function multiply(PHP64 $y)
{
@ -147,7 +150,8 @@ class PHP64 extends PHP
* same. If the remainder would be negative, the "common residue" is equal to the sum of the remainder
* and the divisor (basically, the "common residue" is the first positive modulo).
*
* @return \phpseclib\Math\BigInteger\Engines\PHP64
* @param PHP64 $y
* @return PHP64
*/
public function divide(PHP64 $y)
{
@ -158,6 +162,8 @@ class PHP64 extends PHP
* Calculates modular inverses.
*
* Say you have (30 mod 17 * x mod 17) mod 17 == 1. x can be found using modular inverses.
* @param PHP64 $n
* @return false|Engine
*/
public function modInverse(PHP64 $n)
{
@ -168,6 +174,8 @@ class PHP64 extends PHP
* Calculates modular inverses.
*
* Say you have (30 mod 17 * x mod 17) mod 17 == 1. x can be found using modular inverses.
* @param PHP64 $n
* @return PHP[]
*/
public function extendedGCD(PHP64 $n)
{
@ -179,7 +187,8 @@ class PHP64 extends PHP
*
* Say you have 693 and 609. The GCD is 21.
*
* @return \phpseclib\Math\BigInteger\Engines\PHP64
* @param PHP64 $n
* @return PHP64
*/
public function gcd(PHP64 $n)
{
@ -190,7 +199,8 @@ class PHP64 extends PHP
/**
* Logical And
*
* @return \phpseclib\Math\BigInteger\Engines\PHP64
* @param PHP64 $x
* @return PHP64
*/
public function bitwise_and(PHP64 $x)
{
@ -200,7 +210,8 @@ class PHP64 extends PHP
/**
* Logical Or
*
* @return \phpseclib\Math\BigInteger\Engines\PHP64
* @param PHP64 $x
* @return PHP64
*/
public function bitwise_or(PHP64 $x)
{
@ -210,7 +221,8 @@ class PHP64 extends PHP
/**
* Logical Exlusive Or
*
* @return \phpseclib\Math\BigInteger\Engines\PHP64
* @param PHP64 $x
* @return PHP64
*/
public function bitwise_xor(PHP64 $x)
{
@ -229,6 +241,7 @@ class PHP64 extends PHP
*
* Note how the same comparison operator is used. If you want to test for equality, use $x->equals($y).
*
* @param PHP64 $y
* @return int < 0 if $this is less than $y; > 0 if $this is greater than $y, and 0 if they are equal.
* @access public
* @see self::equals()
@ -244,6 +257,7 @@ class PHP64 extends PHP
*
* If you need to see if one number is greater than or less than another number, use BigInteger::compare()
*
* @param PHP64 $x
* @return bool
*/
public function equals(PHP64 $x)
@ -254,7 +268,9 @@ class PHP64 extends PHP
/**
* Performs modular exponentiation.
*
* @return \phpseclib\Math\BigInteger\Engines\PHP64
* @param PHP64 $e
* @param PHP64 $n
* @return PHP64
*/
public function modPow(PHP64 $e, PHP64 $n)
{
@ -266,7 +282,9 @@ class PHP64 extends PHP
*
* Alias for modPow().
*
* @return \phpseclib\Math\BigInteger\Engines\PHP64
* @param PHP64 $e
* @param PHP64 $n
* @return PHP64
*/
public function powMod(PHP64 $e, PHP64 $n)
{
@ -278,7 +296,9 @@ class PHP64 extends PHP
*
* If there's not a prime within the given range, false will be returned.
*
* @return \phpseclib\Math\BigInteger\Engines\PHP64|false
* @param PHP64 $min
* @param PHP64 $max
* @return false|PHP64
*/
public static function randomRangePrime(PHP64 $min, PHP64 $max)
{
@ -294,7 +314,9 @@ class PHP64 extends PHP
* BigInteger::randomRange($min, $max)
* BigInteger::randomRange($max, $min)
*
* @return \phpseclib\Math\BigInteger\Engines\PHP64
* @param PHP64 $min
* @param PHP64 $max
* @return PHP64
*/
public static function randomRange(PHP64 $min, PHP64 $max)
{
@ -304,7 +326,8 @@ class PHP64 extends PHP
/**
* Performs exponentiation.
*
* @return \phpseclib\Math\BigInteger\Engines\PHP64
* @param PHP64 $n
* @return PHP64
*/
public function pow(PHP64 $n)
{
@ -314,7 +337,8 @@ class PHP64 extends PHP
/**
* Return the minimum BigInteger between an arbitrary number of BigIntegers.
*
* @return \phpseclib\Math\BigInteger\Engines\PHP64
* @param PHP64[] $nums
* @return PHP64
*/
public static function min(PHP64 ...$nums)
{
@ -324,7 +348,8 @@ class PHP64 extends PHP
/**
* Return the maximum BigInteger between an arbitrary number of BigIntegers.
*
* @return \phpseclib\Math\BigInteger\Engines\PHP64
* @param PHP64[] $nums
* @return PHP64
*/
public static function max(PHP64 ...$nums)
{
@ -334,7 +359,9 @@ class PHP64 extends PHP
/**
* Tests BigInteger to see if it is between two integers, inclusive
*
* @return boolean
* @param PHP64 $min
* @param PHP64 $max
* @return bool
*/
public function between(PHP64 $min, PHP64 $max)
{

View File

@ -104,7 +104,6 @@ class SCP
* Connects to an SSH server
*
* @param \phpseclib\Net\SSH1|\phpseclib\Net\SSH2 $ssh
* @return \phpseclib\Net\SCP
* @access public
*/
public function __construct($ssh)
@ -212,7 +211,7 @@ class SCP
* operation
*
* @param string $remote_file
* @param string $local_file
* @param string|boolean $local_file
* @return mixed
* @access public
*/

View File

@ -1180,7 +1180,7 @@ class SFTP extends SSH2
*
* Mainly used by file_exists
*
* @param string $dir
* @param $path
* @return mixed
* @access private
*/
@ -1733,6 +1733,8 @@ class SFTP extends SSH2
* Creates a directory.
*
* @param string $dir
* @param int $mode
* @param bool $recursive
* @return bool
* @access public
*/
@ -1768,8 +1770,8 @@ class SFTP extends SSH2
* Helper function for directory creation
*
* @param string $dir
* @param $attr
* @return bool
* @throws \UnexpectedValueException on receipt of unexpected packets
* @access private
*/
private function mkdir_helper($dir, $attr)
@ -2115,7 +2117,7 @@ class SFTP extends SSH2
* $offset and $length can be used to download files in chunks.
*
* @param string $remote_file
* @param string $local_file
* @param string|boolean|resource $local_file
* @param int $offset
* @param int $length
* @throws \UnexpectedValueException on receipt of unexpected packets
@ -2666,6 +2668,7 @@ class SFTP extends SSH2
*
* @param string $path
* @param string $prop
* @param $type
* @return mixed
* @access private
*/

View File

@ -626,7 +626,6 @@ class Stream
* $options. What does 8 correspond to?
*
* @param string $path
* @param int $mode
* @param int $options
* @return bool
* @access public

View File

@ -234,7 +234,7 @@ class SSH1
/**
* The Socket Object
*
* @var object
* @var resource
* @access private
*/
private $fsock;
@ -812,8 +812,8 @@ class SSH1
* @see self::interactiveRead()
* @see self::interactiveWrite()
* @param string $cmd
* @param bool $block
* @return mixed
* @throws \RuntimeException on error sending command
* @access public
*/
public function exec($cmd, $block = true)
@ -1558,7 +1558,8 @@ class SSH1
*
* Makes sure that only the last 1MB worth of packets will be logged
*
* @param string $data
* @param $protocol_flags
* @param $message
* @access private
*/
private function append_log($protocol_flags, $message)

View File

@ -1292,8 +1292,8 @@ class SSH2
/**
* Key Exchange
*
* @param string $kexinit_payload_server optional
* @return boolean
* @param string|boolean $kexinit_payload_server optional
* @throws \UnexpectedValueException on receipt of unexpected packets
* @throws \RuntimeException on other errors
* @throws \phpseclib\Exception\NoSupportedAlgorithmsException when none of the algorithms phpseclib has loaded are compatible
@ -3220,8 +3220,8 @@ class SSH2
* See '6. Binary Packet Protocol' of rfc4253 for more info.
*
* @see self::_send_binary_packet()
* @param bool $filter_channel_packets
* @return string
* @throws \RuntimeException on connection errors
* @access private
*/
private function get_binary_packet($filter_channel_packets = false)
@ -3314,6 +3314,8 @@ class SSH2
* Because some binary packets need to be ignored...
*
* @see self::_get_binary_packet()
* @param $payload
* @param $filter_channel_packets
* @return string
* @access private
*/
@ -3551,6 +3553,7 @@ class SSH2
* Returns the data as a string if it's available and false if not.
*
* @param $client_channel
* @param boolean $skip_extended
* @return mixed
* @throws \RuntimeException on connection error
* @access private
@ -3871,7 +3874,8 @@ class SSH2
*
* Makes sure that only the last 1MB worth of packets will be logged
*
* @param string $data
* @param $message_number
* @param $message
* @access private
*/
private function append_log($message_number, $message)

View File

@ -107,7 +107,7 @@ class Identity
*
* Wrapper for $this->key->getPublicKey()
*
* @param int $type optional
* @param string $type optional
* @return mixed
* @access public
*/