mirror of
https://github.com/danog/phpseclib.git
synced 2024-12-13 01:27:40 +01:00
revisions to rrran's PHPDoc changes
This commit is contained in:
parent
10828543ce
commit
ec579bd9ed
@ -180,7 +180,7 @@ abstract class AsymmetricKey
|
|||||||
/**
|
/**
|
||||||
* Tests engine validity
|
* Tests engine validity
|
||||||
*
|
*
|
||||||
* @returns boolean
|
* @return boolean
|
||||||
* @access public
|
* @access public
|
||||||
* @param int $val
|
* @param int $val
|
||||||
*/
|
*/
|
||||||
|
@ -103,7 +103,7 @@ abstract class OpenSSH
|
|||||||
* Returns the comment for the key
|
* Returns the comment for the key
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @param $key
|
* @param string $key
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public static function getComment($key)
|
public static function getComment($key)
|
||||||
|
@ -28,7 +28,6 @@
|
|||||||
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;
|
||||||
@ -139,7 +138,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
|
* @return \phpseclib\Crypt\Common\SymmetricKey
|
||||||
* @access public
|
* @access public
|
||||||
* @param string $algo
|
* @param string $algo
|
||||||
*/
|
*/
|
||||||
@ -189,7 +188,7 @@ abstract class PKCS8 extends PKCS
|
|||||||
/**
|
/**
|
||||||
* Returns a hash based on a PBES1 $algo
|
* Returns a hash based on a PBES1 $algo
|
||||||
*
|
*
|
||||||
* @returns string
|
* @return string
|
||||||
* @access public
|
* @access public
|
||||||
* @param string $algo
|
* @param string $algo
|
||||||
*/
|
*/
|
||||||
@ -205,7 +204,7 @@ abstract class PKCS8 extends PKCS
|
|||||||
/**
|
/**
|
||||||
* Returns a KDF baesd on a PBES1 $algo
|
* Returns a KDF baesd on a PBES1 $algo
|
||||||
*
|
*
|
||||||
* @returns string
|
* @return string
|
||||||
* @access public
|
* @access public
|
||||||
* @param string $algo
|
* @param string $algo
|
||||||
*/
|
*/
|
||||||
@ -227,7 +226,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
|
* @return SymmetricKey
|
||||||
* @access public
|
* @access public
|
||||||
* @param string $algo
|
* @param string $algo
|
||||||
*/
|
*/
|
||||||
|
@ -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
|
* @return bool
|
||||||
* @access public
|
* @access public
|
||||||
* @param string $key
|
* @param string $key
|
||||||
* @param int|boolean $type optional
|
* @param int|bool $type optional
|
||||||
*/
|
*/
|
||||||
public function load($key, $type = false)
|
public function load($key, $type = false)
|
||||||
{
|
{
|
||||||
@ -460,7 +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 $signature
|
||||||
* @param string $format optional
|
* @param string $format optional
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
|
@ -35,7 +35,7 @@ abstract class PKCS
|
|||||||
* Loads a signature
|
* Loads a signature
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @param $sig
|
* @param string $sig
|
||||||
* @return array|bool
|
* @return array|bool
|
||||||
*/
|
*/
|
||||||
public static function load($sig)
|
public static function load($sig)
|
||||||
|
@ -333,7 +333,7 @@ class Hash
|
|||||||
* Pure-PHP implementation of SHA512
|
* Pure-PHP implementation of SHA512
|
||||||
* @access private
|
* @access private
|
||||||
* @param string $m
|
* @param string $m
|
||||||
* @param $hash
|
* @param array $hash
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
private static function sha512($m, $hash)
|
private static function sha512($m, $hash)
|
||||||
|
@ -255,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
|
||||||
*/
|
*/
|
||||||
@ -266,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
|
||||||
*/
|
*/
|
||||||
|
@ -456,10 +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
|
* @return bool
|
||||||
* @access public
|
* @access public
|
||||||
* @param string $key
|
* @param string $key
|
||||||
* @param int|boolean $type optional
|
* @param int|bool $type optional
|
||||||
*/
|
*/
|
||||||
public function load($key, $type = false)
|
public function load($key, $type = false)
|
||||||
{
|
{
|
||||||
@ -654,8 +654,8 @@ class RSA extends AsymmetricKey
|
|||||||
*
|
*
|
||||||
* @see self::getPublicKey()
|
* @see self::getPublicKey()
|
||||||
* @access public
|
* @access public
|
||||||
* @param string|boolean $key optional
|
* @param string|bool $key optional
|
||||||
* @param int|boolean $type optional
|
* @param int|bool $type optional
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function setPublicKey($key = false, $type = false)
|
public function setPublicKey($key = false, $type = false)
|
||||||
@ -698,8 +698,8 @@ class RSA extends AsymmetricKey
|
|||||||
*
|
*
|
||||||
* @see self::getPublicKey()
|
* @see self::getPublicKey()
|
||||||
* @access public
|
* @access public
|
||||||
* @param string|boolean $key optional
|
* @param string|bool $key optional
|
||||||
* @param int|boolean $type optional
|
* @param int|bool $type optional
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function setPrivateKey($key = false, $type = false)
|
public function setPrivateKey($key = false, $type = false)
|
||||||
@ -838,8 +838,7 @@ class RSA extends AsymmetricKey
|
|||||||
* of the hash function Hash) and 0.
|
* of the hash function Hash) and 0.
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @param $sLen
|
* @param int $sLen
|
||||||
* @internal param int $format
|
|
||||||
*/
|
*/
|
||||||
public function setSaltLength($sLen)
|
public function setSaltLength($sLen)
|
||||||
{
|
{
|
||||||
@ -1348,7 +1347,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
|
* @return string
|
||||||
* @access private
|
* @access private
|
||||||
* @param string $m
|
* @param string $m
|
||||||
* @throws \RuntimeException on encoding error
|
* @throws \RuntimeException on encoding error
|
||||||
|
@ -604,7 +604,7 @@ class Rijndael extends BlockCipher
|
|||||||
/**
|
/**
|
||||||
* Performs S-Box substitutions
|
* Performs S-Box substitutions
|
||||||
*
|
*
|
||||||
* @returns array
|
* @return array
|
||||||
* @access private
|
* @access private
|
||||||
* @param int $word
|
* @param int $word
|
||||||
*/
|
*/
|
||||||
|
@ -203,7 +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 $history
|
* @param int $history
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
public function setHistory($history)
|
public function setHistory($history)
|
||||||
@ -460,9 +460,9 @@ class ANSI
|
|||||||
* Returns the current coordinate without preformating
|
* Returns the current coordinate without preformating
|
||||||
*
|
*
|
||||||
* @access private
|
* @access private
|
||||||
* @param $last_attr
|
* @param \stdClass $last_attr
|
||||||
* @param $cur_attr
|
* @param \stdClass $cur_attr
|
||||||
* @param $char
|
* @param string $char
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
private function processCoordinate($last_attr, $cur_attr, $char)
|
private function processCoordinate($last_attr, $cur_attr, $char)
|
||||||
|
@ -1387,7 +1387,7 @@ abstract class ASN1
|
|||||||
* getOID('zzz') == 'zzz'
|
* getOID('zzz') == 'zzz'
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @param $name
|
* @param string $name
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
static function getOID($name)
|
static function getOID($name)
|
||||||
|
@ -122,7 +122,7 @@ class BigInteger implements \Serializable
|
|||||||
*
|
*
|
||||||
* @param $x integer|BigInteger\Engines\Engine Base-10 number or base-$base number if $base set.
|
* @param $x integer|BigInteger\Engines\Engine Base-10 number or base-$base number if $base set.
|
||||||
* @param int $base
|
* @param int $base
|
||||||
* @return \phpseclib\Math\BigInteger
|
* @return BigInteger
|
||||||
*/
|
*/
|
||||||
public function __construct($x = 0, $base = 10)
|
public function __construct($x = 0, $base = 10)
|
||||||
{
|
{
|
||||||
@ -241,8 +241,8 @@ class BigInteger implements \Serializable
|
|||||||
/**
|
/**
|
||||||
* Multiplies two BigIntegers
|
* Multiplies two BigIntegers
|
||||||
*
|
*
|
||||||
* @param \phpseclib\Math\BigInteger $x
|
* @param BigInteger $x
|
||||||
* @return \phpseclib\Math\BigInteger
|
* @return BigInteger
|
||||||
*/
|
*/
|
||||||
public function multiply(BigInteger $x)
|
public function multiply(BigInteger $x)
|
||||||
{
|
{
|
||||||
@ -271,8 +271,8 @@ class BigInteger implements \Serializable
|
|||||||
* ?>
|
* ?>
|
||||||
* </code>
|
* </code>
|
||||||
*
|
*
|
||||||
* @param \phpseclib\Math\BigInteger $y
|
* @param BigInteger $y
|
||||||
* @return \phpseclib\Math\BigInteger[]
|
* @return BigInteger[]
|
||||||
*/
|
*/
|
||||||
public function divide(BigInteger $y)
|
public function divide(BigInteger $y)
|
||||||
{
|
{
|
||||||
@ -288,7 +288,7 @@ class BigInteger implements \Serializable
|
|||||||
*
|
*
|
||||||
* 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
|
* @return BigInteger
|
||||||
* @param \phpseclib\Math\BigInteger $n
|
* @param BigInteger $n
|
||||||
*/
|
*/
|
||||||
public function modInverse(BigInteger $n)
|
public function modInverse(BigInteger $n)
|
||||||
{
|
{
|
||||||
@ -300,7 +300,7 @@ class BigInteger implements \Serializable
|
|||||||
*
|
*
|
||||||
* 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
|
* @return array
|
||||||
* @param \phpseclib\Math\BigInteger $n
|
* @param BigInteger $n
|
||||||
*/
|
*/
|
||||||
public function extendedGCD(BigInteger $n)
|
public function extendedGCD(BigInteger $n)
|
||||||
{
|
{
|
||||||
@ -328,7 +328,7 @@ class BigInteger implements \Serializable
|
|||||||
/**
|
/**
|
||||||
* Absolute value.
|
* Absolute value.
|
||||||
*
|
*
|
||||||
* @return \phpseclib\Math\BigInteger
|
* @return BigInteger
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
public function abs()
|
public function abs()
|
||||||
@ -438,7 +438,7 @@ class BigInteger implements \Serializable
|
|||||||
*
|
*
|
||||||
* 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 BigInteger $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()
|
||||||
@ -465,7 +465,7 @@ class BigInteger implements \Serializable
|
|||||||
/**
|
/**
|
||||||
* Logical Not
|
* Logical Not
|
||||||
*
|
*
|
||||||
* @return \phpseclib\Math\BigInteger
|
* @return BigInteger
|
||||||
*/
|
*/
|
||||||
public function bitwise_not()
|
public function bitwise_not()
|
||||||
{
|
{
|
||||||
@ -511,7 +511,7 @@ class BigInteger implements \Serializable
|
|||||||
* Shifts BigInteger's by $shift bits, effectively dividing by 2**$shift.
|
* Shifts BigInteger's by $shift bits, effectively dividing by 2**$shift.
|
||||||
*
|
*
|
||||||
* @param int $shift
|
* @param int $shift
|
||||||
* @return \phpseclib\Math\BigInteger
|
* @return BigInteger
|
||||||
*/
|
*/
|
||||||
public function bitwise_rightShift($shift)
|
public function bitwise_rightShift($shift)
|
||||||
{
|
{
|
||||||
@ -524,7 +524,7 @@ class BigInteger implements \Serializable
|
|||||||
* Shifts BigInteger's by $shift bits, effectively multiplying by 2**$shift.
|
* Shifts BigInteger's by $shift bits, effectively multiplying by 2**$shift.
|
||||||
*
|
*
|
||||||
* @param int $shift
|
* @param int $shift
|
||||||
* @return \phpseclib\Math\BigInteger
|
* @return BigInteger
|
||||||
*/
|
*/
|
||||||
public function bitwise_leftShift($shift)
|
public function bitwise_leftShift($shift)
|
||||||
{
|
{
|
||||||
@ -537,7 +537,7 @@ class BigInteger implements \Serializable
|
|||||||
* Instead of the top x bits being dropped they're appended to the shifted bit string.
|
* Instead of the top x bits being dropped they're appended to the shifted bit string.
|
||||||
*
|
*
|
||||||
* @param int $shift
|
* @param int $shift
|
||||||
* @return \phpseclib\Math\BigInteger
|
* @return BigInteger
|
||||||
*/
|
*/
|
||||||
public function bitwise_leftRotate($shift)
|
public function bitwise_leftRotate($shift)
|
||||||
{
|
{
|
||||||
@ -550,7 +550,7 @@ class BigInteger implements \Serializable
|
|||||||
* Instead of the bottom x bits being dropped they're prepended to the shifted bit string.
|
* Instead of the bottom x bits being dropped they're prepended to the shifted bit string.
|
||||||
*
|
*
|
||||||
* @param int $shift
|
* @param int $shift
|
||||||
* @return \phpseclib\Math\BigInteger
|
* @return BigInteger
|
||||||
*/
|
*/
|
||||||
public function bitwise_rightRotate($shift)
|
public function bitwise_rightRotate($shift)
|
||||||
{
|
{
|
||||||
@ -599,7 +599,7 @@ class BigInteger implements \Serializable
|
|||||||
* Bit length is equal to $size
|
* Bit length is equal to $size
|
||||||
*
|
*
|
||||||
* @param int $size
|
* @param int $size
|
||||||
* @return \phpseclib\Math\BigInteger
|
* @return BigInteger
|
||||||
*/
|
*/
|
||||||
public static function random($size)
|
public static function random($size)
|
||||||
{
|
{
|
||||||
@ -613,7 +613,7 @@ class BigInteger implements \Serializable
|
|||||||
* Bit length is equal to $size
|
* Bit length is equal to $size
|
||||||
*
|
*
|
||||||
* @param int $size
|
* @param int $size
|
||||||
* @return \phpseclib\Math\BigInteger
|
* @return BigInteger
|
||||||
*/
|
*/
|
||||||
public static function randomPrime($size)
|
public static function randomPrime($size)
|
||||||
{
|
{
|
||||||
@ -662,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|boolean $t
|
* @param int|bool $t
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function isPrime($t = false)
|
public function isPrime($t = false)
|
||||||
@ -676,7 +676,7 @@ class BigInteger implements \Serializable
|
|||||||
* 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
|
||||||
*
|
*
|
||||||
* @param int $n optional
|
* @param int $n optional
|
||||||
* @return \phpseclib\Math\BigInteger
|
* @return BigInteger
|
||||||
*/
|
*/
|
||||||
public function root($n = 2)
|
public function root($n = 2)
|
||||||
{
|
{
|
||||||
|
@ -100,7 +100,7 @@ class BCMath extends Engine
|
|||||||
/**
|
/**
|
||||||
* Default constructor
|
* Default constructor
|
||||||
*
|
*
|
||||||
* @param $x integer Base-10 number or base-$base number if $base set.
|
* @param mixed $x integer Base-10 number or base-$base number if $base set.
|
||||||
* @param int $base
|
* @param int $base
|
||||||
* @see parent::__construct()
|
* @see parent::__construct()
|
||||||
* @return \phpseclib\Math\BigInteger\Engines\BCMath
|
* @return \phpseclib\Math\BigInteger\Engines\BCMath
|
||||||
@ -274,7 +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
|
* @return false|BCMath
|
||||||
* @param \phpseclib\Math\BigInteger\Engines\BCMath $n
|
* @param \phpseclib\Math\BigInteger\Engines\BCMath $n
|
||||||
*/
|
*/
|
||||||
public function modInverse(BCMath $n)
|
public function modInverse(BCMath $n)
|
||||||
@ -627,10 +627,10 @@ 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
|
* @param BCMath $r
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
protected static function scan1divide($r)
|
protected static function scan1divide(BCMath $r)
|
||||||
{
|
{
|
||||||
$r_value = &$r->value;
|
$r_value = &$r->value;
|
||||||
$s = 0;
|
$s = 0;
|
||||||
@ -694,7 +694,7 @@ class BCMath extends Engine
|
|||||||
/**
|
/**
|
||||||
* Set Bitmask
|
* Set Bitmask
|
||||||
*
|
*
|
||||||
* @returns Engine
|
* @return Engine
|
||||||
* @param int $bits
|
* @param int $bits
|
||||||
* @see self::setPrecision()
|
* @see self::setPrecision()
|
||||||
*/
|
*/
|
||||||
|
@ -59,7 +59,7 @@ abstract class Engine implements \Serializable
|
|||||||
/**
|
/**
|
||||||
* Default constructor
|
* Default constructor
|
||||||
*
|
*
|
||||||
* @param $x integer Base-10 number or base-$base number if $base set.
|
* @param mixed $x integer Base-10 number or base-$base number if $base set.
|
||||||
* @param int $base
|
* @param int $base
|
||||||
*/
|
*/
|
||||||
public function __construct($x, $base)
|
public function __construct($x, $base)
|
||||||
@ -381,7 +381,7 @@ abstract class Engine implements \Serializable
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set Bitmask
|
* Set Bitmask
|
||||||
* @returns Engine
|
* @return Engine
|
||||||
* @param int $bits
|
* @param int $bits
|
||||||
* @see self::setPrecision()
|
* @see self::setPrecision()
|
||||||
*/
|
*/
|
||||||
@ -906,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|boolean $t
|
* @param int|bool $t
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function isPrime($t = false)
|
public function isPrime($t = false)
|
||||||
|
@ -102,7 +102,7 @@ class GMP extends Engine
|
|||||||
/**
|
/**
|
||||||
* Default constructor
|
* Default constructor
|
||||||
*
|
*
|
||||||
* @param $x integer Base-10 number or base-$base number if $base set.
|
* @param mixed $x integer Base-10 number or base-$base number if $base set.
|
||||||
* @param int $base
|
* @param int $base
|
||||||
* @see parent::__construct()
|
* @see parent::__construct()
|
||||||
* @return \phpseclib\Math\BigInteger\Engines\GMP
|
* @return \phpseclib\Math\BigInteger\Engines\GMP
|
||||||
|
@ -74,7 +74,7 @@ abstract class PHP extends Engine
|
|||||||
/**
|
/**
|
||||||
* Default constructor
|
* Default constructor
|
||||||
*
|
*
|
||||||
* @param $x integer Base-10 number or base-$base number if $base set.
|
* @param mixed $x integer Base-10 number or base-$base number if $base set.
|
||||||
* @param int $base
|
* @param int $base
|
||||||
* @see parent::__construct()
|
* @see parent::__construct()
|
||||||
* @return \phpseclib\Math\BigInteger\Engines\PHP
|
* @return \phpseclib\Math\BigInteger\Engines\PHP
|
||||||
@ -141,7 +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
|
* @param string $str
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
protected function pad($str)
|
protected function pad($str)
|
||||||
@ -734,10 +734,10 @@ 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
|
||||||
*
|
*
|
||||||
* @param $result
|
* @param PHP $result
|
||||||
* @return PHP
|
* @return PHP
|
||||||
*/
|
*/
|
||||||
protected function normalize($result)
|
protected function normalize(PHP $result)
|
||||||
{
|
{
|
||||||
$result->precision = $this->precision;
|
$result->precision = $this->precision;
|
||||||
$result->bitmask = $this->bitmask;
|
$result->bitmask = $this->bitmask;
|
||||||
@ -1301,10 +1301,10 @@ 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
|
* @param PHP $r
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
protected static function scan1divide($r)
|
protected static function scan1divide(PHP $r)
|
||||||
{
|
{
|
||||||
$r_value = &$r->value;
|
$r_value = &$r->value;
|
||||||
for ($i = 0, $r_length = count($r_value); $i < $r_length; ++$i) {
|
for ($i = 0, $r_length = count($r_value); $i < $r_length; ++$i) {
|
||||||
|
@ -461,7 +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 $num
|
* @param int|float $num
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
private static function float2string($num)
|
private static function float2string($num)
|
||||||
|
@ -163,7 +163,7 @@ class PHP32 extends PHP
|
|||||||
*
|
*
|
||||||
* 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
|
* @param PHP32 $n
|
||||||
* @return false|Engine
|
* @return false|PHP32
|
||||||
*/
|
*/
|
||||||
public function modInverse(PHP32 $n)
|
public function modInverse(PHP32 $n)
|
||||||
{
|
{
|
||||||
@ -175,7 +175,7 @@ class PHP32 extends PHP
|
|||||||
*
|
*
|
||||||
* 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
|
* @param PHP32 $n
|
||||||
* @return PHP[]
|
* @return PHP32[]
|
||||||
*/
|
*/
|
||||||
public function extendedGCD(PHP32 $n)
|
public function extendedGCD(PHP32 $n)
|
||||||
{
|
{
|
||||||
@ -327,7 +327,7 @@ class PHP32 extends PHP
|
|||||||
* Performs exponentiation.
|
* Performs exponentiation.
|
||||||
*
|
*
|
||||||
* @param PHP32 $n
|
* @param PHP32 $n
|
||||||
* @return PHP64
|
* @return PHP32
|
||||||
*/
|
*/
|
||||||
public function pow(PHP32 $n)
|
public function pow(PHP32 $n)
|
||||||
{
|
{
|
||||||
|
@ -163,7 +163,7 @@ class PHP64 extends PHP
|
|||||||
*
|
*
|
||||||
* 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
|
* @param PHP64 $n
|
||||||
* @return false|Engine
|
* @return false|PHP64
|
||||||
*/
|
*/
|
||||||
public function modInverse(PHP64 $n)
|
public function modInverse(PHP64 $n)
|
||||||
{
|
{
|
||||||
@ -175,7 +175,7 @@ class PHP64 extends PHP
|
|||||||
*
|
*
|
||||||
* 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
|
* @param PHP64 $n
|
||||||
* @return PHP[]
|
* @return PHP64[]
|
||||||
*/
|
*/
|
||||||
public function extendedGCD(PHP64 $n)
|
public function extendedGCD(PHP64 $n)
|
||||||
{
|
{
|
||||||
|
@ -211,7 +211,7 @@ class SCP
|
|||||||
* operation
|
* operation
|
||||||
*
|
*
|
||||||
* @param string $remote_file
|
* @param string $remote_file
|
||||||
* @param string|boolean $local_file
|
* @param string|bool $local_file
|
||||||
* @return mixed
|
* @return mixed
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
|
@ -1180,7 +1180,7 @@ class SFTP extends SSH2
|
|||||||
*
|
*
|
||||||
* Mainly used by file_exists
|
* Mainly used by file_exists
|
||||||
*
|
*
|
||||||
* @param $path
|
* @param string $path
|
||||||
* @return mixed
|
* @return mixed
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
@ -1770,7 +1770,7 @@ class SFTP extends SSH2
|
|||||||
* Helper function for directory creation
|
* Helper function for directory creation
|
||||||
*
|
*
|
||||||
* @param string $dir
|
* @param string $dir
|
||||||
* @param $attr
|
* @param string $attr
|
||||||
* @return bool
|
* @return bool
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
@ -2117,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|boolean|resource $local_file
|
* @param string|bool|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
|
||||||
@ -2668,7 +2668,7 @@ class SFTP extends SSH2
|
|||||||
*
|
*
|
||||||
* @param string $path
|
* @param string $path
|
||||||
* @param string $prop
|
* @param string $prop
|
||||||
* @param $type
|
* @param string $type
|
||||||
* @return mixed
|
* @return mixed
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
|
@ -1558,8 +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 $protocol_flags
|
* @param string $protocol_flags
|
||||||
* @param $message
|
* @param string $message
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
private function append_log($protocol_flags, $message)
|
private function append_log($protocol_flags, $message)
|
||||||
|
@ -1292,8 +1292,8 @@ class SSH2
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Key Exchange
|
* Key Exchange
|
||||||
* @return boolean
|
* @return bool
|
||||||
* @param string|boolean $kexinit_payload_server optional
|
* @param string|bool $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
|
||||||
@ -3314,8 +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 string $payload
|
||||||
* @param $filter_channel_packets
|
* @param bool $filter_channel_packets
|
||||||
* @return string
|
* @return string
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
@ -3552,8 +3552,8 @@ 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 int $client_channel
|
||||||
* @param boolean $skip_extended
|
* @param bool $skip_extended
|
||||||
* @return mixed
|
* @return mixed
|
||||||
* @throws \RuntimeException on connection error
|
* @throws \RuntimeException on connection error
|
||||||
* @access private
|
* @access private
|
||||||
@ -3874,8 +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 $message_number
|
* @param string $message_number
|
||||||
* @param $message
|
* @param string $message
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
private function append_log($message_number, $message)
|
private function append_log($message_number, $message)
|
||||||
|
Loading…
Reference in New Issue
Block a user