Merge remote-tracking branch 'rrran/Fixes3'

This commit is contained in:
terrafrost 2017-11-05 13:16:03 -06:00
commit 10828543ce
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 * Accesses a private variable from an object
* *
* @param Object $obj * @param object $obj
* @param string $var * @param string $var
* @return mixed * @return mixed
* @access public * @access public
@ -42,7 +42,7 @@ abstract class Objects
/** /**
* Sets the value of a private variable in an object * Sets the value of a private variable in an object
* *
* @param Object $obj * @param object $obj
* @param string $var * @param string $var
* @param mixed $val * @param mixed $val
* @access public * @access public
@ -58,7 +58,7 @@ abstract class Objects
/** /**
* Accesses a private method from an object * Accesses a private method from an object
* *
* @param Object $obj * @param object $obj
* @param string $func * @param string $func
* @param array $params * @param array $params
* @return mixed * @return mixed

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -344,7 +344,7 @@ class RC2 extends BlockCipher
* @see \phpseclib\Crypt\Common\SymmetricKey::setKey() * @see \phpseclib\Crypt\Common\SymmetricKey::setKey()
* @access public * @access public
* @param string $key * @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 * @throws \LengthException if the key length isn't supported
*/ */
public function setKey($key, $t1 = false) 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. * Keys can be between 1 and 256 bytes long.
* *
* @access public * @access public
* @param int $length * @param string $key
* @throws \LengthException if the key length is invalid
*/ */
public function setKey($key) public function setKey($key)
{ {
@ -256,7 +255,7 @@ class RC4 extends StreamCipher
/** /**
* Encrypts a block * Encrypts a block
* * @return null
* @access private * @access private
* @param string $in * @param string $in
*/ */
@ -267,7 +266,7 @@ class RC4 extends StreamCipher
/** /**
* Decrypts a block * Decrypts a block
* * @return null
* @access private * @access private
* @param string $in * @param string $in
*/ */

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1926,8 +1926,9 @@ class X509
* Load a Certificate Signing Request * Load a Certificate Signing Request
* *
* @param string $csr * @param string $csr
* @access public * @param int $mode
* @return mixed * @return mixed
* @access public
*/ */
public function loadCSR($csr, $mode = self::FORMAT_AUTO_DETECT) public function loadCSR($csr, $mode = self::FORMAT_AUTO_DETECT)
{ {
@ -2164,8 +2165,9 @@ class X509
* Load a Certificate Revocation List * Load a Certificate Revocation List
* *
* @param string $crl * @param string $crl
* @access public * @param int $mode
* @return mixed * @return mixed
* @access public
*/ */
public function loadCRL($crl, $mode = self::FORMAT_AUTO_DETECT) public function loadCRL($crl, $mode = self::FORMAT_AUTO_DETECT)
{ {
@ -2498,6 +2500,7 @@ class X509
* Sign a CSR * Sign a CSR
* *
* @access public * @access public
* @param string $signatureAlgorithm
* @return mixed * @return mixed
*/ */
public function signCSR($signatureAlgorithm = 'sha1WithRSAEncryption') public function signCSR($signatureAlgorithm = 'sha1WithRSAEncryption')
@ -2556,6 +2559,7 @@ class X509
* Sign a SPKAC * Sign a SPKAC
* *
* @access public * @access public
* @param string $signatureAlgorithm
* @return mixed * @return mixed
*/ */
public function signSPKAC($signatureAlgorithm = 'sha1WithRSAEncryption') public function signSPKAC($signatureAlgorithm = 'sha1WithRSAEncryption')
@ -2754,7 +2758,6 @@ class X509
* X.509 certificate signing helper function. * X.509 certificate signing helper function.
* *
* @param object $key * @param object $key
* @param \phpseclib\File\X509 $subject
* @param string $signatureAlgorithm * @param string $signatureAlgorithm
* @access public * @access public
* @throws \phpseclib\Exception\UnsupportedAlgorithmException if the algorithm is unsupported * @throws \phpseclib\Exception\UnsupportedAlgorithmException if the algorithm is unsupported
@ -3299,7 +3302,7 @@ class X509
* *
* @param string $id * @param string $id
* @param mixed $value * @param mixed $value
* @param bool $disposition optional * @param int $disposition optional
* @access public * @access public
* @return bool * @return bool
*/ */

View File

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

View File

@ -204,7 +204,8 @@ class BCMath extends Engine
/** /**
* Adds two BigIntegers. * Adds two BigIntegers.
* *
* @return \phpseclib\Math\BigInteger\Engines\BCMath * @param BCMath $y
* @return BCMath
*/ */
public function add(BCMath $y) public function add(BCMath $y)
{ {
@ -217,7 +218,8 @@ class BCMath extends Engine
/** /**
* Subtracts two BigIntegers. * Subtracts two BigIntegers.
* *
* @return \phpseclib\Math\BigInteger\Engines\BCMath * @param BCMath $y
* @return BCMath
*/ */
public function subtract(BCMath $y) public function subtract(BCMath $y)
{ {
@ -230,7 +232,8 @@ class BCMath extends Engine
/** /**
* Multiplies two BigIntegers. * Multiplies two BigIntegers.
* *
* @return \phpseclib\Math\BigInteger\Engines\BCMath * @param BCMath $x
* @return BCMath
*/ */
public function multiply(BCMath $x) 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 * 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). * 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) 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. * 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 * @param \phpseclib\Math\BigInteger\Engines\BCMath $n
*/ */
public function modInverse(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 * 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. * {@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) public function extendedGCD(BCMath $n)
{ {
@ -329,7 +335,8 @@ class BCMath extends Engine
* *
* Say you have 693 and 609. The GCD is 21. * 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) public function gcd(BCMath $n)
{ {
@ -355,7 +362,8 @@ class BCMath extends Engine
/** /**
* Logical And * Logical And
* *
* @return \phpseclib\Math\BigInteger\Engines\BCMath * @param BCMath $x
* @return BCMath
*/ */
public function bitwise_and(BCMath $x) public function bitwise_and(BCMath $x)
{ {
@ -373,7 +381,8 @@ class BCMath extends Engine
/** /**
* Logical Or * Logical Or
* *
* @return \phpseclib\Math\BigInteger\Engines\BCMath * @param BCMath $x
* @return BCMath
*/ */
public function bitwise_or(BCMath $x) public function bitwise_or(BCMath $x)
{ {
@ -391,7 +400,8 @@ class BCMath extends Engine
/** /**
* Logical Exlusive Or * Logical Exlusive Or
* *
* @return \phpseclib\Math\BigInteger\Engines\BCMath * @param BCMath $x
* @return BCMath
*/ */
public function bitwise_xor(BCMath $x) 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). * 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. * @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() * @see self::equals()
* @internal Could return $this->subtract($x), but that's not as fast as what we do do. * @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() * If you need to see if one number is greater than or less than another number, use BigInteger::compare()
* *
* @param BCMath $x
* @return bool * @return bool
*/ */
public function equals(BCMath $x) public function equals(BCMath $x)
@ -475,7 +486,9 @@ class BCMath extends Engine
/** /**
* Performs modular exponentiation. * Performs modular exponentiation.
* *
* @return \phpseclib\Math\BigInteger\Engines\BCMath * @param BCMath $e
* @param BCMath $n
* @return BCMath
*/ */
public function modPow(BCMath $e, BCMath $n) public function modPow(BCMath $e, BCMath $n)
{ {
@ -487,7 +500,9 @@ class BCMath extends Engine
* *
* Alias for modPow(). * Alias for modPow().
* *
* @return \phpseclib\Math\BigInteger\Engines\BCMath * @param BCMath $e
* @param BCMath $n
* @return BCMath
*/ */
public function powMod(BCMath $e, BCMath $n) public function powMod(BCMath $e, BCMath $n)
{ {
@ -497,7 +512,9 @@ class BCMath extends Engine
/** /**
* Performs modular exponentiation. * Performs modular exponentiation.
* *
* @return \phpseclib\Math\BigInteger\Engines\BCMath * @param BCMath $e
* @param BCMath $n
* @return BCMath
*/ */
protected function powModInner(BCMath $e, BCMath $n) 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 * 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) 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. * 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) public static function randomRangePrime(BCMath $min, BCMath $max)
{ {
@ -549,7 +569,9 @@ class BCMath extends Engine
* BigInteger::randomRange($min, $max) * BigInteger::randomRange($min, $max)
* BigInteger::randomRange($max, $min) * 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) 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)); * ie. $s = gmp_scan1($n, 0) and $r = gmp_div_q($n, gmp_pow(gmp_init('2'), $s));
* *
* @see self::isPrime() * @see self::isPrime()
* @param $r
* @return int * @return int
*/ */
protected static function scan1divide($r) protected static function scan1divide($r)
@ -623,7 +646,8 @@ class BCMath extends Engine
/** /**
* Performs exponentiation. * Performs exponentiation.
* *
* @return \phpseclib\Math\BigInteger\Engines\BCMath * @param BCMath $n
* @return BCMath
*/ */
public function pow(BCMath $n) public function pow(BCMath $n)
{ {
@ -636,7 +660,8 @@ class BCMath extends Engine
/** /**
* Return the minimum BigInteger between an arbitrary number of BigIntegers. * 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) 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 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) 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 * 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) public function between(BCMath $min, BCMath $max)
{ {
@ -666,6 +694,7 @@ class BCMath extends Engine
/** /**
* Set Bitmask * Set Bitmask
* *
* @returns Engine
* @param int $bits * @param int $bits
* @see self::setPrecision() * @see self::setPrecision()
*/ */

View File

@ -29,7 +29,10 @@ abstract class BuiltIn extends BCMath
/** /**
* Performs modular exponentiation. * 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) protected static function powModHelper(BCMath $x, BCMath $e, BCMath $n)
{ {

View File

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

View File

@ -184,7 +184,8 @@ class GMP extends Engine
/** /**
* Adds two BigIntegers. * Adds two BigIntegers.
* *
* @return \phpseclib\Math\BigInteger\Engines\GMP * @param GMP $y
* @return GMP
*/ */
public function add(GMP $y) public function add(GMP $y)
{ {
@ -197,7 +198,8 @@ class GMP extends Engine
/** /**
* Subtracts two BigIntegers. * Subtracts two BigIntegers.
* *
* @return \phpseclib\Math\BigInteger\Engines\GMP * @param GMP $y
* @return GMP
*/ */
public function subtract(GMP $y) public function subtract(GMP $y)
{ {
@ -210,7 +212,8 @@ class GMP extends Engine
/** /**
* Multiplies two BigIntegers. * Multiplies two BigIntegers.
* *
* @return \phpseclib\Math\BigInteger\Engines\GMP * @param GMP $x
* @return GMP
*/ */
public function multiply(GMP $x) public function multiply(GMP $x)
{ {
@ -228,7 +231,8 @@ class GMP extends Engine
* same. If the remainder would be negative, the "common residue" is equal to the sum of the remainder * 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). * 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) public function divide(GMP $y)
{ {
@ -256,6 +260,7 @@ class GMP extends Engine
* *
* Note how the same comparison operator is used. If you want to test for equality, use $x->equals($y). * 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. * @return int < 0 if $this is less than $y; > 0 if $this is greater than $y, and 0 if they are equal.
* @access public * @access public
* @see self::equals() * @see self::equals()
@ -271,6 +276,7 @@ class GMP extends Engine
* *
* If you need to see if one number is greater than or less than another number, use BigInteger::compare() * If you need to see if one number is greater than or less than another number, use BigInteger::compare()
* *
* @param GMP $x
* @return bool * @return bool
*/ */
public function equals(GMP $x) public function equals(GMP $x)
@ -283,7 +289,8 @@ class GMP extends Engine
* *
* Say you have (30 mod 17 * x mod 17) mod 17 == 1. x can be found using modular inverses. * 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) public function modInverse(GMP $n)
{ {
@ -320,7 +327,8 @@ class GMP extends Engine
* *
* Say you have 693 and 609. The GCD is 21. * 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) public function gcd(GMP $n)
{ {
@ -345,7 +353,8 @@ class GMP extends Engine
/** /**
* Logical And * Logical And
* *
* @return \phpseclib\Math\BigInteger\Engines\GMP * @param GMP $x
* @return GMP
*/ */
public function bitwise_and(GMP $x) public function bitwise_and(GMP $x)
{ {
@ -358,7 +367,8 @@ class GMP extends Engine
/** /**
* Logical Or * Logical Or
* *
* @return \phpseclib\Math\BigInteger\Engines\GMP * @param GMP $x
* @return GMP
*/ */
public function bitwise_or(GMP $x) public function bitwise_or(GMP $x)
{ {
@ -371,7 +381,8 @@ class GMP extends Engine
/** /**
* Logical Exclusive Or * Logical Exclusive Or
* *
* @return \phpseclib\Math\BigInteger\Engines\GMP * @param GMP $x
* @return GMP
*/ */
public function bitwise_xor(GMP $x) public function bitwise_xor(GMP $x)
{ {
@ -419,7 +430,9 @@ class GMP extends Engine
/** /**
* Performs modular exponentiation. * Performs modular exponentiation.
* *
* @return \phpseclib\Math\BigInteger\Engines\GMP * @param GMP $e
* @param GMP $n
* @return GMP
*/ */
public function modPow(GMP $e, GMP $n) public function modPow(GMP $e, GMP $n)
{ {
@ -431,7 +444,9 @@ class GMP extends Engine
* *
* Alias for modPow(). * Alias for modPow().
* *
* @return \phpseclib\Math\BigInteger\Engines\GMP * @param GMP $e
* @param GMP $n
* @return GMP
*/ */
public function powMod(GMP $e, GMP $n) public function powMod(GMP $e, GMP $n)
{ {
@ -441,7 +456,9 @@ class GMP extends Engine
/** /**
* Performs modular exponentiation. * Performs modular exponentiation.
* *
* @return \phpseclib\Math\BigInteger\Engines\GMP * @param GMP $e
* @param GMP $n
* @return GMP
*/ */
protected function powModInner(GMP $e, GMP $n) protected function powModInner(GMP $e, GMP $n)
{ {
@ -454,7 +471,8 @@ class GMP extends Engine
* *
* Removes leading zeros and truncates (if necessary) to maintain the appropriate precision * 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) protected function normalize(GMP $result)
{ {
@ -471,7 +489,10 @@ class GMP extends Engine
/** /**
* Performs some post-processing for randomRangePrime * 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) protected static function randomRangePrimeInner(Engine $x, Engine $min, Engine $max)
{ {
@ -493,7 +514,9 @@ class GMP extends Engine
* *
* If there's not a prime within the given range, false will be returned. * 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) public static function randomRangePrime(GMP $min, GMP $max)
{ {
@ -509,7 +532,9 @@ class GMP extends Engine
* BigInteger::randomRange($min, $max) * BigInteger::randomRange($min, $max)
* BigInteger::randomRange($max, $min) * 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) public static function randomRange(GMP $min, GMP $max)
{ {
@ -544,7 +569,8 @@ class GMP extends Engine
* *
* Returns the nth root of a positive biginteger, where n defaults to 2 * 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) protected function rootInner($n)
{ {
@ -556,7 +582,8 @@ class GMP extends Engine
/** /**
* Performs exponentiation. * Performs exponentiation.
* *
* @return \phpseclib\Math\BigInteger\Engines\GMP * @param GMP $n
* @return GMP
*/ */
public function pow(GMP $n) public function pow(GMP $n)
{ {
@ -569,7 +596,8 @@ class GMP extends Engine
/** /**
* Return the minimum BigInteger between an arbitrary number of BigIntegers. * 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) public static function min(GMP ...$nums)
{ {
@ -579,7 +607,8 @@ class GMP extends Engine
/** /**
* Return the maximum BigInteger between an arbitrary number of BigIntegers. * 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) public static function max(GMP ...$nums)
{ {
@ -589,7 +618,9 @@ class GMP extends Engine
/** /**
* Tests BigInteger to see if it is between two integers, inclusive * 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) public function between(GMP $min, GMP $max)
{ {

View File

@ -29,7 +29,10 @@ abstract class DefaultEngine extends GMP
/** /**
* Performs modular exponentiation. * 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) protected static function powModHelper(GMP $x, GMP $e, GMP $n)
{ {

View File

@ -40,7 +40,10 @@ abstract class OpenSSL
/** /**
* Performs modular exponentiation. * 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) 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 * Pads strings so that unpack may be used on them
* *
* @param $str
* @return string * @return string
*/ */
protected function pad($str) protected function pad($str)
@ -673,6 +674,7 @@ abstract class PHP extends Engine
* *
* abc / x = a00 / x + b0 / x + c / x * abc / x = a00 / x + b0 / x + c / x
* *
* @param array $dividend
* @param int $divisor * @param int $divisor
* @return array * @return array
*/ */
@ -732,7 +734,8 @@ abstract class PHP extends Engine
* *
* Removes leading zeros and truncates (if necessary) to maintain the appropriate precision * 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) 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 * 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. * {@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 * @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, * {@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". * the more traditional algorithim requires "relatively costly multiple-precision divisions".
@ -886,7 +890,8 @@ abstract class PHP extends Engine
/** /**
* Logical And * Logical And
* *
* @return \phpseclib\Math\BigInteger\Engines\PHP * @param PHP $x
* @return PHP
*/ */
protected function bitwiseAndHelper(PHP $x) protected function bitwiseAndHelper(PHP $x)
{ {
@ -906,7 +911,8 @@ abstract class PHP extends Engine
/** /**
* Logical Or * Logical Or
* *
* @return \phpseclib\Math\BigInteger\Engines\PHP * @param PHP $x
* @return PHP
*/ */
protected function bitwiseOrHelper(PHP $x) protected function bitwiseOrHelper(PHP $x)
{ {
@ -925,7 +931,8 @@ abstract class PHP extends Engine
/** /**
* Logical Exlusive Or * Logical Exlusive Or
* *
* @return \phpseclib\Math\BigInteger\Engines\PHP * @param PHP $x
* @return PHP
*/ */
protected function bitwiseXorHelper(PHP $x) protected function bitwiseXorHelper(PHP $x)
{ {
@ -946,7 +953,8 @@ abstract class PHP extends Engine
* *
* Removes leading zeros * Removes leading zeros
* *
* @return \phpseclib\Math\BigInteger\Engines\PHP * @param array $value
* @return PHP
*/ */
protected static function trim(array $value) protected static function trim(array $value)
{ {
@ -1144,7 +1152,9 @@ abstract class PHP extends Engine
/** /**
* Performs modular exponentiation. * Performs modular exponentiation.
* *
* @return \phpseclib\Math\BigInteger\Engines\PHP * @param PHP $e
* @param PHP $n
* @return PHP
*/ */
protected function powModInner(PHP $e, PHP $n) protected function powModInner(PHP $e, PHP $n)
{ {
@ -1159,6 +1169,7 @@ abstract class PHP extends Engine
/** /**
* Performs squaring * Performs squaring
* *
* @param array $x
* @return array * @return array
*/ */
protected static function square(array $x) 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://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. * {@link http://math.libtomcrypt.com/files/tommath.pdf#page=141 MPM 5.3} for more information.
* *
* @param array $value
* @return array * @return array
*/ */
protected static function baseSquare(array $value) 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 * 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}. * {@link http://math.libtomcrypt.com/files/tommath.pdf#page=151 MPM 5.3.4}.
* *
* @param array $value
* @return array * @return array
*/ */
protected static function karatsubaSquare(array $value) 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)); * ie. $s = gmp_scan1($n, 0) and $r = gmp_div_q($n, gmp_pow(gmp_init('2'), $s));
* *
* @see self::isPrime() * @see self::isPrime()
* @param $r
* @return int * @return int
*/ */
protected static function scan1divide($r) protected static function scan1divide($r)
@ -1309,7 +1323,8 @@ abstract class PHP extends Engine
/** /**
* Performs exponentiation. * Performs exponentiation.
* *
* @return \phpseclib\Math\BigInteger\Engines\PHP * @param PHP $n
* @return PHP
*/ */
protected function powHelper(PHP $n) protected function powHelper(PHP $n)
{ {

View File

@ -461,10 +461,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 * 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. * precision but displayed in this way there will be precision loss, hence the need for this method.
* *
* @param string $x * @param $num
* @param string $y
* @param string $result
* @param string $class
* @return string * @return string
*/ */
private static function float2string($num) private static function float2string($num)

View File

@ -106,7 +106,8 @@ class PHP32 extends PHP
/** /**
* Adds two BigIntegers. * Adds two BigIntegers.
* *
* @return \phpseclib\Math\BigInteger\Engines\PHP32 * @param PHP32 $y
* @return PHP32
*/ */
public function add(PHP32 $y) public function add(PHP32 $y)
{ {
@ -118,7 +119,8 @@ class PHP32 extends PHP
/** /**
* Subtracts two BigIntegers. * Subtracts two BigIntegers.
* *
* @return \phpseclib\Math\BigInteger\Engines\PHP32 * @param PHP32 $y
* @return PHP32
*/ */
public function subtract(PHP32 $y) public function subtract(PHP32 $y)
{ {
@ -130,7 +132,8 @@ class PHP32 extends PHP
/** /**
* Multiplies two BigIntegers. * Multiplies two BigIntegers.
* *
* @return \phpseclib\Math\BigInteger\Engines\PHP32 * @param PHP32 $y
* @return PHP32
*/ */
public function multiply(PHP32 $y) 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 * 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). * 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) public function divide(PHP32 $y)
{ {
@ -158,6 +162,8 @@ class PHP32 extends PHP
* Calculates modular inverses. * Calculates modular inverses.
* *
* Say you have (30 mod 17 * x mod 17) mod 17 == 1. x can be found using 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) public function modInverse(PHP32 $n)
{ {
@ -168,6 +174,8 @@ class PHP32 extends PHP
* Calculates modular inverses. * Calculates modular inverses.
* *
* Say you have (30 mod 17 * x mod 17) mod 17 == 1. x can be found using 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) public function extendedGCD(PHP32 $n)
{ {
@ -179,7 +187,8 @@ class PHP32 extends PHP
* *
* Say you have 693 and 609. The GCD is 21. * 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) public function gcd(PHP32 $n)
{ {
@ -190,7 +199,8 @@ class PHP32 extends PHP
/** /**
* Logical And * Logical And
* *
* @return \phpseclib\Math\BigInteger\Engines\PHP32 * @param PHP32 $x
* @return PHP32
*/ */
public function bitwise_and(PHP32 $x) public function bitwise_and(PHP32 $x)
{ {
@ -200,7 +210,8 @@ class PHP32 extends PHP
/** /**
* Logical Or * Logical Or
* *
* @return \phpseclib\Math\BigInteger\Engines\PHP32 * @param PHP32 $x
* @return PHP32
*/ */
public function bitwise_or(PHP32 $x) public function bitwise_or(PHP32 $x)
{ {
@ -210,7 +221,8 @@ class PHP32 extends PHP
/** /**
* Logical Exlusive Or * Logical Exlusive Or
* *
* @return \phpseclib\Math\BigInteger\Engines\PHP32 * @param PHP32 $x
* @return PHP32
*/ */
public function bitwise_xor(PHP32 $x) 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). * 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. * @return int < 0 if $this is less than $y; > 0 if $this is greater than $y, and 0 if they are equal.
* @access public * @access public
* @see self::equals() * @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() * If you need to see if one number is greater than or less than another number, use BigInteger::compare()
* *
* @param PHP32 $x
* @return bool * @return bool
*/ */
public function equals(PHP32 $x) public function equals(PHP32 $x)
@ -254,7 +268,9 @@ class PHP32 extends PHP
/** /**
* Performs modular exponentiation. * Performs modular exponentiation.
* *
* @return \phpseclib\Math\BigInteger\Engines\PHP32 * @param PHP32 $e
* @param PHP32 $n
* @return PHP32
*/ */
public function modPow(PHP32 $e, PHP32 $n) public function modPow(PHP32 $e, PHP32 $n)
{ {
@ -266,7 +282,9 @@ class PHP32 extends PHP
* *
* Alias for modPow(). * Alias for modPow().
* *
* @return \phpseclib\Math\BigInteger\Engines\PHP32 * @param PHP32 $e
* @param PHP32 $n
* @return PHP32
*/ */
public function powMod(PHP32 $e, PHP32 $n) 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. * 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) public static function randomRangePrime(PHP32 $min, PHP32 $max)
{ {
@ -294,7 +314,9 @@ class PHP32 extends PHP
* BigInteger::randomRange($min, $max) * BigInteger::randomRange($min, $max)
* BigInteger::randomRange($max, $min) * 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) public static function randomRange(PHP32 $min, PHP32 $max)
{ {
@ -304,7 +326,8 @@ class PHP32 extends PHP
/** /**
* Performs exponentiation. * Performs exponentiation.
* *
* @return \phpseclib\Math\BigInteger\Engines\PHP64 * @param PHP32 $n
* @return PHP64
*/ */
public function pow(PHP32 $n) public function pow(PHP32 $n)
{ {
@ -314,7 +337,8 @@ class PHP32 extends PHP
/** /**
* Return the minimum BigInteger between an arbitrary number of BigIntegers. * 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) 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 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) 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 * 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) public function between(PHP32 $min, PHP32 $max)
{ {

View File

@ -106,7 +106,8 @@ class PHP64 extends PHP
/** /**
* Adds two BigIntegers. * Adds two BigIntegers.
* *
* @return \phpseclib\Math\BigInteger\Engines\PHP64 * @param PHP64 $y
* @return PHP64
*/ */
public function add(PHP64 $y) public function add(PHP64 $y)
{ {
@ -118,7 +119,8 @@ class PHP64 extends PHP
/** /**
* Subtracts two BigIntegers. * Subtracts two BigIntegers.
* *
* @return \phpseclib\Math\BigInteger\Engines\PHP64 * @param PHP64 $y
* @return PHP64
*/ */
public function subtract(PHP64 $y) public function subtract(PHP64 $y)
{ {
@ -130,7 +132,8 @@ class PHP64 extends PHP
/** /**
* Multiplies two BigIntegers. * Multiplies two BigIntegers.
* *
* @return \phpseclib\Math\BigInteger\Engines\PHP64 * @param PHP64 $y
* @return PHP64
*/ */
public function multiply(PHP64 $y) 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 * 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). * 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) public function divide(PHP64 $y)
{ {
@ -158,6 +162,8 @@ class PHP64 extends PHP
* Calculates modular inverses. * Calculates modular inverses.
* *
* Say you have (30 mod 17 * x mod 17) mod 17 == 1. x can be found using 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) public function modInverse(PHP64 $n)
{ {
@ -168,6 +174,8 @@ class PHP64 extends PHP
* Calculates modular inverses. * Calculates modular inverses.
* *
* Say you have (30 mod 17 * x mod 17) mod 17 == 1. x can be found using 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) public function extendedGCD(PHP64 $n)
{ {
@ -179,7 +187,8 @@ class PHP64 extends PHP
* *
* Say you have 693 and 609. The GCD is 21. * 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) public function gcd(PHP64 $n)
{ {
@ -190,7 +199,8 @@ class PHP64 extends PHP
/** /**
* Logical And * Logical And
* *
* @return \phpseclib\Math\BigInteger\Engines\PHP64 * @param PHP64 $x
* @return PHP64
*/ */
public function bitwise_and(PHP64 $x) public function bitwise_and(PHP64 $x)
{ {
@ -200,7 +210,8 @@ class PHP64 extends PHP
/** /**
* Logical Or * Logical Or
* *
* @return \phpseclib\Math\BigInteger\Engines\PHP64 * @param PHP64 $x
* @return PHP64
*/ */
public function bitwise_or(PHP64 $x) public function bitwise_or(PHP64 $x)
{ {
@ -210,7 +221,8 @@ class PHP64 extends PHP
/** /**
* Logical Exlusive Or * Logical Exlusive Or
* *
* @return \phpseclib\Math\BigInteger\Engines\PHP64 * @param PHP64 $x
* @return PHP64
*/ */
public function bitwise_xor(PHP64 $x) 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). * 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. * @return int < 0 if $this is less than $y; > 0 if $this is greater than $y, and 0 if they are equal.
* @access public * @access public
* @see self::equals() * @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() * If you need to see if one number is greater than or less than another number, use BigInteger::compare()
* *
* @param PHP64 $x
* @return bool * @return bool
*/ */
public function equals(PHP64 $x) public function equals(PHP64 $x)
@ -254,7 +268,9 @@ class PHP64 extends PHP
/** /**
* Performs modular exponentiation. * Performs modular exponentiation.
* *
* @return \phpseclib\Math\BigInteger\Engines\PHP64 * @param PHP64 $e
* @param PHP64 $n
* @return PHP64
*/ */
public function modPow(PHP64 $e, PHP64 $n) public function modPow(PHP64 $e, PHP64 $n)
{ {
@ -266,7 +282,9 @@ class PHP64 extends PHP
* *
* Alias for modPow(). * Alias for modPow().
* *
* @return \phpseclib\Math\BigInteger\Engines\PHP64 * @param PHP64 $e
* @param PHP64 $n
* @return PHP64
*/ */
public function powMod(PHP64 $e, PHP64 $n) 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. * 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) public static function randomRangePrime(PHP64 $min, PHP64 $max)
{ {
@ -294,7 +314,9 @@ class PHP64 extends PHP
* BigInteger::randomRange($min, $max) * BigInteger::randomRange($min, $max)
* BigInteger::randomRange($max, $min) * 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) public static function randomRange(PHP64 $min, PHP64 $max)
{ {
@ -304,7 +326,8 @@ class PHP64 extends PHP
/** /**
* Performs exponentiation. * Performs exponentiation.
* *
* @return \phpseclib\Math\BigInteger\Engines\PHP64 * @param PHP64 $n
* @return PHP64
*/ */
public function pow(PHP64 $n) public function pow(PHP64 $n)
{ {
@ -314,7 +337,8 @@ class PHP64 extends PHP
/** /**
* Return the minimum BigInteger between an arbitrary number of BigIntegers. * 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) 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 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) 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 * 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) public function between(PHP64 $min, PHP64 $max)
{ {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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