From 19229ed22425d4796a740fae2f354e0db932c839 Mon Sep 17 00:00:00 2001 From: terrafrost Date: Mon, 5 Oct 2015 10:08:46 -0500 Subject: [PATCH] phpDoc changes --- phpseclib/Crypt/Base.php | 20 +++++----- phpseclib/Crypt/DES.php | 2 +- phpseclib/Crypt/Hash.php | 8 ++-- phpseclib/Crypt/RC2.php | 12 +++--- phpseclib/Crypt/RSA.php | 38 ++++++++++--------- phpseclib/Crypt/Rijndael.php | 16 ++++---- phpseclib/Math/BigInteger.php | 71 ++++++++++++++--------------------- phpseclib/Net/SSH1.php | 6 +-- phpseclib/Net/SSH2.php | 4 +- 9 files changed, 84 insertions(+), 93 deletions(-) diff --git a/phpseclib/Crypt/Base.php b/phpseclib/Crypt/Base.php index 9566f288..43da9510 100644 --- a/phpseclib/Crypt/Base.php +++ b/phpseclib/Crypt/Base.php @@ -296,9 +296,9 @@ class Crypt_Base /** * Does internal cipher state need to be (re)initialized? * - * @see setKey() - * @see setIV() - * @see disableContinuousBuffer() + * @see Crypt_Base::setKey() + * @see Crypt_Base::setIV() + * @see Crypt_Base::disableContinuousBuffer() * @var bool * @access private */ @@ -1726,9 +1726,9 @@ class Crypt_Base * * - First run of encrypt() / decrypt() with no init-settings * - * @see setKey() - * @see setIV() - * @see disableContinuousBuffer() + * @see Crypt_Base::setKey() + * @see Crypt_Base::setIV() + * @see Crypt_Base::disableContinuousBuffer() * @access private * @internal _setup() is always called before en/decryption. * @internal Could, but not must, extend by the child Crypt_* class @@ -1760,9 +1760,9 @@ class Crypt_Base * * - First run of encrypt() / decrypt() * - * @see setKey() - * @see setIV() - * @see disableContinuousBuffer() + * @see Crypt_Base::setKey() + * @see Crypt_Base::setIV() + * @see Crypt_Base::disableContinuousBuffer() * @access private * @internal Could, but not must, extend by the child Crypt_* class */ @@ -2504,7 +2504,7 @@ class Crypt_Base /** * Generates a digest from $bytes * - * @see _setupInlineCrypt() + * @see Crypt_Base::_setupInlineCrypt() * @access private * @param $bytes * @return string diff --git a/phpseclib/Crypt/DES.php b/phpseclib/Crypt/DES.php index 8ac1fe6b..b7332bcf 100644 --- a/phpseclib/Crypt/DES.php +++ b/phpseclib/Crypt/DES.php @@ -143,7 +143,7 @@ class Crypt_DES extends Crypt_Base * The Key * * @see Crypt_Base::key - * @see setKey() + * @see Crypt_Base::setKey() * @var string * @access private */ diff --git a/phpseclib/Crypt/Hash.php b/phpseclib/Crypt/Hash.php index bc8719ec..6be2ee72 100644 --- a/phpseclib/Crypt/Hash.php +++ b/phpseclib/Crypt/Hash.php @@ -759,7 +759,7 @@ class Crypt_Hash * @access private * @param int $int * @param int $amt - * @see _sha256() + * @see Crypt_Hash::_sha256() * @return int */ function _rightRotate($int, $amt) @@ -775,7 +775,7 @@ class Crypt_Hash * @access private * @param int $int * @param int $amt - * @see _sha256() + * @see Crypt_Hash::_sha256() * @return int */ function _rightShift($int, $amt) @@ -789,7 +789,7 @@ class Crypt_Hash * * @access private * @param int $int - * @see _sha256() + * @see Crypt_Hash::_sha256() * @return int */ function _not($int) @@ -805,7 +805,7 @@ class Crypt_Hash * * @param int $... * @return int - * @see _sha256() + * @see Crypt_Hash::_sha256() * @access private */ function _add() diff --git a/phpseclib/Crypt/RC2.php b/phpseclib/Crypt/RC2.php index eb41fe8f..6eb766ec 100644 --- a/phpseclib/Crypt/RC2.php +++ b/phpseclib/Crypt/RC2.php @@ -120,7 +120,7 @@ class Crypt_RC2 extends Crypt_Base * The Key * * @see Crypt_Base::key - * @see setKey() + * @see Crypt_RC2::setKey() * @var string * @access private */ @@ -130,9 +130,9 @@ class Crypt_RC2 extends Crypt_Base * The Original (unpadded) Key * * @see Crypt_Base::key - * @see setKey() - * @see encrypt() - * @see decrypt() + * @see Crypt_RC2::setKey() + * @see Crypt_RC2::encrypt() + * @see Crypt_RC2::decrypt() * @var string * @access private */ @@ -456,7 +456,7 @@ class Crypt_RC2 extends Crypt_Base * * Mostly a wrapper for Crypt_Base::encrypt, with some additional OpenSSL handling code * - * @see decrypt() + * @see Crypt_RC2::decrypt() * @access public * @param string $plaintext * @return string $ciphertext @@ -479,7 +479,7 @@ class Crypt_RC2 extends Crypt_Base * * Mostly a wrapper for Crypt_Base::decrypt, with some additional OpenSSL handling code * - * @see encrypt() + * @see Crypt_RC2::encrypt() * @access public * @param string $ciphertext * @return string $plaintext diff --git a/phpseclib/Crypt/RSA.php b/phpseclib/Crypt/RSA.php index 58111419..8643bcc6 100644 --- a/phpseclib/Crypt/RSA.php +++ b/phpseclib/Crypt/RSA.php @@ -751,7 +751,7 @@ class Crypt_RSA * Convert a private key to the appropriate format. * * @access private - * @see setPrivateKeyFormat() + * @see Crypt_RSA::setPrivateKeyFormat() * @param string $RSAPrivateKey * @return string */ @@ -992,7 +992,7 @@ class Crypt_RSA * Convert a public key to the appropriate format * * @access private - * @see setPublicKeyFormat() + * @see Crypt_RSA::setPublicKeyFormat() * @param string $RSAPrivateKey * @return string */ @@ -1070,8 +1070,8 @@ class Crypt_RSA * Break a public or private key down into its constituant components * * @access private - * @see _convertPublicKey() - * @see _convertPrivateKey() + * @see Crypt_RSA::_convertPublicKey() + * @see Crypt_RSA::_convertPrivateKey() * @param string $key * @param int $type * @return array @@ -1692,8 +1692,8 @@ class Crypt_RSA * Private keys can be encrypted with a password. To unset the password, pass in the empty string or false. * Or rather, pass in $password such that empty($password) && !is_string($password) is true. * - * @see createKey() - * @see loadKey() + * @see Crypt_RSA::createKey() + * @see Crypt_RSA::loadKey() * @access public * @param string $password */ @@ -1717,7 +1717,7 @@ class Crypt_RSA * * Returns true on success, false on failure * - * @see getPublicKey() + * @see Crypt_RSA::getPublicKey() * @access public * @param string $key optional * @param int $type optional @@ -1777,7 +1777,7 @@ class Crypt_RSA * * Returns true on success, false on failure * - * @see getPublicKey() + * @see Crypt_RSA::getPublicKey() * @access public * @param string $key optional * @param int $type optional @@ -1808,7 +1808,7 @@ class Crypt_RSA * or if the public key was set via setPublicKey(). If the currently loaded key is supposed to be the public key this * function won't return it since this library, for the most part, doesn't distinguish between public and private keys. * - * @see getPublicKey() + * @see Crypt_RSA::getPublicKey() * @access public * @param string $key * @param int $type optional @@ -1836,6 +1836,7 @@ class Crypt_RSA * @access public * @param string $algorithm The hashing algorithm to be used. Valid options are 'md5' and 'sha256'. False is returned * for invalid values. + * @return mixed */ public function getPublicKeyFingerprint($algorithm = 'md5') { @@ -1865,10 +1866,11 @@ class Crypt_RSA * * The private key is only returned if the currently loaded key contains the constituent prime numbers. * - * @see getPublicKey() + * @see Crypt_RSA::getPublicKey() * @access public * @param string $key * @param int $type optional + * @return mixed */ function getPrivateKey($type = CRYPT_RSA_PUBLIC_FORMAT_PKCS1) { @@ -1889,7 +1891,7 @@ class Crypt_RSA * Returns the private key without the prime number constituants. Structurally identical to a public key that * hasn't been set as the public key * - * @see getPrivateKey() + * @see Crypt_RSA::getPrivateKey() * @access private * @param string $key * @param int $type optional @@ -1911,6 +1913,7 @@ class Crypt_RSA * __toString() magic method * * @access public + * @return string */ function __toString() { @@ -1926,6 +1929,7 @@ class Crypt_RSA * __clone() magic method * * @access public + * @return Crypt_RSA */ function __clone() { @@ -2021,7 +2025,7 @@ class Crypt_RSA /** * Determines the private key format * - * @see createKey() + * @see Crypt_RSA::createKey() * @access public * @param int $format */ @@ -2033,7 +2037,7 @@ class Crypt_RSA /** * Determines the public key format * - * @see createKey() + * @see Crypt_RSA::createKey() * @access public * @param int $format */ @@ -2950,7 +2954,7 @@ class Crypt_RSA * If $plaintext exceeds those limits it will be broken up so that it does and the resultant ciphertext's will * be concatenated together. * - * @see decrypt() + * @see Crypt_RSA::decrypt() * @access public * @param string $plaintext * @return string @@ -2996,7 +3000,7 @@ class Crypt_RSA /** * Decryption * - * @see encrypt() + * @see Crypt_RSA::encrypt() * @access public * @param string $plaintext * @return string @@ -3038,7 +3042,7 @@ class Crypt_RSA /** * Create a signature * - * @see verify() + * @see Crypt_RSA::verify() * @access public * @param string $message * @return string @@ -3061,7 +3065,7 @@ class Crypt_RSA /** * Verifies a signature * - * @see sign() + * @see Crypt_RSA::sign() * @access public * @param string $message * @param string $signature diff --git a/phpseclib/Crypt/Rijndael.php b/phpseclib/Crypt/Rijndael.php index 17bbb864..614453bf 100644 --- a/phpseclib/Crypt/Rijndael.php +++ b/phpseclib/Crypt/Rijndael.php @@ -156,7 +156,7 @@ class Crypt_Rijndael extends Crypt_Base * * @see Crypt_Base::cipher_name_mcrypt * @see Crypt_Base::engine - * @see isValidEngine() + * @see Crypt_Rijndael::isValidEngine() * @var string * @access private */ @@ -175,7 +175,7 @@ class Crypt_Rijndael extends Crypt_Base /** * Has the key length explicitly been set or should it be derived from the key, itself? * - * @see setKeyLength() + * @see Crypt_Rijndael::setKeyLength() * @var bool * @access private */ @@ -184,7 +184,7 @@ class Crypt_Rijndael extends Crypt_Base /** * The Key Schedule * - * @see _setup() + * @see Crypt_Rijndael::_setup() * @var array * @access private */ @@ -193,7 +193,7 @@ class Crypt_Rijndael extends Crypt_Base /** * The Inverse Key Schedule * - * @see _setup() + * @see Crypt_Rijndael::_setup() * @var array * @access private */ @@ -202,7 +202,7 @@ class Crypt_Rijndael extends Crypt_Base /** * The Block Length divided by 32 * - * @see setBlockLength() + * @see Crypt_Rijndael::setBlockLength() * @var int * @access private * @internal The max value is 256 / 32 = 8, the min value is 128 / 32 = 4. Exists in conjunction with $block_size @@ -215,7 +215,7 @@ class Crypt_Rijndael extends Crypt_Base /** * The Key Length * - * @see setKeyLength() + * @see Crypt_Rijndael::setKeyLength() * @var int * @access private * @internal The max value is 256 / 8 = 32, the min value is 128 / 8 = 16. Exists in conjunction with $Nk @@ -228,7 +228,7 @@ class Crypt_Rijndael extends Crypt_Base /** * The Key Length divided by 32 * - * @see setKeyLength() + * @see Crypt_Rijndael::setKeyLength() * @var int * @access private * @internal The max value is 256 / 32 = 8, the min value is 128 / 32 = 4 @@ -301,7 +301,7 @@ class Crypt_Rijndael extends Crypt_Base * Note: 160/224-bit keys must explicitly set by setKeyLength(), otherwise they will be round/pad up to 192/256 bits. * * @see Crypt_Base:setKey() - * @see setKeyLength() + * @see Crypt_Rijndael::setKeyLength() * @access public * @param string $key */ diff --git a/phpseclib/Math/BigInteger.php b/phpseclib/Math/BigInteger.php index 4e86449b..6d626a6a 100644 --- a/phpseclib/Math/BigInteger.php +++ b/phpseclib/Math/BigInteger.php @@ -191,18 +191,10 @@ class Math_BigInteger */ var $is_negative = false; - /** - * Random number generator function - * - * @see setRandomGenerator() - * @access private - */ - var $generator = 'mt_rand'; - /** * Precision * - * @see setPrecision() + * @see Math_BigInteger::setPrecision() * @access private */ var $precision = -1; @@ -210,7 +202,7 @@ class Math_BigInteger /** * Precision Bitmask * - * @see setPrecision() + * @see Math_BigInteger::setPrecision() * @access private */ var $bitmask = false; @@ -222,8 +214,8 @@ class Math_BigInteger * a variable that'll be serializable regardless of whether or not extensions are being used. Unlike $this->value, * however, $this->hex is only calculated when $this->__sleep() is called. * - * @see __sleep() - * @see __wakeup() + * @see Math_BigInteger::__sleep() + * @see Math_BigInteger::__wakeup() * @var string * @access private */ @@ -738,7 +730,7 @@ class Math_BigInteger * {@link http://php.net/language.oop5.basic#51624} * * @access public - * @see __clone() + * @see Math_BigInteger::__clone() * @return Math_BigInteger */ function copy() @@ -746,7 +738,6 @@ class Math_BigInteger $temp = new Math_BigInteger(); $temp->value = $this->value; $temp->is_negative = $this->is_negative; - $temp->generator = $this->generator; $temp->precision = $this->precision; $temp->bitmask = $this->bitmask; return $temp; @@ -775,7 +766,7 @@ class Math_BigInteger * call Math_BigInteger::copy(), instead. * * @access public - * @see copy() + * @see Math_BigInteger::copy() * @return Math_BigInteger */ function __clone() @@ -788,16 +779,13 @@ class Math_BigInteger * * Will be called, automatically, when serialize() is called on a Math_BigInteger object. * - * @see __wakeup() + * @see Math_BigInteger::__wakeup() * @access public */ function __sleep() { $this->hex = $this->toHex(true); $vars = array('hex'); - if ($this->generator != 'mt_rand') { - $vars[] = 'generator'; - } if ($this->precision > 0) { $vars[] = 'precision'; } @@ -809,7 +797,7 @@ class Math_BigInteger * * Will be called, automatically, when unserialize() is called on a Math_BigInteger object. * - * @see __sleep() + * @see Math_BigInteger::__sleep() * @access public */ function __wakeup() @@ -817,7 +805,6 @@ class Math_BigInteger $temp = new Math_BigInteger($this->hex, -16); $this->value = $temp->value; $this->is_negative = $temp->is_negative; - $this->setRandomGenerator($this->generator); if ($this->precision > 0) { // recalculate $this->bitmask $this->setPrecision($this->precision); @@ -1876,7 +1863,7 @@ class Math_BigInteger * * For most $modes this will return the remainder. * - * @see _slidingWindow() + * @see Math_BigInteger::_slidingWindow() * @access private * @param array $x * @param array $n @@ -1913,7 +1900,7 @@ class Math_BigInteger /** * Modular reduction preperation * - * @see _slidingWindow() + * @see Math_BigInteger::_slidingWindow() * @access private * @param array $x * @param array $n @@ -1931,7 +1918,7 @@ class Math_BigInteger /** * Modular multiply * - * @see _slidingWindow() + * @see Math_BigInteger::_slidingWindow() * @access private * @param array $x * @param array $y @@ -1951,7 +1938,7 @@ class Math_BigInteger /** * Modular square * - * @see _slidingWindow() + * @see Math_BigInteger::_slidingWindow() * @access private * @param array $x * @param array $n @@ -1972,7 +1959,7 @@ class Math_BigInteger * Calculates $x%$n, where $n = 2**$e, for some $e. Since this is basically the same as doing $x & ($n-1), * we'll just use this function as a wrapper for doing that. * - * @see _slidingWindow() + * @see Math_BigInteger::_slidingWindow() * @access private * @param Math_BigInteger * @return Math_BigInteger @@ -2002,7 +1989,7 @@ class Math_BigInteger * (x >> 1) + (x >> 1) != x / 2 + x / 2. If x is even, they're the same, but if x is odd, they're not. See the in-line * comments for details. * - * @see _slidingWindow() + * @see Math_BigInteger::_slidingWindow() * @access private * @param array $n * @param array $m @@ -2099,7 +2086,7 @@ class Math_BigInteger * For numbers with more than four digits Math_BigInteger::_barrett() is faster. The difference between that and this * is that this function does not fold the denominator into a smaller form. * - * @see _slidingWindow() + * @see Math_BigInteger::_slidingWindow() * @access private * @param array $x * @param array $n @@ -2170,7 +2157,7 @@ class Math_BigInteger * * If you're going to be doing array_slice($product->value, 0, $stop), some cycles can be saved. * - * @see _regularBarrett() + * @see Math_BigInteger::_regularBarrett() * @param array $x_value * @param bool $x_negative * @param array $y_value @@ -2251,8 +2238,8 @@ class Math_BigInteger * improved upon (basically, by using the comba method). gcd($n, 2) must be equal to one for this function * to work correctly. * - * @see _prepMontgomery() - * @see _slidingWindow() + * @see Math_BigInteger::_prepMontgomery() + * @see Math_BigInteger::_slidingWindow() * @access private * @param array $x * @param array $n @@ -2298,8 +2285,8 @@ class Math_BigInteger * Interleaves the montgomery reduction and long multiplication algorithms together as described in * {@link http://www.cacr.math.uwaterloo.ca/hac/about/chap14.pdf#page=13 HAC 14.36} * - * @see _prepMontgomery() - * @see _montgomery() + * @see Math_BigInteger::_prepMontgomery() + * @see Math_BigInteger::_montgomery() * @access private * @param array $x * @param array $y @@ -2350,8 +2337,8 @@ class Math_BigInteger /** * Prepare a number for use in Montgomery Modular Reductions * - * @see _montgomery() - * @see _slidingWindow() + * @see Math_BigInteger::_montgomery() + * @see Math_BigInteger::_slidingWindow() * @access private * @param array $x * @param array $n @@ -2389,7 +2376,7 @@ class Math_BigInteger * * Thanks to Pedro Gimeno Fortea for input! * - * @see _montgomery() + * @see Math_BigInteger::_montgomery() * @access private * @param array $x * @return int @@ -2676,7 +2663,7 @@ class Math_BigInteger * @param Math_BigInteger $y * @return int < 0 if $this is less than $y; > 0 if $this is greater than $y, and 0 if they are equal. * @access public - * @see equals() + * @see Math_BigInteger::equals() * @internal Could return $this->subtract($x), but that's not as fast as what we do do. */ function compare($y) @@ -2699,7 +2686,7 @@ class Math_BigInteger * @param array $y_value * @param bool $y_negative * @return int - * @see compare() + * @see Math_BigInteger::compare() * @access private */ function _compare($x_value, $x_negative, $y_value, $y_negative) @@ -2735,7 +2722,7 @@ class Math_BigInteger * @param Math_BigInteger $x * @return bool * @access public - * @see compare() + * @see Math_BigInteger::compare() */ function equals($x) { @@ -3297,7 +3284,7 @@ class Math_BigInteger * * If the current number is odd it'll be unchanged. If it's even, one will be added to it. * - * @see randomPrime() + * @see Math_BigInteger::randomPrime() * @access private */ function _make_odd() @@ -3547,7 +3534,7 @@ class Math_BigInteger * * @param Math_BigInteger * @return Math_BigInteger - * @see _trim() + * @see Math_BigInteger::_trim() * @access private */ function _normalize($result) @@ -3727,7 +3714,7 @@ class Math_BigInteger * * The ability to DER-encode integers is needed to create RSA public keys for use with OpenSSL * - * @see modPow() + * @see Math_BigInteger::modPow() * @access private * @param int $length * @return string diff --git a/phpseclib/Net/SSH1.php b/phpseclib/Net/SSH1.php index 21c305a6..a1fb2b4f 100644 --- a/phpseclib/Net/SSH1.php +++ b/phpseclib/Net/SSH1.php @@ -437,7 +437,7 @@ class Net_SSH1 /** * Log Boundary * - * @see Net_SSH1::_format_log + * @see Net_SSH1::_format_log() * @access private */ var $log_boundary = ':'; @@ -445,7 +445,7 @@ class Net_SSH1 /** * Log Long Width * - * @see Net_SSH1::_format_log + * @see Net_SSH1::_format_log() * @access private */ var $log_long_width = 65; @@ -453,7 +453,7 @@ class Net_SSH1 /** * Log Short Width * - * @see Net_SSH1::_format_log + * @see Net_SSH1::_format_log() * @access private */ var $log_short_width = 16; diff --git a/phpseclib/Net/SSH2.php b/phpseclib/Net/SSH2.php index 07d7d452..4a89458f 100644 --- a/phpseclib/Net/SSH2.php +++ b/phpseclib/Net/SSH2.php @@ -1942,7 +1942,7 @@ class Net_SSH2 * @param mixed $password * @param mixed $... * @return bool - * @see _login + * @see Net_SSH2::_login() * @access public */ function login($username) @@ -1958,7 +1958,7 @@ class Net_SSH2 * @param mixed $password * @param mixed $... * @return bool - * @see _login_helper + * @see Net_SSH2::_login_helper() * @access private */ function _login($username)