diff --git a/composer.json b/composer.json index 275ea93c..6fa27842 100644 --- a/composer.json +++ b/composer.json @@ -72,7 +72,7 @@ "phpseclib/bootstrap.php" ], "psr-4": { - "phpseclib\\": "phpseclib/" + "phpseclib3\\": "phpseclib/" } } } diff --git a/phpseclib/Common/Functions/Strings.php b/phpseclib/Common/Functions/Strings.php index d1cc8543..166e1a17 100644 --- a/phpseclib/Common/Functions/Strings.php +++ b/phpseclib/Common/Functions/Strings.php @@ -13,10 +13,10 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Common\Functions; +namespace phpseclib3\Common\Functions; -use phpseclib\Math\BigInteger; -use phpseclib\Math\Common\FiniteField; +use phpseclib3\Math\BigInteger; +use phpseclib3\Math\Common\FiniteField; /** * Common String Functions @@ -182,7 +182,7 @@ abstract class Strings break; case 'i': if (!$element instanceof BigInteger && !$element instanceof FiniteField\Integer) { - throw new \InvalidArgumentException('A phpseclib\Math\BigInteger or phpseclib\Math\Common\FiniteField\Integer object was expected.'); + throw new \InvalidArgumentException('A phpseclib3\Math\BigInteger or phpseclib3\Math\Common\FiniteField\Integer object was expected.'); } $element = $element->toBytes(true); $result.= pack('Na*', strlen($element), $element); diff --git a/phpseclib/Crypt/AES.php b/phpseclib/Crypt/AES.php index 085e0315..23ea6e14 100644 --- a/phpseclib/Crypt/AES.php +++ b/phpseclib/Crypt/AES.php @@ -16,7 +16,7 @@ * it'll be null-padded to 192-bits and 192 bits will be the key length until {@link self::setKey() setKey()} * is called, again, at which point, it'll be recalculated. * - * Since \phpseclib\Crypt\AES extends \phpseclib\Crypt\Rijndael, some functions are available to be called that, in the context of AES, don't + * Since \phpseclib3\Crypt\AES extends \phpseclib3\Crypt\Rijndael, some functions are available to be called that, in the context of AES, don't * make a whole lot of sense. {@link self::setBlockLength() setBlockLength()}, for instance. Calling that function, * however possible, won't do anything (AES has a fixed block length whereas Rijndael has a variable one). * @@ -25,7 +25,7 @@ * setKey('abcdefghijklmnop'); * @@ -47,7 +47,7 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt; +namespace phpseclib3\Crypt; /** * Pure-PHP implementation of AES. @@ -61,9 +61,9 @@ class AES extends Rijndael /** * Dummy function * - * Since \phpseclib\Crypt\AES extends \phpseclib\Crypt\Rijndael, this function is, technically, available, but it doesn't do anything. + * Since \phpseclib3\Crypt\AES extends \phpseclib3\Crypt\Rijndael, this function is, technically, available, but it doesn't do anything. * - * @see \phpseclib\Crypt\Rijndael::setBlockLength() + * @see \phpseclib3\Crypt\Rijndael::setBlockLength() * @access public * @param int $length * @throws \BadMethodCallException anytime it's called @@ -78,7 +78,7 @@ class AES extends Rijndael * * Valid key lengths are 128, 192, and 256. Set the link to bool(false) to disable a fixed key length * - * @see \phpseclib\Crypt\Rijndael:setKeyLength() + * @see \phpseclib3\Crypt\Rijndael:setKeyLength() * @access public * @param int $length * @throws \LengthException if the key length isn't supported @@ -101,7 +101,7 @@ class AES extends Rijndael * * Rijndael supports five different key lengths, AES only supports three. * - * @see \phpseclib\Crypt\Rijndael:setKey() + * @see \phpseclib3\Crypt\Rijndael:setKey() * @see setKeyLength() * @access public * @param string $key diff --git a/phpseclib/Crypt/Blowfish.php b/phpseclib/Crypt/Blowfish.php index 54d28593..2a4ef639 100644 --- a/phpseclib/Crypt/Blowfish.php +++ b/phpseclib/Crypt/Blowfish.php @@ -16,7 +16,7 @@ * setKey('12345678901234567890123456789012'); * @@ -35,9 +35,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt; +namespace phpseclib3\Crypt; -use phpseclib\Crypt\Common\BlockCipher; +use phpseclib3\Crypt\Common\BlockCipher; /** * Pure-PHP implementation of Blowfish. @@ -52,7 +52,7 @@ class Blowfish extends BlockCipher /** * Block Length of the cipher * - * @see \phpseclib\Crypt\Common\SymmetricKey::block_size + * @see \phpseclib3\Crypt\Common\SymmetricKey::block_size * @var int * @access private */ @@ -61,7 +61,7 @@ class Blowfish extends BlockCipher /** * The mcrypt specific name of the cipher * - * @see \phpseclib\Crypt\Common\SymmetricKey::cipher_name_mcrypt + * @see \phpseclib3\Crypt\Common\SymmetricKey::cipher_name_mcrypt * @var string * @access private */ @@ -70,7 +70,7 @@ class Blowfish extends BlockCipher /** * Optimizing value while CFB-encrypting * - * @see \phpseclib\Crypt\Common\SymmetricKey::cfb_init_len + * @see \phpseclib3\Crypt\Common\SymmetricKey::cfb_init_len * @var int * @access private */ @@ -275,7 +275,7 @@ class Blowfish extends BlockCipher /** * The Key Length (in bytes) * - * @see \phpseclib\Crypt\Common\SymmetricKey::setKeyLength() + * @see \phpseclib3\Crypt\Common\SymmetricKey::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 @@ -323,9 +323,9 @@ class Blowfish extends BlockCipher /** * Test for engine validity * - * This is mainly just a wrapper to set things up for \phpseclib\Crypt\Common\SymmetricKey::isValidEngine() + * This is mainly just a wrapper to set things up for \phpseclib3\Crypt\Common\SymmetricKey::isValidEngine() * - * @see \phpseclib\Crypt\Common\SymmetricKey::isValidEngine() + * @see \phpseclib3\Crypt\Common\SymmetricKey::isValidEngine() * @param int $engine * @access protected * @return bool @@ -349,7 +349,7 @@ class Blowfish extends BlockCipher /** * Setup the key (expansion) * - * @see \phpseclib\Crypt\Common\SymmetricKey::_setupKey() + * @see \phpseclib3\Crypt\Common\SymmetricKey::_setupKey() * @access private */ protected function setupKey() @@ -472,7 +472,7 @@ class Blowfish extends BlockCipher /** * Setup the performance-optimized function for de/encrypt() * - * @see \phpseclib\Crypt\Common\SymmetricKey::_setupInlineCrypt() + * @see \phpseclib3\Crypt\Common\SymmetricKey::_setupInlineCrypt() * @access private */ protected function setupInlineCrypt() diff --git a/phpseclib/Crypt/ChaCha20.php b/phpseclib/Crypt/ChaCha20.php index 6e1d3919..dcd7f0e0 100644 --- a/phpseclib/Crypt/ChaCha20.php +++ b/phpseclib/Crypt/ChaCha20.php @@ -13,11 +13,11 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt; +namespace phpseclib3\Crypt; -use phpseclib\Crypt\Common\StreamCipher; -use phpseclib\Exception\InsufficientSetupException; -use phpseclib\Exception\BadDecryptionException; +use phpseclib3\Crypt\Common\StreamCipher; +use phpseclib3\Exception\InsufficientSetupException; +use phpseclib3\Exception\BadDecryptionException; /** * Pure-PHP implementation of ChaCha20. @@ -38,9 +38,9 @@ class ChaCha20 extends Salsa20 /** * Test for engine validity * - * This is mainly just a wrapper to set things up for \phpseclib\Crypt\Common\SymmetricKey::isValidEngine() + * This is mainly just a wrapper to set things up for \phpseclib3\Crypt\Common\SymmetricKey::isValidEngine() * - * @see \phpseclib\Crypt\Common\SymmetricKey::__construct() + * @see \phpseclib3\Crypt\Common\SymmetricKey::__construct() * @param int $engine * @access protected * @return bool @@ -79,7 +79,7 @@ class ChaCha20 extends Salsa20 /** * Encrypts a message. * - * @see \phpseclib\Crypt\Common\SymmetricKey::decrypt() + * @see \phpseclib3\Crypt\Common\SymmetricKey::decrypt() * @see self::crypt() * @param string $plaintext * @return string $ciphertext @@ -101,7 +101,7 @@ class ChaCha20 extends Salsa20 * $this->decrypt($this->encrypt($plaintext)) == $this->encrypt($this->encrypt($plaintext)). * At least if the continuous buffer is disabled. * - * @see \phpseclib\Crypt\Common\SymmetricKey::encrypt() + * @see \phpseclib3\Crypt\Common\SymmetricKey::encrypt() * @see self::crypt() * @param string $ciphertext * @return string $plaintext diff --git a/phpseclib/Crypt/Common/AsymmetricKey.php b/phpseclib/Crypt/Common/AsymmetricKey.php index 2970ab42..60ca9bb4 100644 --- a/phpseclib/Crypt/Common/AsymmetricKey.php +++ b/phpseclib/Crypt/Common/AsymmetricKey.php @@ -13,15 +13,15 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt\Common; +namespace phpseclib3\Crypt\Common; -use phpseclib\Exception\UnsupportedFormatException; -use phpseclib\Exception\NoKeyLoadedException; -use phpseclib\Math\BigInteger; -use phpseclib\Crypt\Hash; -use phpseclib\Crypt\RSA; -use phpseclib\Crypt\DSA; -use phpseclib\Crypt\ECDSA; +use phpseclib3\Exception\UnsupportedFormatException; +use phpseclib3\Exception\NoKeyLoadedException; +use phpseclib3\Math\BigInteger; +use phpseclib3\Crypt\Hash; +use phpseclib3\Crypt\RSA; +use phpseclib3\Crypt\DSA; +use phpseclib3\Crypt\ECDSA; /** * Base Class for all stream cipher classes @@ -34,7 +34,7 @@ abstract class AsymmetricKey /** * Precomputed Zero * - * @var \phpseclib\Math\BigInteger + * @var \phpseclib3\Math\BigInteger * @access private */ protected static $zero; @@ -42,7 +42,7 @@ abstract class AsymmetricKey /** * Precomputed One * - * @var \phpseclib\Math\BigInteger + * @var \phpseclib3\Math\BigInteger * @access private */ protected static $one; @@ -58,7 +58,7 @@ abstract class AsymmetricKey /** * Hash function * - * @var \phpseclib\Crypt\Hash + * @var \phpseclib3\Crypt\Hash * @access private */ protected $hash; @@ -66,7 +66,7 @@ abstract class AsymmetricKey /** * HMAC function * - * @var \phpseclib\Crypt\Hash + * @var \phpseclib3\Crypt\Hash * @access private */ private $hmac; @@ -249,7 +249,7 @@ abstract class AsymmetricKey continue; } $name = $file->getBasename('.php'); - $type = 'phpseclib\Crypt\\' . static::ALGORITHM . '\\Formats\\' . $format . '\\' . $name; + $type = 'phpseclib3\Crypt\\' . static::ALGORITHM . '\\Formats\\' . $format . '\\' . $name; $reflect = new \ReflectionClass($type); if ($reflect->isTrait()) { continue; @@ -440,7 +440,7 @@ abstract class AsymmetricKey * Integer to Octet String * * @access private - * @param \phpseclib\Math\BigInteger $v + * @param \phpseclib3\Math\BigInteger $v * @return string */ private function int2octets($v) @@ -461,7 +461,7 @@ abstract class AsymmetricKey * * @access private * @param string $in - * @return \phpseclib\Math\BigInteger + * @return \phpseclib3\Math\BigInteger */ protected function bits2int($in) { diff --git a/phpseclib/Crypt/Common/BlockCipher.php b/phpseclib/Crypt/Common/BlockCipher.php index 01cceb0b..a8ed74d8 100644 --- a/phpseclib/Crypt/Common/BlockCipher.php +++ b/phpseclib/Crypt/Common/BlockCipher.php @@ -14,7 +14,7 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt\Common; +namespace phpseclib3\Crypt\Common; /** * Base Class for all block cipher classes diff --git a/phpseclib/Crypt/Common/Formats/Keys/OpenSSH.php b/phpseclib/Crypt/Common/Formats/Keys/OpenSSH.php index b56b51f1..2e890845 100644 --- a/phpseclib/Crypt/Common/Formats/Keys/OpenSSH.php +++ b/phpseclib/Crypt/Common/Formats/Keys/OpenSSH.php @@ -15,11 +15,11 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt\Common\Formats\Keys; +namespace phpseclib3\Crypt\Common\Formats\Keys; use ParagonIE\ConstantTime\Base64; -use phpseclib\Common\Functions\Strings; -use phpseclib\Crypt\Random; +use phpseclib3\Common\Functions\Strings; +use phpseclib3\Crypt\Random; /** * OpenSSH Formatted RSA Key Handler diff --git a/phpseclib/Crypt/Common/Formats/Keys/PKCS.php b/phpseclib/Crypt/Common/Formats/Keys/PKCS.php index 5d87d5d0..2a0ad1f0 100644 --- a/phpseclib/Crypt/Common/Formats/Keys/PKCS.php +++ b/phpseclib/Crypt/Common/Formats/Keys/PKCS.php @@ -13,7 +13,7 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt\Common\Formats\Keys; +namespace phpseclib3\Crypt\Common\Formats\Keys; /** * PKCS1 Formatted Key Handler diff --git a/phpseclib/Crypt/Common/Formats/Keys/PKCS1.php b/phpseclib/Crypt/Common/Formats/Keys/PKCS1.php index ba8a028c..adaeb6b6 100644 --- a/phpseclib/Crypt/Common/Formats/Keys/PKCS1.php +++ b/phpseclib/Crypt/Common/Formats/Keys/PKCS1.php @@ -13,16 +13,16 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt\Common\Formats\Keys; +namespace phpseclib3\Crypt\Common\Formats\Keys; use ParagonIE\ConstantTime\Base64; use ParagonIE\ConstantTime\Hex; -use phpseclib\Crypt\Random; -use phpseclib\Crypt\AES; -use phpseclib\Crypt\DES; -use phpseclib\Crypt\TripleDES; -use phpseclib\File\ASN1; -use phpseclib\Exception\UnsupportedAlgorithmException; +use phpseclib3\Crypt\Random; +use phpseclib3\Crypt\AES; +use phpseclib3\Crypt\DES; +use phpseclib3\Crypt\TripleDES; +use phpseclib3\File\ASN1; +use phpseclib3\Exception\UnsupportedAlgorithmException; /** * PKCS1 Formatted Key Handler diff --git a/phpseclib/Crypt/Common/Formats/Keys/PKCS8.php b/phpseclib/Crypt/Common/Formats/Keys/PKCS8.php index 4b2c51f8..8d0f950e 100644 --- a/phpseclib/Crypt/Common/Formats/Keys/PKCS8.php +++ b/phpseclib/Crypt/Common/Formats/Keys/PKCS8.php @@ -25,19 +25,19 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt\Common\Formats\Keys; +namespace phpseclib3\Crypt\Common\Formats\Keys; use ParagonIE\ConstantTime\Base64; -use phpseclib\Crypt\DES; -use phpseclib\Crypt\RC2; -use phpseclib\Crypt\RC4; -use phpseclib\Crypt\AES; -use phpseclib\Crypt\TripleDES; -use phpseclib\Crypt\Random; -use phpseclib\Math\BigInteger; -use phpseclib\File\ASN1; -use phpseclib\File\ASN1\Maps; -use phpseclib\Exception\UnsupportedAlgorithmException; +use phpseclib3\Crypt\DES; +use phpseclib3\Crypt\RC2; +use phpseclib3\Crypt\RC4; +use phpseclib3\Crypt\AES; +use phpseclib3\Crypt\TripleDES; +use phpseclib3\Crypt\Random; +use phpseclib3\Math\BigInteger; +use phpseclib3\File\ASN1; +use phpseclib3\File\ASN1\Maps; +use phpseclib3\Exception\UnsupportedAlgorithmException; /** * PKCS#8 Formatted Key Handler @@ -139,7 +139,7 @@ abstract class PKCS8 extends PKCS /** * Returns a SymmetricKey object based on a PBES1 $algo * - * @return \phpseclib\Crypt\Common\SymmetricKey + * @return \phpseclib3\Crypt\Common\SymmetricKey * @access public * @param string $algo */ diff --git a/phpseclib/Crypt/Common/Formats/Keys/PuTTY.php b/phpseclib/Crypt/Common/Formats/Keys/PuTTY.php index 553a1ddd..51b03f0e 100644 --- a/phpseclib/Crypt/Common/Formats/Keys/PuTTY.php +++ b/phpseclib/Crypt/Common/Formats/Keys/PuTTY.php @@ -13,15 +13,15 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt\Common\Formats\Keys; +namespace phpseclib3\Crypt\Common\Formats\Keys; use ParagonIE\ConstantTime\Base64; use ParagonIE\ConstantTime\Hex; -use phpseclib\Crypt\AES; -use phpseclib\Crypt\Hash; -use phpseclib\Crypt\Random; -use phpseclib\Common\Functions\Strings; -use phpseclib\Exception\UnsupportedAlgorithmException; +use phpseclib3\Crypt\AES; +use phpseclib3\Crypt\Hash; +use phpseclib3\Crypt\Random; +use phpseclib3\Common\Functions\Strings; +use phpseclib3\Exception\UnsupportedAlgorithmException; /** * PuTTY Formatted Key Handler diff --git a/phpseclib/Crypt/Common/Formats/Signature/Raw.php b/phpseclib/Crypt/Common/Formats/Signature/Raw.php index 9f97e08c..13e56e3b 100644 --- a/phpseclib/Crypt/Common/Formats/Signature/Raw.php +++ b/phpseclib/Crypt/Common/Formats/Signature/Raw.php @@ -15,9 +15,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt\Common\Formats\Signature; +namespace phpseclib3\Crypt\Common\Formats\Signature; -use phpseclib\Math\BigInteger; +use phpseclib3\Math\BigInteger; /** * Raw Signature Handler @@ -55,8 +55,8 @@ abstract class Raw * Returns a signature in the appropriate format * * @access public - * @param \phpseclib\Math\BigInteger $r - * @param \phpseclib\Math\BigInteger $s + * @param \phpseclib3\Math\BigInteger $r + * @param \phpseclib3\Math\BigInteger $s * @return string */ public static function save(BigInteger $r, BigInteger $s) diff --git a/phpseclib/Crypt/Common/PrivateKey.php b/phpseclib/Crypt/Common/PrivateKey.php index 4de3c0e7..00712328 100644 --- a/phpseclib/Crypt/Common/PrivateKey.php +++ b/phpseclib/Crypt/Common/PrivateKey.php @@ -11,7 +11,7 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt\Common; +namespace phpseclib3\Crypt\Common; /** * PrivateKey interface diff --git a/phpseclib/Crypt/Common/PublicKey.php b/phpseclib/Crypt/Common/PublicKey.php index 1bc3fc3f..0696de18 100644 --- a/phpseclib/Crypt/Common/PublicKey.php +++ b/phpseclib/Crypt/Common/PublicKey.php @@ -11,7 +11,7 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt\Common; +namespace phpseclib3\Crypt\Common; /** * PublicKey interface diff --git a/phpseclib/Crypt/Common/StreamCipher.php b/phpseclib/Crypt/Common/StreamCipher.php index 01b055b2..00107803 100644 --- a/phpseclib/Crypt/Common/StreamCipher.php +++ b/phpseclib/Crypt/Common/StreamCipher.php @@ -14,7 +14,7 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt\Common; +namespace phpseclib3\Crypt\Common; /** * Base Class for all stream cipher classes diff --git a/phpseclib/Crypt/Common/SymmetricKey.php b/phpseclib/Crypt/Common/SymmetricKey.php index 8c16a784..e41af0bc 100644 --- a/phpseclib/Crypt/Common/SymmetricKey.php +++ b/phpseclib/Crypt/Common/SymmetricKey.php @@ -1,14 +1,14 @@ @@ -58,8 +58,8 @@ abstract class SymmetricKey { /**#@+ * @access public - * @see \phpseclib\Crypt\Common\SymmetricKey::encrypt() - * @see \phpseclib\Crypt\Common\SymmetricKey::decrypt() + * @see \phpseclib3\Crypt\Common\SymmetricKey::encrypt() + * @see \phpseclib3\Crypt\Common\SymmetricKey::decrypt() */ /** * Encrypt / decrypt using the Counter mode. @@ -113,7 +113,7 @@ abstract class SymmetricKey * Mode Map * * @access private - * @see \phpseclib\Crypt\Common\SymmetricKey::__construct() + * @see \phpseclib3\Crypt\Common\SymmetricKey::__construct() */ const MODE_MAP = [ 'ctr' => self::MODE_CTR, @@ -128,7 +128,7 @@ abstract class SymmetricKey /**#@+ * @access private - * @see \phpseclib\Crypt\Common\SymmetricKey::__construct() + * @see \phpseclib3\Crypt\Common\SymmetricKey::__construct() */ /** * Base value for the internal implementation $engine switch @@ -160,7 +160,7 @@ abstract class SymmetricKey * Engine Reverse Map * * @access private - * @see \phpseclib\Crypt\Common\SymmetricKey::getEngine() + * @see \phpseclib3\Crypt\Common\SymmetricKey::getEngine() */ const ENGINE_MAP = [ self::ENGINE_INTERNAL => 'PHP', @@ -282,8 +282,8 @@ abstract class SymmetricKey /** * Does the enmcrypt resource need to be (re)initialized? * - * @see \phpseclib\Crypt\Twofish::setKey() - * @see \phpseclib\Crypt\Twofish::setIV() + * @see \phpseclib3\Crypt\Twofish::setKey() + * @see \phpseclib3\Crypt\Twofish::setIV() * @var bool * @access private */ @@ -292,8 +292,8 @@ abstract class SymmetricKey /** * Does the demcrypt resource need to be (re)initialized? * - * @see \phpseclib\Crypt\Twofish::setKey() - * @see \phpseclib\Crypt\Twofish::setIV() + * @see \phpseclib3\Crypt\Twofish::setKey() + * @see \phpseclib3\Crypt\Twofish::setIV() * @var bool * @access private */ @@ -1028,7 +1028,7 @@ abstract class SymmetricKey * @see self::setPassword() * @access private * @param int $n - * @param \phpseclib\Crypt\Hash $hashObj + * @param \phpseclib3\Crypt\Hash $hashObj * @param string $i * @param string $d * @param int $count @@ -2068,7 +2068,7 @@ abstract class SymmetricKey * outputs. The reason is due to the fact that the initialization vector's change after every encryption / * decryption round when the continuous buffer is enabled. When it's disabled, they remain constant. * - * Put another way, when the continuous buffer is enabled, the state of the \phpseclib\Crypt\*() object changes after each + * Put another way, when the continuous buffer is enabled, the state of the \phpseclib3\Crypt\*() object changes after each * encryption / decryption round, whereas otherwise, it'd remain constant. For this reason, it's recommended that * continuous buffers not be used. They do offer better security and are, in fact, sometimes required (SSH uses them), * however, they are also less intuitive and more likely to cause you problems. @@ -2283,7 +2283,7 @@ abstract class SymmetricKey /** * Encrypts a block * - * Note: Must be extended by the child \phpseclib\Crypt\* class + * Note: Must be extended by the child \phpseclib3\Crypt\* class * * @access private * @param string $in @@ -2294,7 +2294,7 @@ abstract class SymmetricKey /** * Decrypts a block * - * Note: Must be extended by the child \phpseclib\Crypt\* class + * Note: Must be extended by the child \phpseclib3\Crypt\* class * * @access private * @param string $in @@ -2307,7 +2307,7 @@ abstract class SymmetricKey * * Only used if $engine == self::ENGINE_INTERNAL * - * Note: Must extend by the child \phpseclib\Crypt\* class + * Note: Must extend by the child \phpseclib3\Crypt\* class * * @see self::setup() * @access private @@ -2522,7 +2522,7 @@ abstract class SymmetricKey * - short (as good as possible) * * Note: - _setupInlineCrypt() is using _createInlineCryptFunction() to create the full callback function code. - * - In case of using inline crypting, _setupInlineCrypt() must extend by the child \phpseclib\Crypt\* class. + * - In case of using inline crypting, _setupInlineCrypt() must extend by the child \phpseclib3\Crypt\* class. * - The following variable names are reserved: * - $_* (all variable names prefixed with an underscore) * - $self (object reference to it self. Do not use $this, but $self instead) @@ -2629,7 +2629,7 @@ abstract class SymmetricKey * +----------------------------------------------------------------------------------------------+ * * - * See also the \phpseclib\Crypt\*::_setupInlineCrypt()'s for + * See also the \phpseclib3\Crypt\*::_setupInlineCrypt()'s for * productive inline $cipher_code's how they works. * * Structure of: @@ -2706,10 +2706,10 @@ abstract class SymmetricKey if (strlen($_block) > strlen($_buffer["ciphertext"])) { $in = $_xor; '.$encrypt_block.' - \phpseclib\Common\Functions\Strings::increment_str($_xor); + \phpseclib3\Common\Functions\Strings::increment_str($_xor); $_buffer["ciphertext"].= $in; } - $_key = \phpseclib\Common\Functions\Strings::shift($_buffer["ciphertext"], '.$block_size.'); + $_key = \phpseclib3\Common\Functions\Strings::shift($_buffer["ciphertext"], '.$block_size.'); $_ciphertext.= $_block ^ $_key; } } else { @@ -2717,7 +2717,7 @@ abstract class SymmetricKey $_block = substr($_text, $_i, '.$block_size.'); $in = $_xor; '.$encrypt_block.' - \phpseclib\Common\Functions\Strings::increment_str($_xor); + \phpseclib3\Common\Functions\Strings::increment_str($_xor); $_key = $in; $_ciphertext.= $_block ^ $_key; } @@ -2744,10 +2744,10 @@ abstract class SymmetricKey if (strlen($_block) > strlen($_buffer["ciphertext"])) { $in = $_xor; '.$encrypt_block.' - \phpseclib\Common\Functions\Strings::increment_str($_xor); + \phpseclib3\Common\Functions\Strings::increment_str($_xor); $_buffer["ciphertext"].= $in; } - $_key = \phpseclib\Common\Functions\Strings::shift($_buffer["ciphertext"], '.$block_size.'); + $_key = \phpseclib3\Common\Functions\Strings::shift($_buffer["ciphertext"], '.$block_size.'); $_plaintext.= $_block ^ $_key; } } else { @@ -2755,7 +2755,7 @@ abstract class SymmetricKey $_block = substr($_text, $_i, '.$block_size.'); $in = $_xor; '.$encrypt_block.' - \phpseclib\Common\Functions\Strings::increment_str($_xor); + \phpseclib3\Common\Functions\Strings::increment_str($_xor); $_key = $in; $_plaintext.= $_block ^ $_key; } @@ -2931,7 +2931,7 @@ abstract class SymmetricKey $_xor = $in; $_buffer["xor"].= $_xor; } - $_key = \phpseclib\Common\Functions\Strings::shift($_buffer["xor"], '.$block_size.'); + $_key = \phpseclib3\Common\Functions\Strings::shift($_buffer["xor"], '.$block_size.'); $_ciphertext.= $_block ^ $_key; } } else { @@ -2967,7 +2967,7 @@ abstract class SymmetricKey $_xor = $in; $_buffer["xor"].= $_xor; } - $_key = \phpseclib\Common\Functions\Strings::shift($_buffer["xor"], '.$block_size.'); + $_key = \phpseclib3\Common\Functions\Strings::shift($_buffer["xor"], '.$block_size.'); $_plaintext.= $_block ^ $_key; } } else { diff --git a/phpseclib/Crypt/Common/Traits/Fingerprint.php b/phpseclib/Crypt/Common/Traits/Fingerprint.php index 687ebb1c..0db9c84a 100644 --- a/phpseclib/Crypt/Common/Traits/Fingerprint.php +++ b/phpseclib/Crypt/Common/Traits/Fingerprint.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt\Common\Traits; +namespace phpseclib3\Crypt\Common\Traits; -use phpseclib\Crypt\Hash; +use phpseclib3\Crypt\Hash; /** * Fingerprint Trait for Private Keys diff --git a/phpseclib/Crypt/Common/Traits/PasswordProtected.php b/phpseclib/Crypt/Common/Traits/PasswordProtected.php index fa9a8692..058f9b94 100644 --- a/phpseclib/Crypt/Common/Traits/PasswordProtected.php +++ b/phpseclib/Crypt/Common/Traits/PasswordProtected.php @@ -13,7 +13,7 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt\Common\Traits; +namespace phpseclib3\Crypt\Common\Traits; /** * Password Protected Trait for Private Keys diff --git a/phpseclib/Crypt/DES.php b/phpseclib/Crypt/DES.php index 40c0f947..af6512d8 100644 --- a/phpseclib/Crypt/DES.php +++ b/phpseclib/Crypt/DES.php @@ -18,7 +18,7 @@ * setKey('abcdefgh'); * @@ -40,10 +40,10 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt; +namespace phpseclib3\Crypt; -use phpseclib\Crypt\Common\BlockCipher; -use phpseclib\Exception\BadModeException; +use phpseclib3\Crypt\Common\BlockCipher; +use phpseclib3\Exception\BadModeException; /** * Pure-PHP implementation of DES. @@ -56,8 +56,8 @@ class DES extends BlockCipher { /**#@+ * @access private - * @see \phpseclib\Crypt\DES::setupKey() - * @see \phpseclib\Crypt\DES::processBlock() + * @see \phpseclib3\Crypt\DES::setupKey() + * @see \phpseclib3\Crypt\DES::processBlock() */ /** * Contains $keys[self::ENCRYPT] @@ -72,7 +72,7 @@ class DES extends BlockCipher /** * Block Length of the cipher * - * @see \phpseclib\Crypt\Common\SymmetricKey::block_size + * @see \phpseclib3\Crypt\Common\SymmetricKey::block_size * @var int * @access private */ @@ -81,7 +81,7 @@ class DES extends BlockCipher /** * Key Length (in bytes) * - * @see \phpseclib\Crypt\Common\SymmetricKey::setKeyLength() + * @see \phpseclib3\Crypt\Common\SymmetricKey::setKeyLength() * @var int * @access private */ @@ -90,7 +90,7 @@ class DES extends BlockCipher /** * The mcrypt specific name of the cipher * - * @see \phpseclib\Crypt\Common\SymmetricKey::cipher_name_mcrypt + * @see \phpseclib3\Crypt\Common\SymmetricKey::cipher_name_mcrypt * @var string * @access private */ @@ -99,7 +99,7 @@ class DES extends BlockCipher /** * The OpenSSL names of the cipher / modes * - * @see \phpseclib\Crypt\Common\SymmetricKey::openssl_mode_names + * @see \phpseclib3\Crypt\Common\SymmetricKey::openssl_mode_names * @var array * @access private */ @@ -114,7 +114,7 @@ class DES extends BlockCipher /** * Optimizing value while CFB-encrypting * - * @see \phpseclib\Crypt\Common\SymmetricKey::cfb_init_len + * @see \phpseclib3\Crypt\Common\SymmetricKey::cfb_init_len * @var int * @access private */ @@ -600,9 +600,9 @@ class DES extends BlockCipher /** * Test for engine validity * - * This is mainly just a wrapper to set things up for \phpseclib\Crypt\Common\SymmetricKey::isValidEngine() + * This is mainly just a wrapper to set things up for \phpseclib3\Crypt\Common\SymmetricKey::isValidEngine() * - * @see \phpseclib\Crypt\Common\SymmetricKey::isValidEngine() + * @see \phpseclib3\Crypt\Common\SymmetricKey::isValidEngine() * @param int $engine * @access protected * @return bool @@ -626,7 +626,7 @@ class DES extends BlockCipher * * DES also requires that every eighth bit be a parity bit, however, we'll ignore that. * - * @see \phpseclib\Crypt\Common\SymmetricKey::setKey() + * @see \phpseclib3\Crypt\Common\SymmetricKey::setKey() * @access public * @param string $key */ @@ -643,8 +643,8 @@ class DES extends BlockCipher /** * Encrypts a block * - * @see \phpseclib\Crypt\Common\SymmetricKey::encryptBlock() - * @see \phpseclib\Crypt\Common\SymmetricKey::encrypt() + * @see \phpseclib3\Crypt\Common\SymmetricKey::encryptBlock() + * @see \phpseclib3\Crypt\Common\SymmetricKey::encrypt() * @see self::encrypt() * @access private * @param string $in @@ -658,8 +658,8 @@ class DES extends BlockCipher /** * Decrypts a block * - * @see \phpseclib\Crypt\Common\SymmetricKey::decryptBlock() - * @see \phpseclib\Crypt\Common\SymmetricKey::decrypt() + * @see \phpseclib3\Crypt\Common\SymmetricKey::decryptBlock() + * @see \phpseclib3\Crypt\Common\SymmetricKey::decrypt() * @see self::decrypt() * @access private * @param string $in @@ -762,7 +762,7 @@ class DES extends BlockCipher /** * Creates the key schedule * - * @see \phpseclib\Crypt\Common\SymmetricKey::setupKey() + * @see \phpseclib3\Crypt\Common\SymmetricKey::setupKey() * @access private */ protected function setupKey() @@ -1297,7 +1297,7 @@ class DES extends BlockCipher /** * Setup the performance-optimized function for de/encrypt() * - * @see \phpseclib\Crypt\Common\SymmetricKey::setupInlineCrypt() + * @see \phpseclib3\Crypt\Common\SymmetricKey::setupInlineCrypt() * @access private */ protected function setupInlineCrypt() diff --git a/phpseclib/Crypt/DH.php b/phpseclib/Crypt/DH.php index 098aef3e..3a957b1d 100644 --- a/phpseclib/Crypt/DH.php +++ b/phpseclib/Crypt/DH.php @@ -10,7 +10,7 @@ * @@ -24,15 +24,15 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt; +namespace phpseclib3\Crypt; -use phpseclib\Exception\NoKeyLoadedException; -use phpseclib\Exception\UnsupportedOperationException; -use phpseclib\Crypt\Common\AsymmetricKey; -use phpseclib\Crypt\DH\PrivateKey; -use phpseclib\Crypt\DH\PublicKey; -use phpseclib\Crypt\DH\Parameters; -use phpseclib\Math\BigInteger; +use phpseclib3\Exception\NoKeyLoadedException; +use phpseclib3\Exception\UnsupportedOperationException; +use phpseclib3\Crypt\Common\AsymmetricKey; +use phpseclib3\Crypt\DH\PrivateKey; +use phpseclib3\Crypt\DH\PublicKey; +use phpseclib3\Crypt\DH\Parameters; +use phpseclib3\Math\BigInteger; /** * Pure-PHP (EC)DH implementation @@ -54,7 +54,7 @@ abstract class DH extends AsymmetricKey /** * DH prime * - * @var \phpseclib\Math\BigInteger + * @var \phpseclib3\Math\BigInteger * @access private */ protected $prime; @@ -64,7 +64,7 @@ abstract class DH extends AsymmetricKey * * Prime divisor of p-1 * - * @var \phpseclib\Math\BigInteger + * @var \phpseclib3\Math\BigInteger * @access private */ protected $base; @@ -78,7 +78,7 @@ abstract class DH extends AsymmetricKey * - a string (eg. diffie-hellman-group14-sha1) * * @access public - * @return \phpseclib\Crypt\DH|bool + * @return \phpseclib3\Crypt\DH|bool */ public static function createParameters(...$args) { diff --git a/phpseclib/Crypt/DH/Formats/Keys/PKCS1.php b/phpseclib/Crypt/DH/Formats/Keys/PKCS1.php index 86561565..368b187f 100644 --- a/phpseclib/Crypt/DH/Formats/Keys/PKCS1.php +++ b/phpseclib/Crypt/DH/Formats/Keys/PKCS1.php @@ -21,12 +21,12 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt\DH\Formats\Keys; +namespace phpseclib3\Crypt\DH\Formats\Keys; -use phpseclib\Math\BigInteger; -use phpseclib\Crypt\Common\Formats\Keys\PKCS1 as Progenitor; -use phpseclib\File\ASN1; -use phpseclib\File\ASN1\Maps; +use phpseclib3\Math\BigInteger; +use phpseclib3\Crypt\Common\Formats\Keys\PKCS1 as Progenitor; +use phpseclib3\File\ASN1; +use phpseclib3\File\ASN1\Maps; /** * "PKCS1" Formatted DH Key Handler diff --git a/phpseclib/Crypt/DH/Formats/Keys/PKCS8.php b/phpseclib/Crypt/DH/Formats/Keys/PKCS8.php index 423c185e..59b42646 100644 --- a/phpseclib/Crypt/DH/Formats/Keys/PKCS8.php +++ b/phpseclib/Crypt/DH/Formats/Keys/PKCS8.php @@ -19,12 +19,12 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt\DH\Formats\Keys; +namespace phpseclib3\Crypt\DH\Formats\Keys; -use phpseclib\Math\BigInteger; -use phpseclib\Crypt\Common\Formats\Keys\PKCS8 as Progenitor; -use phpseclib\File\ASN1; -use phpseclib\File\ASN1\Maps; +use phpseclib3\Math\BigInteger; +use phpseclib3\Crypt\Common\Formats\Keys\PKCS8 as Progenitor; +use phpseclib3\File\ASN1; +use phpseclib3\File\ASN1\Maps; /** * PKCS#8 Formatted DH Key Handler @@ -112,10 +112,10 @@ abstract class PKCS8 extends Progenitor * Convert a private key to the appropriate format. * * @access public - * @param \phpseclib\Math\BigInteger $prime - * @param \phpseclib\Math\BigInteger $base - * @param \phpseclib\Math\BigInteger $privateKey - * @param \phpseclib\Math\BigInteger $publicKey + * @param \phpseclib3\Math\BigInteger $prime + * @param \phpseclib3\Math\BigInteger $base + * @param \phpseclib3\Math\BigInteger $privateKey + * @param \phpseclib3\Math\BigInteger $publicKey * @param string $password optional * @param array $options optional * @return string @@ -136,9 +136,9 @@ abstract class PKCS8 extends Progenitor * Convert a public key to the appropriate format * * @access public - * @param \phpseclib\Math\BigInteger $prime - * @param \phpseclib\Math\BigInteger $base - * @param \phpseclib\Math\BigInteger $publicKey + * @param \phpseclib3\Math\BigInteger $prime + * @param \phpseclib3\Math\BigInteger $base + * @param \phpseclib3\Math\BigInteger $publicKey * @param array $options optional * @return string */ diff --git a/phpseclib/Crypt/DH/Parameters.php b/phpseclib/Crypt/DH/Parameters.php index d07ebea3..d36283d0 100644 --- a/phpseclib/Crypt/DH/Parameters.php +++ b/phpseclib/Crypt/DH/Parameters.php @@ -11,9 +11,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt\DH; +namespace phpseclib3\Crypt\DH; -use phpseclib\Crypt\DH; +use phpseclib3\Crypt\DH; /** * DH Parameters diff --git a/phpseclib/Crypt/DH/PrivateKey.php b/phpseclib/Crypt/DH/PrivateKey.php index 67a01188..8756b419 100644 --- a/phpseclib/Crypt/DH/PrivateKey.php +++ b/phpseclib/Crypt/DH/PrivateKey.php @@ -11,10 +11,10 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt\DH; +namespace phpseclib3\Crypt\DH; -use phpseclib\Crypt\DH; -use phpseclib\Crypt\Common; +use phpseclib3\Crypt\DH; +use phpseclib3\Crypt\Common; /** * DH Private Key @@ -30,7 +30,7 @@ class PrivateKey extends DH /** * Private Key * - * @var \phpseclib\Math\BigInteger + * @var \phpseclib3\Math\BigInteger * @access private */ protected $privateKey; @@ -38,7 +38,7 @@ class PrivateKey extends DH /** * Public Key * - * @var \phpseclib\Math\BigInteger + * @var \phpseclib3\Math\BigInteger * @access private */ protected $publicKey; diff --git a/phpseclib/Crypt/DH/PublicKey.php b/phpseclib/Crypt/DH/PublicKey.php index 1ae00486..9670e28a 100644 --- a/phpseclib/Crypt/DH/PublicKey.php +++ b/phpseclib/Crypt/DH/PublicKey.php @@ -11,10 +11,10 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt\DH; +namespace phpseclib3\Crypt\DH; -use phpseclib\Crypt\DH; -use phpseclib\Crypt\Common; +use phpseclib3\Crypt\DH; +use phpseclib3\Crypt\Common; /** * DH Public Key @@ -44,7 +44,7 @@ class PublicKey extends DH /** * Returns the public key as a BigInteger * - * @return \phpseclib\Math\BigInteger + * @return \phpseclib3\Math\BigInteger */ public function toBigInteger() { diff --git a/phpseclib/Crypt/DSA.php b/phpseclib/Crypt/DSA.php index 919d83e7..ff62a290 100644 --- a/phpseclib/Crypt/DSA.php +++ b/phpseclib/Crypt/DSA.php @@ -10,7 +10,7 @@ * getPublicKey(); * * $plaintext = 'terrafrost'; @@ -29,14 +29,14 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt; +namespace phpseclib3\Crypt; -use phpseclib\Crypt\Common\AsymmetricKey; -use phpseclib\Crypt\DSA\PrivateKey; -use phpseclib\Crypt\DSA\PublicKey; -use phpseclib\Crypt\DSA\Parameters; -use phpseclib\Math\BigInteger; -use phpseclib\Exception\InsufficientSetupException; +use phpseclib3\Crypt\Common\AsymmetricKey; +use phpseclib3\Crypt\DSA\PrivateKey; +use phpseclib3\Crypt\DSA\PublicKey; +use phpseclib3\Crypt\DSA\Parameters; +use phpseclib3\Math\BigInteger; +use phpseclib3\Exception\InsufficientSetupException; /** * Pure-PHP FIPS 186-4 compliant implementation of DSA. @@ -58,7 +58,7 @@ abstract class DSA extends AsymmetricKey /** * DSA Prime P * - * @var \phpseclib\Math\BigInteger + * @var \phpseclib3\Math\BigInteger * @access private */ protected $p; @@ -68,7 +68,7 @@ abstract class DSA extends AsymmetricKey * * Prime divisor of p-1 * - * @var \phpseclib\Math\BigInteger + * @var \phpseclib3\Math\BigInteger * @access private */ protected $q; @@ -76,7 +76,7 @@ abstract class DSA extends AsymmetricKey /** * DSA Group Generator G * - * @var \phpseclib\Math\BigInteger + * @var \phpseclib3\Math\BigInteger * @access private */ protected $g; @@ -84,7 +84,7 @@ abstract class DSA extends AsymmetricKey /** * DSA public key value y * - * @var \phpseclib\Math\BigInteger + * @var \phpseclib3\Math\BigInteger * @access private */ protected $y; @@ -111,7 +111,7 @@ abstract class DSA extends AsymmetricKey * @access public * @param int $L * @param int $N - * @return \phpseclib\Crypt\DSA|bool + * @return \phpseclib3\Crypt\DSA|bool */ public static function createParameters($L = 2048, $N = 224) { diff --git a/phpseclib/Crypt/DSA/Formats/Keys/OpenSSH.php b/phpseclib/Crypt/DSA/Formats/Keys/OpenSSH.php index 75c13555..99ac4932 100644 --- a/phpseclib/Crypt/DSA/Formats/Keys/OpenSSH.php +++ b/phpseclib/Crypt/DSA/Formats/Keys/OpenSSH.php @@ -15,12 +15,12 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt\DSA\Formats\Keys; +namespace phpseclib3\Crypt\DSA\Formats\Keys; use ParagonIE\ConstantTime\Base64; -use phpseclib\Math\BigInteger; -use phpseclib\Common\Functions\Strings; -use phpseclib\Crypt\Common\Formats\Keys\OpenSSH as Progenitor; +use phpseclib3\Math\BigInteger; +use phpseclib3\Common\Functions\Strings; +use phpseclib3\Crypt\Common\Formats\Keys\OpenSSH as Progenitor; /** * OpenSSH Formatted DSA Key Handler @@ -72,10 +72,10 @@ abstract class OpenSSH extends Progenitor * Convert a public key to the appropriate format * * @access public - * @param \phpseclib\Math\BigInteger $p - * @param \phpseclib\Math\BigInteger $q - * @param \phpseclib\Math\BigInteger $g - * @param \phpseclib\Math\BigInteger $y + * @param \phpseclib3\Math\BigInteger $p + * @param \phpseclib3\Math\BigInteger $q + * @param \phpseclib3\Math\BigInteger $g + * @param \phpseclib3\Math\BigInteger $y * @param array $options optional * @return string */ @@ -107,11 +107,11 @@ abstract class OpenSSH extends Progenitor * Convert a private key to the appropriate format. * * @access public - * @param \phpseclib\Math\BigInteger $p - * @param \phpseclib\Math\BigInteger $q - * @param \phpseclib\Math\BigInteger $g - * @param \phpseclib\Math\BigInteger $x - * @param \phpseclib\Math\BigInteger $y + * @param \phpseclib3\Math\BigInteger $p + * @param \phpseclib3\Math\BigInteger $q + * @param \phpseclib3\Math\BigInteger $g + * @param \phpseclib3\Math\BigInteger $x + * @param \phpseclib3\Math\BigInteger $y * @param string $password optional * @param array $options optional * @return string diff --git a/phpseclib/Crypt/DSA/Formats/Keys/PKCS1.php b/phpseclib/Crypt/DSA/Formats/Keys/PKCS1.php index fd1efcf2..83370bfc 100644 --- a/phpseclib/Crypt/DSA/Formats/Keys/PKCS1.php +++ b/phpseclib/Crypt/DSA/Formats/Keys/PKCS1.php @@ -27,12 +27,12 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt\DSA\Formats\Keys; +namespace phpseclib3\Crypt\DSA\Formats\Keys; -use phpseclib\Math\BigInteger; -use phpseclib\Crypt\Common\Formats\Keys\PKCS1 as Progenitor; -use phpseclib\File\ASN1; -use phpseclib\File\ASN1\Maps; +use phpseclib3\Math\BigInteger; +use phpseclib3\Crypt\Common\Formats\Keys\PKCS1 as Progenitor; +use phpseclib3\File\ASN1; +use phpseclib3\File\ASN1\Maps; use ParagonIE\ConstantTime\Base64; /** @@ -83,9 +83,9 @@ abstract class PKCS1 extends Progenitor * Convert DSA parameters to the appropriate format * * @access public - * @param \phpseclib\Math\BigInteger $p - * @param \phpseclib\Math\BigInteger $q - * @param \phpseclib\Math\BigInteger $g + * @param \phpseclib3\Math\BigInteger $p + * @param \phpseclib3\Math\BigInteger $q + * @param \phpseclib3\Math\BigInteger $g * @return string */ public static function saveParameters(BigInteger $p, BigInteger $q, BigInteger $g) @@ -107,11 +107,11 @@ abstract class PKCS1 extends Progenitor * Convert a private key to the appropriate format. * * @access public - * @param \phpseclib\Math\BigInteger $p - * @param \phpseclib\Math\BigInteger $q - * @param \phpseclib\Math\BigInteger $g - * @param \phpseclib\Math\BigInteger $x - * @param \phpseclib\Math\BigInteger $y + * @param \phpseclib3\Math\BigInteger $p + * @param \phpseclib3\Math\BigInteger $q + * @param \phpseclib3\Math\BigInteger $g + * @param \phpseclib3\Math\BigInteger $x + * @param \phpseclib3\Math\BigInteger $y * @param string $password optional * @param array $options optional * @return string @@ -136,10 +136,10 @@ abstract class PKCS1 extends Progenitor * Convert a public key to the appropriate format * * @access public - * @param \phpseclib\Math\BigInteger $p - * @param \phpseclib\Math\BigInteger $q - * @param \phpseclib\Math\BigInteger $g - * @param \phpseclib\Math\BigInteger $y + * @param \phpseclib3\Math\BigInteger $p + * @param \phpseclib3\Math\BigInteger $q + * @param \phpseclib3\Math\BigInteger $g + * @param \phpseclib3\Math\BigInteger $y * @return string */ public static function savePublicKey(BigInteger $p, BigInteger $q, BigInteger $g, BigInteger $y) diff --git a/phpseclib/Crypt/DSA/Formats/Keys/PKCS8.php b/phpseclib/Crypt/DSA/Formats/Keys/PKCS8.php index d8e2796a..4c79c969 100644 --- a/phpseclib/Crypt/DSA/Formats/Keys/PKCS8.php +++ b/phpseclib/Crypt/DSA/Formats/Keys/PKCS8.php @@ -23,12 +23,12 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt\DSA\Formats\Keys; +namespace phpseclib3\Crypt\DSA\Formats\Keys; -use phpseclib\Math\BigInteger; -use phpseclib\Crypt\Common\Formats\Keys\PKCS8 as Progenitor; -use phpseclib\File\ASN1; -use phpseclib\File\ASN1\Maps; +use phpseclib3\Math\BigInteger; +use phpseclib3\Crypt\Common\Formats\Keys\PKCS8 as Progenitor; +use phpseclib3\File\ASN1; +use phpseclib3\File\ASN1\Maps; /** * PKCS#8 Formatted DSA Key Handler @@ -121,11 +121,11 @@ abstract class PKCS8 extends Progenitor * Convert a private key to the appropriate format. * * @access public - * @param \phpseclib\Math\BigInteger $p - * @param \phpseclib\Math\BigInteger $q - * @param \phpseclib\Math\BigInteger $g - * @param \phpseclib\Math\BigInteger $x - * @param \phpseclib\Math\BigInteger $y + * @param \phpseclib3\Math\BigInteger $p + * @param \phpseclib3\Math\BigInteger $q + * @param \phpseclib3\Math\BigInteger $g + * @param \phpseclib3\Math\BigInteger $x + * @param \phpseclib3\Math\BigInteger $y * @param string $password optional * @param array $options optional * @return string @@ -147,10 +147,10 @@ abstract class PKCS8 extends Progenitor * Convert a public key to the appropriate format * * @access public - * @param \phpseclib\Math\BigInteger $p - * @param \phpseclib\Math\BigInteger $q - * @param \phpseclib\Math\BigInteger $g - * @param \phpseclib\Math\BigInteger $y + * @param \phpseclib3\Math\BigInteger $p + * @param \phpseclib3\Math\BigInteger $q + * @param \phpseclib3\Math\BigInteger $g + * @param \phpseclib3\Math\BigInteger $y * @param array $options optional * @return string */ diff --git a/phpseclib/Crypt/DSA/Formats/Keys/PuTTY.php b/phpseclib/Crypt/DSA/Formats/Keys/PuTTY.php index 46a47153..5f71e684 100644 --- a/phpseclib/Crypt/DSA/Formats/Keys/PuTTY.php +++ b/phpseclib/Crypt/DSA/Formats/Keys/PuTTY.php @@ -18,11 +18,11 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt\DSA\Formats\Keys; +namespace phpseclib3\Crypt\DSA\Formats\Keys; -use phpseclib\Math\BigInteger; -use phpseclib\Common\Functions\Strings; -use phpseclib\Crypt\Common\Formats\Keys\PuTTY as Progenitor; +use phpseclib3\Math\BigInteger; +use phpseclib3\Common\Functions\Strings; +use phpseclib3\Crypt\Common\Formats\Keys\PuTTY as Progenitor; /** * PuTTY Formatted DSA Key Handler @@ -39,7 +39,7 @@ abstract class PuTTY extends Progenitor * @var string * @access private */ - const PUBLIC_HANDLER = 'phpseclib\Crypt\DSA\Formats\Keys\OpenSSH'; + const PUBLIC_HANDLER = 'phpseclib3\Crypt\DSA\Formats\Keys\OpenSSH'; /** * Algorithm Identifier @@ -76,11 +76,11 @@ abstract class PuTTY extends Progenitor * Convert a private key to the appropriate format. * * @access public - * @param \phpseclib\Math\BigInteger $p - * @param \phpseclib\Math\BigInteger $q - * @param \phpseclib\Math\BigInteger $g - * @param \phpseclib\Math\BigInteger $y - * @param \phpseclib\Math\BigInteger $x + * @param \phpseclib3\Math\BigInteger $p + * @param \phpseclib3\Math\BigInteger $q + * @param \phpseclib3\Math\BigInteger $g + * @param \phpseclib3\Math\BigInteger $y + * @param \phpseclib3\Math\BigInteger $x * @param string $password optional * @param array $options optional * @return string @@ -101,10 +101,10 @@ abstract class PuTTY extends Progenitor * Convert a public key to the appropriate format * * @access public - * @param \phpseclib\Math\BigInteger $p - * @param \phpseclib\Math\BigInteger $q - * @param \phpseclib\Math\BigInteger $g - * @param \phpseclib\Math\BigInteger $y + * @param \phpseclib3\Math\BigInteger $p + * @param \phpseclib3\Math\BigInteger $q + * @param \phpseclib3\Math\BigInteger $g + * @param \phpseclib3\Math\BigInteger $y * @return string */ public static function savePublicKey(BigInteger $p, BigInteger $q, BigInteger $g, BigInteger $y) diff --git a/phpseclib/Crypt/DSA/Formats/Keys/Raw.php b/phpseclib/Crypt/DSA/Formats/Keys/Raw.php index d6118c66..04eba721 100644 --- a/phpseclib/Crypt/DSA/Formats/Keys/Raw.php +++ b/phpseclib/Crypt/DSA/Formats/Keys/Raw.php @@ -15,9 +15,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt\DSA\Formats\Keys; +namespace phpseclib3\Crypt\DSA\Formats\Keys; -use phpseclib\Math\BigInteger; +use phpseclib3\Math\BigInteger; /** * Raw DSA Key Handler @@ -62,11 +62,11 @@ abstract class Raw * Convert a private key to the appropriate format. * * @access public - * @param \phpseclib\Math\BigInteger $p - * @param \phpseclib\Math\BigInteger $q - * @param \phpseclib\Math\BigInteger $g - * @param \phpseclib\Math\BigInteger $y - * @param \phpseclib\Math\BigInteger $x + * @param \phpseclib3\Math\BigInteger $p + * @param \phpseclib3\Math\BigInteger $q + * @param \phpseclib3\Math\BigInteger $g + * @param \phpseclib3\Math\BigInteger $y + * @param \phpseclib3\Math\BigInteger $x * @param string $password optional * @return string */ @@ -79,10 +79,10 @@ abstract class Raw * Convert a public key to the appropriate format * * @access public - * @param \phpseclib\Math\BigInteger $p - * @param \phpseclib\Math\BigInteger $q - * @param \phpseclib\Math\BigInteger $g - * @param \phpseclib\Math\BigInteger $y + * @param \phpseclib3\Math\BigInteger $p + * @param \phpseclib3\Math\BigInteger $q + * @param \phpseclib3\Math\BigInteger $g + * @param \phpseclib3\Math\BigInteger $y * @return string */ public static function savePublicKey(BigInteger $p, BigInteger $q, BigInteger $g, BigInteger $y) diff --git a/phpseclib/Crypt/DSA/Formats/Keys/XML.php b/phpseclib/Crypt/DSA/Formats/Keys/XML.php index 0b900a7f..4251b77d 100644 --- a/phpseclib/Crypt/DSA/Formats/Keys/XML.php +++ b/phpseclib/Crypt/DSA/Formats/Keys/XML.php @@ -19,10 +19,10 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt\DSA\Formats\Keys; +namespace phpseclib3\Crypt\DSA\Formats\Keys; use ParagonIE\ConstantTime\Base64; -use phpseclib\Math\BigInteger; +use phpseclib3\Math\BigInteger; /** * XML Formatted DSA Key Handler @@ -114,10 +114,10 @@ abstract class XML * See https://www.w3.org/TR/xmldsig-core/#sec-DSAKeyValue * * @access public - * @param \phpseclib\Math\BigInteger $p - * @param \phpseclib\Math\BigInteger $q - * @param \phpseclib\Math\BigInteger $g - * @param \phpseclib\Math\BigInteger $y + * @param \phpseclib3\Math\BigInteger $p + * @param \phpseclib3\Math\BigInteger $q + * @param \phpseclib3\Math\BigInteger $g + * @param \phpseclib3\Math\BigInteger $y * @return string */ public static function savePublicKey(BigInteger $p, BigInteger $q, BigInteger $g, BigInteger $y) diff --git a/phpseclib/Crypt/DSA/Formats/Signature/ASN1.php b/phpseclib/Crypt/DSA/Formats/Signature/ASN1.php index 9a6cbc56..a9c29a34 100644 --- a/phpseclib/Crypt/DSA/Formats/Signature/ASN1.php +++ b/phpseclib/Crypt/DSA/Formats/Signature/ASN1.php @@ -16,11 +16,11 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt\DSA\Formats\Signature; +namespace phpseclib3\Crypt\DSA\Formats\Signature; -use phpseclib\Math\BigInteger; -use phpseclib\File\ASN1 as Encoder; -use phpseclib\File\ASN1\Maps; +use phpseclib3\Math\BigInteger; +use phpseclib3\File\ASN1 as Encoder; +use phpseclib3\File\ASN1\Maps; /** * ASN1 Signature Handler @@ -57,8 +57,8 @@ abstract class ASN1 * Returns a signature in the appropriate format * * @access public - * @param \phpseclib\Math\BigInteger $r - * @param \phpseclib\Math\BigInteger $s + * @param \phpseclib3\Math\BigInteger $r + * @param \phpseclib3\Math\BigInteger $s * @return string */ public static function save(BigInteger $r, BigInteger $s) diff --git a/phpseclib/Crypt/DSA/Formats/Signature/Raw.php b/phpseclib/Crypt/DSA/Formats/Signature/Raw.php index da589add..e362e41b 100644 --- a/phpseclib/Crypt/DSA/Formats/Signature/Raw.php +++ b/phpseclib/Crypt/DSA/Formats/Signature/Raw.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt\DSA\Formats\Signature; +namespace phpseclib3\Crypt\DSA\Formats\Signature; -use phpseclib\Crypt\Common\Formats\Signature\Raw as Progenitor; +use phpseclib3\Crypt\Common\Formats\Signature\Raw as Progenitor; /** * Raw DSA Signature Handler diff --git a/phpseclib/Crypt/DSA/Formats/Signature/SSH2.php b/phpseclib/Crypt/DSA/Formats/Signature/SSH2.php index 5950d863..39f1f6ce 100644 --- a/phpseclib/Crypt/DSA/Formats/Signature/SSH2.php +++ b/phpseclib/Crypt/DSA/Formats/Signature/SSH2.php @@ -15,10 +15,10 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt\DSA\Formats\Signature; +namespace phpseclib3\Crypt\DSA\Formats\Signature; -use phpseclib\Math\BigInteger; -use phpseclib\Common\Functions\Strings; +use phpseclib3\Math\BigInteger; +use phpseclib3\Common\Functions\Strings; /** * SSH2 Signature Handler @@ -61,8 +61,8 @@ abstract class SSH2 * Returns a signature in the appropriate format * * @access public - * @param \phpseclib\Math\BigInteger $r - * @param \phpseclib\Math\BigInteger $s + * @param \phpseclib3\Math\BigInteger $r + * @param \phpseclib3\Math\BigInteger $s * @return string */ public static function save(BigInteger $r, BigInteger $s) diff --git a/phpseclib/Crypt/DSA/Parameters.php b/phpseclib/Crypt/DSA/Parameters.php index 961473ab..3f36e962 100644 --- a/phpseclib/Crypt/DSA/Parameters.php +++ b/phpseclib/Crypt/DSA/Parameters.php @@ -11,9 +11,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt\DSA; +namespace phpseclib3\Crypt\DSA; -use phpseclib\Crypt\DSA; +use phpseclib3\Crypt\DSA; /** * DSA Parameters diff --git a/phpseclib/Crypt/DSA/PrivateKey.php b/phpseclib/Crypt/DSA/PrivateKey.php index a59b5edb..a8e70346 100644 --- a/phpseclib/Crypt/DSA/PrivateKey.php +++ b/phpseclib/Crypt/DSA/PrivateKey.php @@ -11,12 +11,12 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt\DSA; +namespace phpseclib3\Crypt\DSA; -use phpseclib\Crypt\DSA; -use phpseclib\Crypt\DSA\Formats\Signature\ASN1 as ASN1Signature; -use phpseclib\Math\BigInteger; -use phpseclib\Crypt\Common; +use phpseclib3\Crypt\DSA; +use phpseclib3\Crypt\DSA\Formats\Signature\ASN1 as ASN1Signature; +use phpseclib3\Math\BigInteger; +use phpseclib3\Crypt\Common; /** * DSA Private Key @@ -32,7 +32,7 @@ class PrivateKey extends DSA implements Common\PrivateKey /** * DSA secret exponent x * - * @var \phpseclib\Math\BigInteger + * @var \phpseclib3\Math\BigInteger * @access private */ protected $x; diff --git a/phpseclib/Crypt/DSA/PublicKey.php b/phpseclib/Crypt/DSA/PublicKey.php index 580abf03..e352e905 100644 --- a/phpseclib/Crypt/DSA/PublicKey.php +++ b/phpseclib/Crypt/DSA/PublicKey.php @@ -11,11 +11,11 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt\DSA; +namespace phpseclib3\Crypt\DSA; -use phpseclib\Crypt\DSA; -use phpseclib\Crypt\DSA\Formats\Signature\ASN1 as ASN1Signature; -use phpseclib\Crypt\Common; +use phpseclib3\Crypt\DSA; +use phpseclib3\Crypt\DSA\Formats\Signature\ASN1 as ASN1Signature; +use phpseclib3\Crypt\Common; /** * DSA Public Key diff --git a/phpseclib/Crypt/EC.php b/phpseclib/Crypt/EC.php index f9b32d52..1576b4fe 100644 --- a/phpseclib/Crypt/EC.php +++ b/phpseclib/Crypt/EC.php @@ -10,7 +10,7 @@ * getPublicKey(); * * $plaintext = 'terrafrost'; @@ -29,24 +29,24 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt; +namespace phpseclib3\Crypt; -use phpseclib\Crypt\Common\AsymmetricKey; -use phpseclib\Crypt\EC\PrivateKey; -use phpseclib\Crypt\EC\PublicKey; -use phpseclib\Crypt\EC\Parameters; -use phpseclib\Crypt\EC\BaseCurves\TwistedEdwards as TwistedEdwardsCurve; -use phpseclib\Crypt\EC\BaseCurves\Montgomery as MontgomeryCurve; -use phpseclib\Crypt\EC\Curves\Curve25519; -use phpseclib\Crypt\EC\Curves\Ed25519; -use phpseclib\Crypt\EC\Curves\Ed448; -use phpseclib\Crypt\EC\Formats\Keys\PKCS1; -use phpseclib\File\ASN1\Maps\ECParameters; -use phpseclib\File\ASN1; -use phpseclib\Math\BigInteger; -use phpseclib\Exception\UnsupportedCurveException; -use phpseclib\Exception\UnsupportedAlgorithmException; -use phpseclib\Exception\UnsupportedOperationException; +use phpseclib3\Crypt\Common\AsymmetricKey; +use phpseclib3\Crypt\EC\PrivateKey; +use phpseclib3\Crypt\EC\PublicKey; +use phpseclib3\Crypt\EC\Parameters; +use phpseclib3\Crypt\EC\BaseCurves\TwistedEdwards as TwistedEdwardsCurve; +use phpseclib3\Crypt\EC\BaseCurves\Montgomery as MontgomeryCurve; +use phpseclib3\Crypt\EC\Curves\Curve25519; +use phpseclib3\Crypt\EC\Curves\Ed25519; +use phpseclib3\Crypt\EC\Curves\Ed448; +use phpseclib3\Crypt\EC\Formats\Keys\PKCS1; +use phpseclib3\File\ASN1\Maps\ECParameters; +use phpseclib3\File\ASN1; +use phpseclib3\Math\BigInteger; +use phpseclib3\Exception\UnsupportedCurveException; +use phpseclib3\Exception\UnsupportedAlgorithmException; +use phpseclib3\Exception\UnsupportedOperationException; /** * Pure-PHP implementation of EC. @@ -75,7 +75,7 @@ abstract class EC extends AsymmetricKey /** * Curve * - * @var \phpseclib\Crypt\EC\BaseCurves\Base + * @var \phpseclib3\Crypt\EC\BaseCurves\Base */ protected $curve; @@ -107,7 +107,7 @@ abstract class EC extends AsymmetricKey * * Used for deterministic ECDSA * - * @var \phpseclib\Math\BigInteger + * @var \phpseclib3\Math\BigInteger */ protected $q; @@ -119,7 +119,7 @@ abstract class EC extends AsymmetricKey * public key. But the x is different depending on which side of the equal sign * you're on. It's less ambiguous if you do dA * base point = (x, y)-coordinate. * - * @var \phpseclib\Math\BigInteger + * @var \phpseclib3\Math\BigInteger */ protected $x; @@ -135,7 +135,7 @@ abstract class EC extends AsymmetricKey * * @access public * @param string $curve - * @return \phpseclib\Crypt\EC\PrivateKey + * @return \phpseclib3\Crypt\EC\PrivateKey */ public static function createKey($curve) { @@ -161,10 +161,10 @@ abstract class EC extends AsymmetricKey $privatekey = new PrivateKey; $curveName = $curve; - $curve = '\phpseclib\Crypt\EC\Curves\\' . $curveName; + $curve = '\phpseclib3\Crypt\EC\Curves\\' . $curveName; if (!class_exists($curve)) { $curveName = ucfirst($curveName); - $curve = '\phpseclib\Crypt\EC\Curves\\' . $curveName; + $curve = '\phpseclib3\Crypt\EC\Curves\\' . $curveName; if (!class_exists($curve)) { throw new UnsupportedCurveException('Named Curve of ' . $curveName . ' is not supported'); } diff --git a/phpseclib/Crypt/EC/BaseCurves/Base.php b/phpseclib/Crypt/EC/BaseCurves/Base.php index b094e012..6102c063 100644 --- a/phpseclib/Crypt/EC/BaseCurves/Base.php +++ b/phpseclib/Crypt/EC/BaseCurves/Base.php @@ -13,10 +13,10 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Crypt\EC\BaseCurves; +namespace phpseclib3\Crypt\EC\BaseCurves; -use phpseclib\Math\Common\FiniteField; -use phpseclib\Math\BigInteger; +use phpseclib3\Math\Common\FiniteField; +use phpseclib3\Math\BigInteger; /** * Base @@ -51,7 +51,7 @@ abstract class Base /** * Finite Field Integer factory * - * @var \phpseclib\Math\FiniteField\Integer + * @var \phpseclib3\Math\FiniteField\Integer */ protected $factory; @@ -149,7 +149,7 @@ abstract class Base /** * Returns the Order * - * @return \phpseclib\Math\BigInteger + * @return \phpseclib3\Math\BigInteger */ public function getOrder() { diff --git a/phpseclib/Crypt/EC/BaseCurves/Binary.php b/phpseclib/Crypt/EC/BaseCurves/Binary.php index 99e9f91a..f35c01d2 100644 --- a/phpseclib/Crypt/EC/BaseCurves/Binary.php +++ b/phpseclib/Crypt/EC/BaseCurves/Binary.php @@ -21,12 +21,12 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Crypt\EC\BaseCurves; +namespace phpseclib3\Crypt\EC\BaseCurves; -use phpseclib\Common\Functions\Strings; -use phpseclib\Math\BinaryField; -use phpseclib\Math\BigInteger; -use phpseclib\Math\BinaryField\Integer as BinaryInteger; +use phpseclib3\Common\Functions\Strings; +use phpseclib3\Math\BinaryField; +use phpseclib3\Math\BigInteger; +use phpseclib3\Math\BinaryField\Integer as BinaryInteger; /** * Curves over y^2 + x*y = x^3 + a*x^2 + b @@ -40,7 +40,7 @@ class Binary extends Base /** * Binary Field Integer factory * - * @var \phpseclib\Math\BinaryFields + * @var \phpseclib3\Math\BinaryFields */ protected $factory; @@ -310,7 +310,7 @@ class Binary extends Base /** * Returns the modulo * - * @return \phpseclib\Math\BigInteger + * @return \phpseclib3\Math\BigInteger */ public function getModulo() { @@ -320,7 +320,7 @@ class Binary extends Base /** * Returns the a coefficient * - * @return \phpseclib\Math\PrimeField\Integer + * @return \phpseclib3\Math\PrimeField\Integer */ public function getA() { @@ -330,7 +330,7 @@ class Binary extends Base /** * Returns the a coefficient * - * @return \phpseclib\Math\PrimeField\Integer + * @return \phpseclib3\Math\PrimeField\Integer */ public function getB() { @@ -344,7 +344,7 @@ class Binary extends Base * To convert a Jacobian Coordinate to an Affine Point * you do (x / z^2, y / z^3) * - * @return \phpseclib\Math\PrimeField\Integer[] + * @return \phpseclib3\Math\PrimeField\Integer[] */ public function convertToAffine(array $p) { @@ -363,7 +363,7 @@ class Binary extends Base /** * Converts an affine point to a jacobian coordinate * - * @return \phpseclib\Math\PrimeField\Integer[] + * @return \phpseclib3\Math\PrimeField\Integer[] */ public function convertToInternal(array $p) { diff --git a/phpseclib/Crypt/EC/BaseCurves/KoblitzPrime.php b/phpseclib/Crypt/EC/BaseCurves/KoblitzPrime.php index 2310da06..f8cf347d 100644 --- a/phpseclib/Crypt/EC/BaseCurves/KoblitzPrime.php +++ b/phpseclib/Crypt/EC/BaseCurves/KoblitzPrime.php @@ -28,12 +28,12 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Crypt\EC\BaseCurves; +namespace phpseclib3\Crypt\EC\BaseCurves; -use phpseclib\Common\Functions\Strings; -use phpseclib\Math\PrimeField; -use phpseclib\Math\BigInteger; -use phpseclib\Math\PrimeField\Integer as PrimeInteger; +use phpseclib3\Common\Functions\Strings; +use phpseclib3\Math\PrimeField; +use phpseclib3\Math\BigInteger; +use phpseclib3\Math\PrimeField\Integer as PrimeInteger; /** * Curves over y^2 = x^3 + b diff --git a/phpseclib/Crypt/EC/BaseCurves/Montgomery.php b/phpseclib/Crypt/EC/BaseCurves/Montgomery.php index 5fccb066..5f5fdf0e 100644 --- a/phpseclib/Crypt/EC/BaseCurves/Montgomery.php +++ b/phpseclib/Crypt/EC/BaseCurves/Montgomery.php @@ -24,14 +24,14 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Crypt\EC\BaseCurves; +namespace phpseclib3\Crypt\EC\BaseCurves; -use phpseclib\Math\Common\FiniteField\Integer; -use phpseclib\Common\Functions\Strings; -use phpseclib\Math\PrimeField; -use phpseclib\Math\BigInteger; -use phpseclib\Crypt\EC\Curves\Curve25519; -use phpseclib\Math\PrimeField\Integer as PrimeInteger; +use phpseclib3\Math\Common\FiniteField\Integer; +use phpseclib3\Common\Functions\Strings; +use phpseclib3\Math\PrimeField; +use phpseclib3\Math\BigInteger; +use phpseclib3\Crypt\EC\Curves\Curve25519; +use phpseclib3\Math\PrimeField\Integer as PrimeInteger; /** * Curves over y^2 = x^3 + a*x + x @@ -45,7 +45,7 @@ class Montgomery extends Base /** * Prime Field Integer factory * - * @var \phpseclib\Math\PrimeFields + * @var \phpseclib3\Math\PrimeFields */ protected $factory; @@ -252,7 +252,7 @@ class Montgomery extends Base * * x=X/Z * - * @return \phpseclib\Math\PrimeField\Integer[] + * @return \phpseclib3\Math\PrimeField\Integer[] */ public function convertToInternal(array $p) { @@ -272,7 +272,7 @@ class Montgomery extends Base /** * Returns the affine point * - * @return \phpseclib\Math\PrimeField\Integer[] + * @return \phpseclib3\Math\PrimeField\Integer[] */ public function convertToAffine(array $p) { diff --git a/phpseclib/Crypt/EC/BaseCurves/Prime.php b/phpseclib/Crypt/EC/BaseCurves/Prime.php index f1c413f9..07606cfa 100644 --- a/phpseclib/Crypt/EC/BaseCurves/Prime.php +++ b/phpseclib/Crypt/EC/BaseCurves/Prime.php @@ -21,13 +21,13 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Crypt\EC\BaseCurves; +namespace phpseclib3\Crypt\EC\BaseCurves; -use phpseclib\Math\Common\FiniteField\Integer; -use phpseclib\Common\Functions\Strings; -use phpseclib\Math\PrimeField; -use phpseclib\Math\BigInteger; -use phpseclib\Math\PrimeField\Integer as PrimeInteger; +use phpseclib3\Math\Common\FiniteField\Integer; +use phpseclib3\Common\Functions\Strings; +use phpseclib3\Math\PrimeField; +use phpseclib3\Math\BigInteger; +use phpseclib3\Math\PrimeField\Integer as PrimeInteger; /** * Curves over y^2 = x^3 + a*x + b @@ -41,7 +41,7 @@ class Prime extends Base /** * Prime Field Integer factory * - * @var \phpseclib\Math\PrimeFields + * @var \phpseclib3\Math\PrimeFields */ protected $factory; @@ -475,7 +475,7 @@ class Prime extends Base /** * Returns the modulo * - * @return \phpseclib\Math\BigInteger + * @return \phpseclib3\Math\BigInteger */ public function getModulo() { @@ -485,7 +485,7 @@ class Prime extends Base /** * Returns the a coefficient * - * @return \phpseclib\Math\PrimeField\Integer + * @return \phpseclib3\Math\PrimeField\Integer */ public function getA() { @@ -495,7 +495,7 @@ class Prime extends Base /** * Returns the a coefficient * - * @return \phpseclib\Math\PrimeField\Integer + * @return \phpseclib3\Math\PrimeField\Integer */ public function getB() { @@ -740,7 +740,7 @@ class Prime extends Base * To convert a Jacobian Coordinate to an Affine Point * you do (x / z^2, y / z^3) * - * @return \phpseclib\Math\PrimeField\Integer[] + * @return \phpseclib3\Math\PrimeField\Integer[] */ public function convertToAffine(array $p) { @@ -759,7 +759,7 @@ class Prime extends Base /** * Converts an affine point to a jacobian coordinate * - * @return \phpseclib\Math\PrimeField\Integer[] + * @return \phpseclib3\Math\PrimeField\Integer[] */ public function convertToInternal(array $p) { diff --git a/phpseclib/Crypt/EC/BaseCurves/TwistedEdwards.php b/phpseclib/Crypt/EC/BaseCurves/TwistedEdwards.php index b93cd9b6..ff4ff2d4 100644 --- a/phpseclib/Crypt/EC/BaseCurves/TwistedEdwards.php +++ b/phpseclib/Crypt/EC/BaseCurves/TwistedEdwards.php @@ -26,11 +26,11 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Crypt\EC\BaseCurves; +namespace phpseclib3\Crypt\EC\BaseCurves; -use phpseclib\Math\PrimeField; -use phpseclib\Math\BigInteger; -use phpseclib\Math\PrimeField\Integer as PrimeInteger; +use phpseclib3\Math\PrimeField; +use phpseclib3\Math\BigInteger; +use phpseclib3\Math\PrimeField\Integer as PrimeInteger; /** * Curves over a*x^2 + y^2 = 1 + d*x^2*y^2 @@ -137,7 +137,7 @@ class TwistedEdwards extends Base /** * Returns the a coefficient * - * @return \phpseclib\Math\PrimeField\Integer + * @return \phpseclib3\Math\PrimeField\Integer */ public function getA() { @@ -147,7 +147,7 @@ class TwistedEdwards extends Base /** * Returns the a coefficient * - * @return \phpseclib\Math\PrimeField\Integer + * @return \phpseclib3\Math\PrimeField\Integer */ public function getD() { @@ -175,7 +175,7 @@ class TwistedEdwards extends Base /** * Returns the affine point * - * @return \phpseclib\Math\PrimeField\Integer[] + * @return \phpseclib3\Math\PrimeField\Integer[] */ public function convertToAffine(array $p) { @@ -193,7 +193,7 @@ class TwistedEdwards extends Base /** * Returns the modulo * - * @return \phpseclib\Math\BigInteger + * @return \phpseclib3\Math\BigInteger */ public function getModulo() { diff --git a/phpseclib/Crypt/EC/Curves/Curve25519.php b/phpseclib/Crypt/EC/Curves/Curve25519.php index 0a90eb0d..06842d8c 100644 --- a/phpseclib/Crypt/EC/Curves/Curve25519.php +++ b/phpseclib/Crypt/EC/Curves/Curve25519.php @@ -13,11 +13,11 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Crypt\EC\Curves; +namespace phpseclib3\Crypt\EC\Curves; -use phpseclib\Math\Common\FiniteField\Integer; -use phpseclib\Crypt\EC\BaseCurves\Montgomery; -use phpseclib\Math\BigInteger; +use phpseclib3\Math\Common\FiniteField\Integer; +use phpseclib3\Crypt\EC\BaseCurves\Montgomery; +use phpseclib3\Math\BigInteger; class Curve25519 extends Montgomery { diff --git a/phpseclib/Crypt/EC/Curves/Curve448.php b/phpseclib/Crypt/EC/Curves/Curve448.php index d575cb74..7dcf7084 100644 --- a/phpseclib/Crypt/EC/Curves/Curve448.php +++ b/phpseclib/Crypt/EC/Curves/Curve448.php @@ -13,11 +13,11 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Crypt\EC\Curves; +namespace phpseclib3\Crypt\EC\Curves; -use phpseclib\Math\Common\FiniteField\Integer; -use phpseclib\Crypt\EC\BaseCurves\Montgomery; -use phpseclib\Math\BigInteger; +use phpseclib3\Math\Common\FiniteField\Integer; +use phpseclib3\Crypt\EC\BaseCurves\Montgomery; +use phpseclib3\Math\BigInteger; class Curve448 extends Montgomery { diff --git a/phpseclib/Crypt/EC/Curves/Ed25519.php b/phpseclib/Crypt/EC/Curves/Ed25519.php index 98e474a9..f5f4bd28 100644 --- a/phpseclib/Crypt/EC/Curves/Ed25519.php +++ b/phpseclib/Crypt/EC/Curves/Ed25519.php @@ -12,12 +12,12 @@ * @license http://www.opensource.org/licenses/mit-license.html MIT License */ -namespace phpseclib\Crypt\EC\Curves; +namespace phpseclib3\Crypt\EC\Curves; -use phpseclib\Crypt\EC\BaseCurves\TwistedEdwards; -use phpseclib\Math\BigInteger; -use phpseclib\Crypt\Hash; -use phpseclib\Crypt\Random; +use phpseclib3\Crypt\EC\BaseCurves\TwistedEdwards; +use phpseclib3\Math\BigInteger; +use phpseclib3\Crypt\Hash; +use phpseclib3\Crypt\Random; class Ed25519 extends TwistedEdwards { @@ -158,7 +158,7 @@ class Ed25519 extends TwistedEdwards * Used by the various key handlers * * @param string $str - * @return \phpseclib\Math\PrimeField\Integer + * @return \phpseclib3\Math\PrimeField\Integer */ public function extractSecret($str) { @@ -208,7 +208,7 @@ class Ed25519 extends TwistedEdwards /** * Creates a random scalar multiplier * - * @return \phpseclib\Math\PrimeField\Integer + * @return \phpseclib3\Math\PrimeField\Integer */ public function createRandomMultiplier() { @@ -223,7 +223,7 @@ class Ed25519 extends TwistedEdwards * A point (x,y) is represented in extended homogeneous coordinates (X, Y, Z, T), * with x = X/Z, y = Y/Z, x * y = T/Z. * - * @return \phpseclib\Math\PrimeField\Integer[] + * @return \phpseclib3\Math\PrimeField\Integer[] */ public function convertToInternal(array $p) { diff --git a/phpseclib/Crypt/EC/Curves/Ed448.php b/phpseclib/Crypt/EC/Curves/Ed448.php index 168b83f4..44b17700 100644 --- a/phpseclib/Crypt/EC/Curves/Ed448.php +++ b/phpseclib/Crypt/EC/Curves/Ed448.php @@ -1,267 +1,267 @@ - - * @copyright 2017 Jim Wigginton - * @license http://www.opensource.org/licenses/mit-license.html MIT License - */ - -namespace phpseclib\Crypt\EC\Curves; - -use phpseclib\Crypt\EC\BaseCurves\TwistedEdwards; -use phpseclib\Math\BigInteger; -use phpseclib\Crypt\Hash; -use phpseclib\Crypt\Random; - -class Ed448 extends TwistedEdwards -{ - const HASH = 'shake256-912'; - const SIZE = 57; - - public function __construct() - { - // 2^448 - 2^224 - 1 - $this->setModulo(new BigInteger( - 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE' . - 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF', 16)); - $this->setCoefficients( - new BigInteger(1), - // -39081 - new BigInteger('FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE' . - 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6756', 16) - ); - $this->setBasePoint( - new BigInteger('4F1970C66BED0DED221D15A622BF36DA9E146570470F1767EA6DE324' . - 'A3D3A46412AE1AF72AB66511433B80E18B00938E2626A82BC70CC05E', 16), - new BigInteger('693F46716EB6BC248876203756C9C7624BEA73736CA3984087789C1E' . - '05A0C2D73AD3FF1CE67C39C4FDBD132C4ED7C8AD9808795BF230FA14', 16) - ); - $this->setOrder(new BigInteger( - '3FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF' . - '7CCA23E9C44EDB49AED63690216CC2728DC58F552378C292AB5844F3', 16)); - } - - /** - * Recover X from Y - * - * Implements steps 2-4 at https://tools.ietf.org/html/rfc8032#section-5.2.3 - * - * Used by EC\Keys\Common.php - * - * @param BigInteger $x - * @param boolean $sign - * @return object[] - */ - public function recoverX(BigInteger $y, $sign) - { - $y = $this->factory->newInteger($y); - - $y2 = $y->multiply($y); - $u = $y2->subtract($this->one); - $v = $this->d->multiply($y2)->subtract($this->one); - $x2 = $u->divide($v); - if ($x2->equals($this->zero)) { - if ($sign) { - throw new \RuntimeException('Unable to recover X coordinate (x2 = 0)'); - } - return clone $this->zero; - } - // find the square root - $exp = $this->getModulo()->add(new BigInteger(1)); - $exp = $exp->bitwise_rightShift(2); - $x = $x2->pow($exp); - - if (!$x->multiply($x)->subtract($x2)->equals($this->zero)) { - throw new \RuntimeException('Unable to recover X coordinate'); - } - if ($x->isOdd() != $sign) { - $x = $x->negate(); - } - - return [$x, $y]; - } - - /** - * Extract Secret Scalar - * - * Implements steps 1-3 at https://tools.ietf.org/html/rfc8032#section-5.2.5 - * - * Used by the various key handlers - * - * @param string $str - * @return \phpseclib\Math\PrimeField\Integer - */ - public function extractSecret($str) - { - if (strlen($str) != 57) { - throw new \LengthException('Private Key should be 57-bytes long'); - } - // 1. Hash the 57-byte private key using SHAKE256(x, 114), storing the - // digest in a 114-octet large buffer, denoted h. Only the lower 57 - // bytes are used for generating the public key. - $hash = new Hash('shake256-912'); - $h = $hash->hash($str); - $h = substr($h, 0, 57); - // 2. Prune the buffer: The two least significant bits of the first - // octet are cleared, all eight bits the last octet are cleared, and - // the highest bit of the second to last octet is set. - $h[0] = $h[0] & chr(0xFC); - $h = strrev($h); - $h[0] = "\0"; - $h[1] = $h[1] | chr(0x80); - // 3. Interpret the buffer as the little-endian integer, forming a - // secret scalar s. - $dA = new BigInteger($h, 256); - $dA = $this->factory->newInteger($dA); - - $dA->secret = $str; - return $dA; - } - - /** - * Encode a point as a string - * - * @param string $str - * @return string - */ - public function encodePoint($point) - { - list($x, $y) = $point; - $y = "\0" . $y->toBytes(); - if ($x->isOdd()) { - $y[0] = $y[0] | chr(0x80); - } - $y = strrev($y); - - return $y; - } - - /** - * Creates a random scalar multiplier - * - * @return \phpseclib\Math\PrimeField\Integer - */ - public function createRandomMultiplier() - { - return $this->extractSecret(Random::string(57)); - } - - /** - * Converts an affine point to an extended homogeneous coordinate - * - * From https://tools.ietf.org/html/rfc8032#section-5.2.4 : - * - * A point (x,y) is represented in extended homogeneous coordinates (X, Y, Z, T), - * with x = X/Z, y = Y/Z, x * y = T/Z. - * - * @return \phpseclib\Math\PrimeField\Integer[] - */ - public function convertToInternal(array $p) - { - if (empty($p)) { - return [clone $this->zero, clone $this->one, clone $this->one]; - } - - if (isset($p[2])) { - return $p; - } - - $p[2] = clone $this->one; - - return $p; - } - - /** - * Doubles a point on a curve - * - * @return FiniteField[] - */ - public function doublePoint(array $p) - { - if (!isset($this->factory)) { - throw new \RuntimeException('setModulo needs to be called before this method'); - } - - if (!count($p)) { - return []; - } - - if (!isset($p[2])) { - throw new \RuntimeException('Affine coordinates need to be manually converted to "Jacobi" coordinates or vice versa'); - } - - // from https://tools.ietf.org/html/rfc8032#page-18 - - list($x1, $y1, $z1) = $p; - - $b = $x1->add($y1); - $b = $b->multiply($b); - $c = $x1->multiply($x1); - $d = $y1->multiply($y1); - $e = $c->add($d); - $h = $z1->multiply($z1); - $j = $e->subtract($this->two->multiply($h)); - - $x3 = $b->subtract($e)->multiply($j); - $y3 = $c->subtract($d)->multiply($e); - $z3 = $e->multiply($j); - - return [$x3, $y3, $z3]; - } - - /** - * Adds two points on the curve - * - * @return FiniteField[] - */ - public function addPoint(array $p, array $q) - { - if (!isset($this->factory)) { - throw new \RuntimeException('setModulo needs to be called before this method'); - } - - if (!count($p) || !count($q)) { - if (count($q)) { - return $q; - } - if (count($p)) { - return $p; - } - return []; - } - - if (!isset($p[2]) || !isset($q[2])) { - throw new \RuntimeException('Affine coordinates need to be manually converted to "Jacobi" coordinates or vice versa'); - } - - if ($p[0]->equals($q[0])) { - return !$p[1]->equals($q[1]) ? [] : $this->doublePoint($p); - } - - // from https://tools.ietf.org/html/rfc8032#page-17 - - list($x1, $y1, $z1) = $p; - list($x2, $y2, $z2) = $q; - - $a = $z1->multiply($z2); - $b = $a->multiply($a); - $c = $x1->multiply($x2); - $d = $y1->multiply($y2); - $e = $this->d->multiply($c)->multiply($d); - $f = $b->subtract($e); - $g = $b->add($e); - $h = $x1->add($y1)->multiply($x2->add($y2)); - - $x3 = $a->multiply($f)->multiply($h->subtract($c)->subtract($d)); - $y3 = $a->multiply($g)->multiply($d->subtract($c)); - $z3 = $f->multiply($g); - - return [$x3, $y3, $z3]; - } + + * @copyright 2017 Jim Wigginton + * @license http://www.opensource.org/licenses/mit-license.html MIT License + */ + +namespace phpseclib3\Crypt\EC\Curves; + +use phpseclib3\Crypt\EC\BaseCurves\TwistedEdwards; +use phpseclib3\Math\BigInteger; +use phpseclib3\Crypt\Hash; +use phpseclib3\Crypt\Random; + +class Ed448 extends TwistedEdwards +{ + const HASH = 'shake256-912'; + const SIZE = 57; + + public function __construct() + { + // 2^448 - 2^224 - 1 + $this->setModulo(new BigInteger( + 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE' . + 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF', 16)); + $this->setCoefficients( + new BigInteger(1), + // -39081 + new BigInteger('FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE' . + 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6756', 16) + ); + $this->setBasePoint( + new BigInteger('4F1970C66BED0DED221D15A622BF36DA9E146570470F1767EA6DE324' . + 'A3D3A46412AE1AF72AB66511433B80E18B00938E2626A82BC70CC05E', 16), + new BigInteger('693F46716EB6BC248876203756C9C7624BEA73736CA3984087789C1E' . + '05A0C2D73AD3FF1CE67C39C4FDBD132C4ED7C8AD9808795BF230FA14', 16) + ); + $this->setOrder(new BigInteger( + '3FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF' . + '7CCA23E9C44EDB49AED63690216CC2728DC58F552378C292AB5844F3', 16)); + } + + /** + * Recover X from Y + * + * Implements steps 2-4 at https://tools.ietf.org/html/rfc8032#section-5.2.3 + * + * Used by EC\Keys\Common.php + * + * @param BigInteger $x + * @param boolean $sign + * @return object[] + */ + public function recoverX(BigInteger $y, $sign) + { + $y = $this->factory->newInteger($y); + + $y2 = $y->multiply($y); + $u = $y2->subtract($this->one); + $v = $this->d->multiply($y2)->subtract($this->one); + $x2 = $u->divide($v); + if ($x2->equals($this->zero)) { + if ($sign) { + throw new \RuntimeException('Unable to recover X coordinate (x2 = 0)'); + } + return clone $this->zero; + } + // find the square root + $exp = $this->getModulo()->add(new BigInteger(1)); + $exp = $exp->bitwise_rightShift(2); + $x = $x2->pow($exp); + + if (!$x->multiply($x)->subtract($x2)->equals($this->zero)) { + throw new \RuntimeException('Unable to recover X coordinate'); + } + if ($x->isOdd() != $sign) { + $x = $x->negate(); + } + + return [$x, $y]; + } + + /** + * Extract Secret Scalar + * + * Implements steps 1-3 at https://tools.ietf.org/html/rfc8032#section-5.2.5 + * + * Used by the various key handlers + * + * @param string $str + * @return \phpseclib3\Math\PrimeField\Integer + */ + public function extractSecret($str) + { + if (strlen($str) != 57) { + throw new \LengthException('Private Key should be 57-bytes long'); + } + // 1. Hash the 57-byte private key using SHAKE256(x, 114), storing the + // digest in a 114-octet large buffer, denoted h. Only the lower 57 + // bytes are used for generating the public key. + $hash = new Hash('shake256-912'); + $h = $hash->hash($str); + $h = substr($h, 0, 57); + // 2. Prune the buffer: The two least significant bits of the first + // octet are cleared, all eight bits the last octet are cleared, and + // the highest bit of the second to last octet is set. + $h[0] = $h[0] & chr(0xFC); + $h = strrev($h); + $h[0] = "\0"; + $h[1] = $h[1] | chr(0x80); + // 3. Interpret the buffer as the little-endian integer, forming a + // secret scalar s. + $dA = new BigInteger($h, 256); + $dA = $this->factory->newInteger($dA); + + $dA->secret = $str; + return $dA; + } + + /** + * Encode a point as a string + * + * @param string $str + * @return string + */ + public function encodePoint($point) + { + list($x, $y) = $point; + $y = "\0" . $y->toBytes(); + if ($x->isOdd()) { + $y[0] = $y[0] | chr(0x80); + } + $y = strrev($y); + + return $y; + } + + /** + * Creates a random scalar multiplier + * + * @return \phpseclib3\Math\PrimeField\Integer + */ + public function createRandomMultiplier() + { + return $this->extractSecret(Random::string(57)); + } + + /** + * Converts an affine point to an extended homogeneous coordinate + * + * From https://tools.ietf.org/html/rfc8032#section-5.2.4 : + * + * A point (x,y) is represented in extended homogeneous coordinates (X, Y, Z, T), + * with x = X/Z, y = Y/Z, x * y = T/Z. + * + * @return \phpseclib3\Math\PrimeField\Integer[] + */ + public function convertToInternal(array $p) + { + if (empty($p)) { + return [clone $this->zero, clone $this->one, clone $this->one]; + } + + if (isset($p[2])) { + return $p; + } + + $p[2] = clone $this->one; + + return $p; + } + + /** + * Doubles a point on a curve + * + * @return FiniteField[] + */ + public function doublePoint(array $p) + { + if (!isset($this->factory)) { + throw new \RuntimeException('setModulo needs to be called before this method'); + } + + if (!count($p)) { + return []; + } + + if (!isset($p[2])) { + throw new \RuntimeException('Affine coordinates need to be manually converted to "Jacobi" coordinates or vice versa'); + } + + // from https://tools.ietf.org/html/rfc8032#page-18 + + list($x1, $y1, $z1) = $p; + + $b = $x1->add($y1); + $b = $b->multiply($b); + $c = $x1->multiply($x1); + $d = $y1->multiply($y1); + $e = $c->add($d); + $h = $z1->multiply($z1); + $j = $e->subtract($this->two->multiply($h)); + + $x3 = $b->subtract($e)->multiply($j); + $y3 = $c->subtract($d)->multiply($e); + $z3 = $e->multiply($j); + + return [$x3, $y3, $z3]; + } + + /** + * Adds two points on the curve + * + * @return FiniteField[] + */ + public function addPoint(array $p, array $q) + { + if (!isset($this->factory)) { + throw new \RuntimeException('setModulo needs to be called before this method'); + } + + if (!count($p) || !count($q)) { + if (count($q)) { + return $q; + } + if (count($p)) { + return $p; + } + return []; + } + + if (!isset($p[2]) || !isset($q[2])) { + throw new \RuntimeException('Affine coordinates need to be manually converted to "Jacobi" coordinates or vice versa'); + } + + if ($p[0]->equals($q[0])) { + return !$p[1]->equals($q[1]) ? [] : $this->doublePoint($p); + } + + // from https://tools.ietf.org/html/rfc8032#page-17 + + list($x1, $y1, $z1) = $p; + list($x2, $y2, $z2) = $q; + + $a = $z1->multiply($z2); + $b = $a->multiply($a); + $c = $x1->multiply($x2); + $d = $y1->multiply($y2); + $e = $this->d->multiply($c)->multiply($d); + $f = $b->subtract($e); + $g = $b->add($e); + $h = $x1->add($y1)->multiply($x2->add($y2)); + + $x3 = $a->multiply($f)->multiply($h->subtract($c)->subtract($d)); + $y3 = $a->multiply($g)->multiply($d->subtract($c)); + $z3 = $f->multiply($g); + + return [$x3, $y3, $z3]; + } } \ No newline at end of file diff --git a/phpseclib/Crypt/EC/Curves/brainpoolP160r1.php b/phpseclib/Crypt/EC/Curves/brainpoolP160r1.php index 0f5b6a27..23a4e6d2 100644 --- a/phpseclib/Crypt/EC/Curves/brainpoolP160r1.php +++ b/phpseclib/Crypt/EC/Curves/brainpoolP160r1.php @@ -1,36 +1,36 @@ - - * @copyright 2017 Jim Wigginton - * @license http://www.opensource.org/licenses/mit-license.html MIT License - * @link http://pear.php.net/package/Math_BigInteger - */ - -namespace phpseclib\Crypt\EC\Curves; - -use phpseclib\Crypt\EC\BaseCurves\Prime; -use phpseclib\Math\BigInteger; - -class brainpoolP160r1 extends Prime -{ - public function __construct() - { - $this->setModulo(new BigInteger('E95E4A5F737059DC60DFC7AD95B3D8139515620F', 16)); - $this->setCoefficients( - new BigInteger('340E7BE2A280EB74E2BE61BADA745D97E8F7C300', 16), - new BigInteger('1E589A8595423412134FAA2DBDEC95C8D8675E58', 16) - ); - $this->setBasePoint( - new BigInteger('BED5AF16EA3F6A4F62938C4631EB5AF7BDBCDBC3', 16), - new BigInteger('1667CB477A1A8EC338F94741669C976316DA6321', 16) - ); - $this->setOrder(new BigInteger('E95E4A5F737059DC60DF5991D45029409E60FC09', 16)); - } + + * @copyright 2017 Jim Wigginton + * @license http://www.opensource.org/licenses/mit-license.html MIT License + * @link http://pear.php.net/package/Math_BigInteger + */ + +namespace phpseclib3\Crypt\EC\Curves; + +use phpseclib3\Crypt\EC\BaseCurves\Prime; +use phpseclib3\Math\BigInteger; + +class brainpoolP160r1 extends Prime +{ + public function __construct() + { + $this->setModulo(new BigInteger('E95E4A5F737059DC60DFC7AD95B3D8139515620F', 16)); + $this->setCoefficients( + new BigInteger('340E7BE2A280EB74E2BE61BADA745D97E8F7C300', 16), + new BigInteger('1E589A8595423412134FAA2DBDEC95C8D8675E58', 16) + ); + $this->setBasePoint( + new BigInteger('BED5AF16EA3F6A4F62938C4631EB5AF7BDBCDBC3', 16), + new BigInteger('1667CB477A1A8EC338F94741669C976316DA6321', 16) + ); + $this->setOrder(new BigInteger('E95E4A5F737059DC60DF5991D45029409E60FC09', 16)); + } } \ No newline at end of file diff --git a/phpseclib/Crypt/EC/Curves/brainpoolP160t1.php b/phpseclib/Crypt/EC/Curves/brainpoolP160t1.php index 8f3a598d..beafc34b 100644 --- a/phpseclib/Crypt/EC/Curves/brainpoolP160t1.php +++ b/phpseclib/Crypt/EC/Curves/brainpoolP160t1.php @@ -1,49 +1,49 @@ - - * @copyright 2017 Jim Wigginton - * @license http://www.opensource.org/licenses/mit-license.html MIT License - * @link http://pear.php.net/package/Math_BigInteger - */ - -namespace phpseclib\Crypt\EC\Curves; - -use phpseclib\Crypt\EC\BaseCurves\Prime; -use phpseclib\Math\BigInteger; - -class brainpoolP160t1 extends Prime -{ - public function __construct() - { - $this->setModulo(new BigInteger('E95E4A5F737059DC60DFC7AD95B3D8139515620F', 16)); - $this->setCoefficients( - new BigInteger('E95E4A5F737059DC60DFC7AD95B3D8139515620C', 16), // eg. -3 - new BigInteger('7A556B6DAE535B7B51ED2C4D7DAA7A0B5C55F380', 16) - ); - $this->setBasePoint( - new BigInteger('B199B13B9B34EFC1397E64BAEB05ACC265FF2378', 16), - new BigInteger('ADD6718B7C7C1961F0991B842443772152C9E0AD', 16) - ); - $this->setOrder(new BigInteger('E95E4A5F737059DC60DF5991D45029409E60FC09', 16)); - } + + * @copyright 2017 Jim Wigginton + * @license http://www.opensource.org/licenses/mit-license.html MIT License + * @link http://pear.php.net/package/Math_BigInteger + */ + +namespace phpseclib3\Crypt\EC\Curves; + +use phpseclib3\Crypt\EC\BaseCurves\Prime; +use phpseclib3\Math\BigInteger; + +class brainpoolP160t1 extends Prime +{ + public function __construct() + { + $this->setModulo(new BigInteger('E95E4A5F737059DC60DFC7AD95B3D8139515620F', 16)); + $this->setCoefficients( + new BigInteger('E95E4A5F737059DC60DFC7AD95B3D8139515620C', 16), // eg. -3 + new BigInteger('7A556B6DAE535B7B51ED2C4D7DAA7A0B5C55F380', 16) + ); + $this->setBasePoint( + new BigInteger('B199B13B9B34EFC1397E64BAEB05ACC265FF2378', 16), + new BigInteger('ADD6718B7C7C1961F0991B842443772152C9E0AD', 16) + ); + $this->setOrder(new BigInteger('E95E4A5F737059DC60DF5991D45029409E60FC09', 16)); + } } \ No newline at end of file diff --git a/phpseclib/Crypt/EC/Curves/brainpoolP192r1.php b/phpseclib/Crypt/EC/Curves/brainpoolP192r1.php index 505aaa1b..11afdadb 100644 --- a/phpseclib/Crypt/EC/Curves/brainpoolP192r1.php +++ b/phpseclib/Crypt/EC/Curves/brainpoolP192r1.php @@ -1,36 +1,36 @@ - - * @copyright 2017 Jim Wigginton - * @license http://www.opensource.org/licenses/mit-license.html MIT License - * @link http://pear.php.net/package/Math_BigInteger - */ - -namespace phpseclib\Crypt\EC\Curves; - -use phpseclib\Crypt\EC\BaseCurves\Prime; -use phpseclib\Math\BigInteger; - -class brainpoolP192r1 extends Prime -{ - public function __construct() - { - $this->setModulo(new BigInteger('C302F41D932A36CDA7A3463093D18DB78FCE476DE1A86297', 16)); - $this->setCoefficients( - new BigInteger('6A91174076B1E0E19C39C031FE8685C1CAE040E5C69A28EF', 16), - new BigInteger('469A28EF7C28CCA3DC721D044F4496BCCA7EF4146FBF25C9', 16) - ); - $this->setBasePoint( - new BigInteger('C0A0647EAAB6A48753B033C56CB0F0900A2F5C4853375FD6', 16), - new BigInteger('14B690866ABD5BB88B5F4828C1490002E6773FA2FA299B8F', 16) - ); - $this->setOrder(new BigInteger('C302F41D932A36CDA7A3462F9E9E916B5BE8F1029AC4ACC1', 16)); - } + + * @copyright 2017 Jim Wigginton + * @license http://www.opensource.org/licenses/mit-license.html MIT License + * @link http://pear.php.net/package/Math_BigInteger + */ + +namespace phpseclib3\Crypt\EC\Curves; + +use phpseclib3\Crypt\EC\BaseCurves\Prime; +use phpseclib3\Math\BigInteger; + +class brainpoolP192r1 extends Prime +{ + public function __construct() + { + $this->setModulo(new BigInteger('C302F41D932A36CDA7A3463093D18DB78FCE476DE1A86297', 16)); + $this->setCoefficients( + new BigInteger('6A91174076B1E0E19C39C031FE8685C1CAE040E5C69A28EF', 16), + new BigInteger('469A28EF7C28CCA3DC721D044F4496BCCA7EF4146FBF25C9', 16) + ); + $this->setBasePoint( + new BigInteger('C0A0647EAAB6A48753B033C56CB0F0900A2F5C4853375FD6', 16), + new BigInteger('14B690866ABD5BB88B5F4828C1490002E6773FA2FA299B8F', 16) + ); + $this->setOrder(new BigInteger('C302F41D932A36CDA7A3462F9E9E916B5BE8F1029AC4ACC1', 16)); + } } \ No newline at end of file diff --git a/phpseclib/Crypt/EC/Curves/brainpoolP192t1.php b/phpseclib/Crypt/EC/Curves/brainpoolP192t1.php index 5e647837..71f956f2 100644 --- a/phpseclib/Crypt/EC/Curves/brainpoolP192t1.php +++ b/phpseclib/Crypt/EC/Curves/brainpoolP192t1.php @@ -1,36 +1,36 @@ - - * @copyright 2017 Jim Wigginton - * @license http://www.opensource.org/licenses/mit-license.html MIT License - * @link http://pear.php.net/package/Math_BigInteger - */ - -namespace phpseclib\Crypt\EC\Curves; - -use phpseclib\Crypt\EC\BaseCurves\Prime; -use phpseclib\Math\BigInteger; - -class brainpoolP192t1 extends Prime -{ - public function __construct() - { - $this->setModulo(new BigInteger('C302F41D932A36CDA7A3463093D18DB78FCE476DE1A86297', 16)); - $this->setCoefficients( - new BigInteger('C302F41D932A36CDA7A3463093D18DB78FCE476DE1A86294', 16), // eg. -3 - new BigInteger('13D56FFAEC78681E68F9DEB43B35BEC2FB68542E27897B79', 16) - ); - $this->setBasePoint( - new BigInteger('3AE9E58C82F63C30282E1FE7BBF43FA72C446AF6F4618129', 16), - new BigInteger('097E2C5667C2223A902AB5CA449D0084B7E5B3DE7CCC01C9', 16) - ); - $this->setOrder(new BigInteger('C302F41D932A36CDA7A3462F9E9E916B5BE8F1029AC4ACC1', 16)); - } + + * @copyright 2017 Jim Wigginton + * @license http://www.opensource.org/licenses/mit-license.html MIT License + * @link http://pear.php.net/package/Math_BigInteger + */ + +namespace phpseclib3\Crypt\EC\Curves; + +use phpseclib3\Crypt\EC\BaseCurves\Prime; +use phpseclib3\Math\BigInteger; + +class brainpoolP192t1 extends Prime +{ + public function __construct() + { + $this->setModulo(new BigInteger('C302F41D932A36CDA7A3463093D18DB78FCE476DE1A86297', 16)); + $this->setCoefficients( + new BigInteger('C302F41D932A36CDA7A3463093D18DB78FCE476DE1A86294', 16), // eg. -3 + new BigInteger('13D56FFAEC78681E68F9DEB43B35BEC2FB68542E27897B79', 16) + ); + $this->setBasePoint( + new BigInteger('3AE9E58C82F63C30282E1FE7BBF43FA72C446AF6F4618129', 16), + new BigInteger('097E2C5667C2223A902AB5CA449D0084B7E5B3DE7CCC01C9', 16) + ); + $this->setOrder(new BigInteger('C302F41D932A36CDA7A3462F9E9E916B5BE8F1029AC4ACC1', 16)); + } } \ No newline at end of file diff --git a/phpseclib/Crypt/EC/Curves/brainpoolP224r1.php b/phpseclib/Crypt/EC/Curves/brainpoolP224r1.php index da919576..83e49b02 100644 --- a/phpseclib/Crypt/EC/Curves/brainpoolP224r1.php +++ b/phpseclib/Crypt/EC/Curves/brainpoolP224r1.php @@ -1,36 +1,36 @@ - - * @copyright 2017 Jim Wigginton - * @license http://www.opensource.org/licenses/mit-license.html MIT License - * @link http://pear.php.net/package/Math_BigInteger - */ - -namespace phpseclib\Crypt\EC\Curves; - -use phpseclib\Crypt\EC\BaseCurves\Prime; -use phpseclib\Math\BigInteger; - -class brainpoolP224r1 extends Prime -{ - public function __construct() - { - $this->setModulo(new BigInteger('D7C134AA264366862A18302575D1D787B09F075797DA89F57EC8C0FF', 16)); - $this->setCoefficients( - new BigInteger('68A5E62CA9CE6C1C299803A6C1530B514E182AD8B0042A59CAD29F43', 16), - new BigInteger('2580F63CCFE44138870713B1A92369E33E2135D266DBB372386C400B', 16) - ); - $this->setBasePoint( - new BigInteger('0D9029AD2C7E5CF4340823B2A87DC68C9E4CE3174C1E6EFDEE12C07D', 16), - new BigInteger('58AA56F772C0726F24C6B89E4ECDAC24354B9E99CAA3F6D3761402CD', 16) - ); - $this->setOrder(new BigInteger('D7C134AA264366862A18302575D0FB98D116BC4B6DDEBCA3A5A7939F', 16)); - } + + * @copyright 2017 Jim Wigginton + * @license http://www.opensource.org/licenses/mit-license.html MIT License + * @link http://pear.php.net/package/Math_BigInteger + */ + +namespace phpseclib3\Crypt\EC\Curves; + +use phpseclib3\Crypt\EC\BaseCurves\Prime; +use phpseclib3\Math\BigInteger; + +class brainpoolP224r1 extends Prime +{ + public function __construct() + { + $this->setModulo(new BigInteger('D7C134AA264366862A18302575D1D787B09F075797DA89F57EC8C0FF', 16)); + $this->setCoefficients( + new BigInteger('68A5E62CA9CE6C1C299803A6C1530B514E182AD8B0042A59CAD29F43', 16), + new BigInteger('2580F63CCFE44138870713B1A92369E33E2135D266DBB372386C400B', 16) + ); + $this->setBasePoint( + new BigInteger('0D9029AD2C7E5CF4340823B2A87DC68C9E4CE3174C1E6EFDEE12C07D', 16), + new BigInteger('58AA56F772C0726F24C6B89E4ECDAC24354B9E99CAA3F6D3761402CD', 16) + ); + $this->setOrder(new BigInteger('D7C134AA264366862A18302575D0FB98D116BC4B6DDEBCA3A5A7939F', 16)); + } } \ No newline at end of file diff --git a/phpseclib/Crypt/EC/Curves/brainpoolP224t1.php b/phpseclib/Crypt/EC/Curves/brainpoolP224t1.php index 281fef2d..97032a48 100644 --- a/phpseclib/Crypt/EC/Curves/brainpoolP224t1.php +++ b/phpseclib/Crypt/EC/Curves/brainpoolP224t1.php @@ -1,36 +1,36 @@ - - * @copyright 2017 Jim Wigginton - * @license http://www.opensource.org/licenses/mit-license.html MIT License - * @link http://pear.php.net/package/Math_BigInteger - */ - -namespace phpseclib\Crypt\EC\Curves; - -use phpseclib\Crypt\EC\BaseCurves\Prime; -use phpseclib\Math\BigInteger; - -class brainpoolP224t1 extends Prime -{ - public function __construct() - { - $this->setModulo(new BigInteger('D7C134AA264366862A18302575D1D787B09F075797DA89F57EC8C0FF', 16)); - $this->setCoefficients( - new BigInteger('D7C134AA264366862A18302575D1D787B09F075797DA89F57EC8C0FC', 16), // eg. -3 - new BigInteger('4B337D934104CD7BEF271BF60CED1ED20DA14C08B3BB64F18A60888D', 16) - ); - $this->setBasePoint( - new BigInteger('6AB1E344CE25FF3896424E7FFE14762ECB49F8928AC0C76029B4D580', 16), - new BigInteger('0374E9F5143E568CD23F3F4D7C0D4B1E41C8CC0D1C6ABD5F1A46DB4C', 16) - ); - $this->setOrder(new BigInteger('D7C134AA264366862A18302575D0FB98D116BC4B6DDEBCA3A5A7939F', 16)); - } + + * @copyright 2017 Jim Wigginton + * @license http://www.opensource.org/licenses/mit-license.html MIT License + * @link http://pear.php.net/package/Math_BigInteger + */ + +namespace phpseclib3\Crypt\EC\Curves; + +use phpseclib3\Crypt\EC\BaseCurves\Prime; +use phpseclib3\Math\BigInteger; + +class brainpoolP224t1 extends Prime +{ + public function __construct() + { + $this->setModulo(new BigInteger('D7C134AA264366862A18302575D1D787B09F075797DA89F57EC8C0FF', 16)); + $this->setCoefficients( + new BigInteger('D7C134AA264366862A18302575D1D787B09F075797DA89F57EC8C0FC', 16), // eg. -3 + new BigInteger('4B337D934104CD7BEF271BF60CED1ED20DA14C08B3BB64F18A60888D', 16) + ); + $this->setBasePoint( + new BigInteger('6AB1E344CE25FF3896424E7FFE14762ECB49F8928AC0C76029B4D580', 16), + new BigInteger('0374E9F5143E568CD23F3F4D7C0D4B1E41C8CC0D1C6ABD5F1A46DB4C', 16) + ); + $this->setOrder(new BigInteger('D7C134AA264366862A18302575D0FB98D116BC4B6DDEBCA3A5A7939F', 16)); + } } \ No newline at end of file diff --git a/phpseclib/Crypt/EC/Curves/brainpoolP256r1.php b/phpseclib/Crypt/EC/Curves/brainpoolP256r1.php index 5116e974..0d386004 100644 --- a/phpseclib/Crypt/EC/Curves/brainpoolP256r1.php +++ b/phpseclib/Crypt/EC/Curves/brainpoolP256r1.php @@ -13,10 +13,10 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Crypt\EC\Curves; +namespace phpseclib3\Crypt\EC\Curves; -use phpseclib\Crypt\EC\BaseCurves\Prime; -use phpseclib\Math\BigInteger; +use phpseclib3\Crypt\EC\BaseCurves\Prime; +use phpseclib3\Math\BigInteger; class brainpoolP256r1 extends Prime { diff --git a/phpseclib/Crypt/EC/Curves/brainpoolP256t1.php b/phpseclib/Crypt/EC/Curves/brainpoolP256t1.php index 50846a4b..9c1d1cdb 100644 --- a/phpseclib/Crypt/EC/Curves/brainpoolP256t1.php +++ b/phpseclib/Crypt/EC/Curves/brainpoolP256t1.php @@ -13,10 +13,10 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Crypt\EC\Curves; +namespace phpseclib3\Crypt\EC\Curves; -use phpseclib\Crypt\EC\BaseCurves\Prime; -use phpseclib\Math\BigInteger; +use phpseclib3\Crypt\EC\BaseCurves\Prime; +use phpseclib3\Math\BigInteger; class brainpoolP256t1 extends Prime { diff --git a/phpseclib/Crypt/EC/Curves/brainpoolP320r1.php b/phpseclib/Crypt/EC/Curves/brainpoolP320r1.php index 88f48588..a6253a71 100644 --- a/phpseclib/Crypt/EC/Curves/brainpoolP320r1.php +++ b/phpseclib/Crypt/EC/Curves/brainpoolP320r1.php @@ -1,42 +1,42 @@ - - * @copyright 2017 Jim Wigginton - * @license http://www.opensource.org/licenses/mit-license.html MIT License - * @link http://pear.php.net/package/Math_BigInteger - */ - -namespace phpseclib\Crypt\EC\Curves; - -use phpseclib\Crypt\EC\BaseCurves\Prime; -use phpseclib\Math\BigInteger; - -class brainpoolP320r1 extends Prime -{ - public function __construct() - { - $this->setModulo(new BigInteger('D35E472036BC4FB7E13C785ED201E065F98FCFA6F6F40DEF4F9' . - '2B9EC7893EC28FCD412B1F1B32E27', 16)); - $this->setCoefficients( - new BigInteger('3EE30B568FBAB0F883CCEBD46D3F3BB8A2A73513F5EB79DA66190EB085FFA9F4' . - '92F375A97D860EB4', 16), - new BigInteger('520883949DFDBC42D3AD198640688A6FE13F41349554B49ACC31DCCD88453981' . - '6F5EB4AC8FB1F1A6', 16) - ); - $this->setBasePoint( - new BigInteger('43BD7E9AFB53D8B85289BCC48EE5BFE6F20137D10A087EB6E7871E2A10A599C7' . - '10AF8D0D39E20611', 16), - new BigInteger('14FDD05545EC1CC8AB4093247F77275E0743FFED117182EAA9C77877AAAC6AC7' . - 'D35245D1692E8EE1', 16) - ); - $this->setOrder(new BigInteger('D35E472036BC4FB7E13C785ED201E065F98FCFA5B68F12A32D4' . - '82EC7EE8658E98691555B44C59311', 16)); - } + + * @copyright 2017 Jim Wigginton + * @license http://www.opensource.org/licenses/mit-license.html MIT License + * @link http://pear.php.net/package/Math_BigInteger + */ + +namespace phpseclib3\Crypt\EC\Curves; + +use phpseclib3\Crypt\EC\BaseCurves\Prime; +use phpseclib3\Math\BigInteger; + +class brainpoolP320r1 extends Prime +{ + public function __construct() + { + $this->setModulo(new BigInteger('D35E472036BC4FB7E13C785ED201E065F98FCFA6F6F40DEF4F9' . + '2B9EC7893EC28FCD412B1F1B32E27', 16)); + $this->setCoefficients( + new BigInteger('3EE30B568FBAB0F883CCEBD46D3F3BB8A2A73513F5EB79DA66190EB085FFA9F4' . + '92F375A97D860EB4', 16), + new BigInteger('520883949DFDBC42D3AD198640688A6FE13F41349554B49ACC31DCCD88453981' . + '6F5EB4AC8FB1F1A6', 16) + ); + $this->setBasePoint( + new BigInteger('43BD7E9AFB53D8B85289BCC48EE5BFE6F20137D10A087EB6E7871E2A10A599C7' . + '10AF8D0D39E20611', 16), + new BigInteger('14FDD05545EC1CC8AB4093247F77275E0743FFED117182EAA9C77877AAAC6AC7' . + 'D35245D1692E8EE1', 16) + ); + $this->setOrder(new BigInteger('D35E472036BC4FB7E13C785ED201E065F98FCFA5B68F12A32D4' . + '82EC7EE8658E98691555B44C59311', 16)); + } } \ No newline at end of file diff --git a/phpseclib/Crypt/EC/Curves/brainpoolP320t1.php b/phpseclib/Crypt/EC/Curves/brainpoolP320t1.php index d83cee3d..e6277185 100644 --- a/phpseclib/Crypt/EC/Curves/brainpoolP320t1.php +++ b/phpseclib/Crypt/EC/Curves/brainpoolP320t1.php @@ -1,42 +1,42 @@ - - * @copyright 2017 Jim Wigginton - * @license http://www.opensource.org/licenses/mit-license.html MIT License - * @link http://pear.php.net/package/Math_BigInteger - */ - -namespace phpseclib\Crypt\EC\Curves; - -use phpseclib\Crypt\EC\BaseCurves\Prime; -use phpseclib\Math\BigInteger; - -class brainpoolP320t1 extends Prime -{ - public function __construct() - { - $this->setModulo(new BigInteger('D35E472036BC4FB7E13C785ED201E065F98FCFA6F6F40DEF4F9' . - '2B9EC7893EC28FCD412B1F1B32E27', 16)); - $this->setCoefficients( - new BigInteger('D35E472036BC4FB7E13C785ED201E065F98FCFA6F6F40DEF4F92B9EC7893EC28' . - 'FCD412B1F1B32E24', 16), // eg. -3 - new BigInteger('A7F561E038EB1ED560B3D147DB782013064C19F27ED27C6780AAF77FB8A547CE' . - 'B5B4FEF422340353', 16) - ); - $this->setBasePoint( - new BigInteger('925BE9FB01AFC6FB4D3E7D4990010F813408AB106C4F09CB7EE07868CC136FFF' . - '3357F624A21BED52', 16), - new BigInteger('63BA3A7A27483EBF6671DBEF7ABB30EBEE084E58A0B077AD42A5A0989D1EE71B' . - '1B9BC0455FB0D2C3', 16) - ); - $this->setOrder(new BigInteger('D35E472036BC4FB7E13C785ED201E065F98FCFA5B68F12A32D4' . - '82EC7EE8658E98691555B44C59311', 16)); - } + + * @copyright 2017 Jim Wigginton + * @license http://www.opensource.org/licenses/mit-license.html MIT License + * @link http://pear.php.net/package/Math_BigInteger + */ + +namespace phpseclib3\Crypt\EC\Curves; + +use phpseclib3\Crypt\EC\BaseCurves\Prime; +use phpseclib3\Math\BigInteger; + +class brainpoolP320t1 extends Prime +{ + public function __construct() + { + $this->setModulo(new BigInteger('D35E472036BC4FB7E13C785ED201E065F98FCFA6F6F40DEF4F9' . + '2B9EC7893EC28FCD412B1F1B32E27', 16)); + $this->setCoefficients( + new BigInteger('D35E472036BC4FB7E13C785ED201E065F98FCFA6F6F40DEF4F92B9EC7893EC28' . + 'FCD412B1F1B32E24', 16), // eg. -3 + new BigInteger('A7F561E038EB1ED560B3D147DB782013064C19F27ED27C6780AAF77FB8A547CE' . + 'B5B4FEF422340353', 16) + ); + $this->setBasePoint( + new BigInteger('925BE9FB01AFC6FB4D3E7D4990010F813408AB106C4F09CB7EE07868CC136FFF' . + '3357F624A21BED52', 16), + new BigInteger('63BA3A7A27483EBF6671DBEF7ABB30EBEE084E58A0B077AD42A5A0989D1EE71B' . + '1B9BC0455FB0D2C3', 16) + ); + $this->setOrder(new BigInteger('D35E472036BC4FB7E13C785ED201E065F98FCFA5B68F12A32D4' . + '82EC7EE8658E98691555B44C59311', 16)); + } } \ No newline at end of file diff --git a/phpseclib/Crypt/EC/Curves/brainpoolP384r1.php b/phpseclib/Crypt/EC/Curves/brainpoolP384r1.php index 86a4b20f..5bc8a6d5 100644 --- a/phpseclib/Crypt/EC/Curves/brainpoolP384r1.php +++ b/phpseclib/Crypt/EC/Curves/brainpoolP384r1.php @@ -1,48 +1,48 @@ - - * @copyright 2017 Jim Wigginton - * @license http://www.opensource.org/licenses/mit-license.html MIT License - * @link http://pear.php.net/package/Math_BigInteger - */ - -namespace phpseclib\Crypt\EC\Curves; - -use phpseclib\Crypt\EC\BaseCurves\Prime; -use phpseclib\Math\BigInteger; - -class brainpoolP384r1 extends Prime -{ - public function __construct() - { - $this->setModulo(new BigInteger( - '8CB91E82A3386D280F5D6F7E50E641DF152F7109ED5456B412B1DA197FB71123ACD3A729901D1A7' . - '1874700133107EC53', 16)); - $this->setCoefficients( - new BigInteger( - '7BC382C63D8C150C3C72080ACE05AFA0C2BEA28E4FB22787139165EFBA91F90F8AA5814A503' . - 'AD4EB04A8C7DD22CE2826', 16), - new BigInteger( - '4A8C7DD22CE28268B39B55416F0447C2FB77DE107DCD2A62E880EA53EEB62D57CB4390295DB' . - 'C9943AB78696FA504C11', 16) - ); - $this->setBasePoint( - new BigInteger( - '1D1C64F068CF45FFA2A63A81B7C13F6B8847A3E77EF14FE3DB7FCAFE0CBD10E8E826E03436D' . - '646AAEF87B2E247D4AF1E', 16), - new BigInteger( - '8ABE1D7520F9C2A45CB1EB8E95CFD55262B70B29FEEC5864E19C054FF99129280E464621779' . - '1811142820341263C5315', 16) - ); - $this->setOrder(new BigInteger( - '8CB91E82A3386D280F5D6F7E50E641DF152F7109ED5456B31F166E6CAC0425A7CF3AB6AF6B7FC31' . - '03B883202E9046565', 16)); - } + + * @copyright 2017 Jim Wigginton + * @license http://www.opensource.org/licenses/mit-license.html MIT License + * @link http://pear.php.net/package/Math_BigInteger + */ + +namespace phpseclib3\Crypt\EC\Curves; + +use phpseclib3\Crypt\EC\BaseCurves\Prime; +use phpseclib3\Math\BigInteger; + +class brainpoolP384r1 extends Prime +{ + public function __construct() + { + $this->setModulo(new BigInteger( + '8CB91E82A3386D280F5D6F7E50E641DF152F7109ED5456B412B1DA197FB71123ACD3A729901D1A7' . + '1874700133107EC53', 16)); + $this->setCoefficients( + new BigInteger( + '7BC382C63D8C150C3C72080ACE05AFA0C2BEA28E4FB22787139165EFBA91F90F8AA5814A503' . + 'AD4EB04A8C7DD22CE2826', 16), + new BigInteger( + '4A8C7DD22CE28268B39B55416F0447C2FB77DE107DCD2A62E880EA53EEB62D57CB4390295DB' . + 'C9943AB78696FA504C11', 16) + ); + $this->setBasePoint( + new BigInteger( + '1D1C64F068CF45FFA2A63A81B7C13F6B8847A3E77EF14FE3DB7FCAFE0CBD10E8E826E03436D' . + '646AAEF87B2E247D4AF1E', 16), + new BigInteger( + '8ABE1D7520F9C2A45CB1EB8E95CFD55262B70B29FEEC5864E19C054FF99129280E464621779' . + '1811142820341263C5315', 16) + ); + $this->setOrder(new BigInteger( + '8CB91E82A3386D280F5D6F7E50E641DF152F7109ED5456B31F166E6CAC0425A7CF3AB6AF6B7FC31' . + '03B883202E9046565', 16)); + } } \ No newline at end of file diff --git a/phpseclib/Crypt/EC/Curves/brainpoolP384t1.php b/phpseclib/Crypt/EC/Curves/brainpoolP384t1.php index 2e7d5d91..8bd4a790 100644 --- a/phpseclib/Crypt/EC/Curves/brainpoolP384t1.php +++ b/phpseclib/Crypt/EC/Curves/brainpoolP384t1.php @@ -13,10 +13,10 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Crypt\EC\Curves; +namespace phpseclib3\Crypt\EC\Curves; -use phpseclib\Crypt\EC\BaseCurves\Prime; -use phpseclib\Math\BigInteger; +use phpseclib3\Crypt\EC\BaseCurves\Prime; +use phpseclib3\Math\BigInteger; class brainpoolP384t1 extends Prime { diff --git a/phpseclib/Crypt/EC/Curves/brainpoolP512r1.php b/phpseclib/Crypt/EC/Curves/brainpoolP512r1.php index 9b6904cf..8d22120f 100644 --- a/phpseclib/Crypt/EC/Curves/brainpoolP512r1.php +++ b/phpseclib/Crypt/EC/Curves/brainpoolP512r1.php @@ -1,48 +1,48 @@ - - * @copyright 2017 Jim Wigginton - * @license http://www.opensource.org/licenses/mit-license.html MIT License - * @link http://pear.php.net/package/Math_BigInteger - */ - -namespace phpseclib\Crypt\EC\Curves; - -use phpseclib\Crypt\EC\BaseCurves\Prime; -use phpseclib\Math\BigInteger; - -class brainpoolP512r1 extends Prime -{ - public function __construct() - { - $this->setModulo(new BigInteger( - 'AADD9DB8DBE9C48B3FD4E6AE33C9FC07CB308DB3B3C9D20ED6639CCA703308717D4D9B009BC' . - '66842AECDA12AE6A380E62881FF2F2D82C68528AA6056583A48F3', 16)); - $this->setCoefficients( - new BigInteger( - '7830A3318B603B89E2327145AC234CC594CBDD8D3DF91610A83441CAEA9863BC2DED5D5AA82' . - '53AA10A2EF1C98B9AC8B57F1117A72BF2C7B9E7C1AC4D77FC94CA', 16), - new BigInteger( - '3DF91610A83441CAEA9863BC2DED5D5AA8253AA10A2EF1C98B9AC8B57F1117A72BF2C7B9E7C' . - '1AC4D77FC94CADC083E67984050B75EBAE5DD2809BD638016F723', 16) - ); - $this->setBasePoint( - new BigInteger( - '81AEE4BDD82ED9645A21322E9C4C6A9385ED9F70B5D916C1B43B62EEF4D0098EFF3B1F78E2D' . - '0D48D50D1687B93B97D5F7C6D5047406A5E688B352209BCB9F822', 16), - new BigInteger( - '7DDE385D566332ECC0EABFA9CF7822FDF209F70024A57B1AA000C55B881F8111B2DCDE494A5' . - 'F485E5BCA4BD88A2763AED1CA2B2FA8F0540678CD1E0F3AD80892', 16) - ); - $this->setOrder(new BigInteger( - 'AADD9DB8DBE9C48B3FD4E6AE33C9FC07CB308DB3B3C9D20ED6639CCA70330870553E5C414CA' . - '92619418661197FAC10471DB1D381085DDADDB58796829CA90069', 16)); - } + + * @copyright 2017 Jim Wigginton + * @license http://www.opensource.org/licenses/mit-license.html MIT License + * @link http://pear.php.net/package/Math_BigInteger + */ + +namespace phpseclib3\Crypt\EC\Curves; + +use phpseclib3\Crypt\EC\BaseCurves\Prime; +use phpseclib3\Math\BigInteger; + +class brainpoolP512r1 extends Prime +{ + public function __construct() + { + $this->setModulo(new BigInteger( + 'AADD9DB8DBE9C48B3FD4E6AE33C9FC07CB308DB3B3C9D20ED6639CCA703308717D4D9B009BC' . + '66842AECDA12AE6A380E62881FF2F2D82C68528AA6056583A48F3', 16)); + $this->setCoefficients( + new BigInteger( + '7830A3318B603B89E2327145AC234CC594CBDD8D3DF91610A83441CAEA9863BC2DED5D5AA82' . + '53AA10A2EF1C98B9AC8B57F1117A72BF2C7B9E7C1AC4D77FC94CA', 16), + new BigInteger( + '3DF91610A83441CAEA9863BC2DED5D5AA8253AA10A2EF1C98B9AC8B57F1117A72BF2C7B9E7C' . + '1AC4D77FC94CADC083E67984050B75EBAE5DD2809BD638016F723', 16) + ); + $this->setBasePoint( + new BigInteger( + '81AEE4BDD82ED9645A21322E9C4C6A9385ED9F70B5D916C1B43B62EEF4D0098EFF3B1F78E2D' . + '0D48D50D1687B93B97D5F7C6D5047406A5E688B352209BCB9F822', 16), + new BigInteger( + '7DDE385D566332ECC0EABFA9CF7822FDF209F70024A57B1AA000C55B881F8111B2DCDE494A5' . + 'F485E5BCA4BD88A2763AED1CA2B2FA8F0540678CD1E0F3AD80892', 16) + ); + $this->setOrder(new BigInteger( + 'AADD9DB8DBE9C48B3FD4E6AE33C9FC07CB308DB3B3C9D20ED6639CCA70330870553E5C414CA' . + '92619418661197FAC10471DB1D381085DDADDB58796829CA90069', 16)); + } } \ No newline at end of file diff --git a/phpseclib/Crypt/EC/Curves/brainpoolP512t1.php b/phpseclib/Crypt/EC/Curves/brainpoolP512t1.php index 83b5126d..8566182e 100644 --- a/phpseclib/Crypt/EC/Curves/brainpoolP512t1.php +++ b/phpseclib/Crypt/EC/Curves/brainpoolP512t1.php @@ -1,48 +1,48 @@ - - * @copyright 2017 Jim Wigginton - * @license http://www.opensource.org/licenses/mit-license.html MIT License - * @link http://pear.php.net/package/Math_BigInteger - */ - -namespace phpseclib\Crypt\EC\Curves; - -use phpseclib\Crypt\EC\BaseCurves\Prime; -use phpseclib\Math\BigInteger; - -class brainpoolP512t1 extends Prime -{ - public function __construct() - { - $this->setModulo(new BigInteger( - 'AADD9DB8DBE9C48B3FD4E6AE33C9FC07CB308DB3B3C9D20ED6639CCA703308717D4D9B009BC' . - '66842AECDA12AE6A380E62881FF2F2D82C68528AA6056583A48F3', 16)); - $this->setCoefficients( - new BigInteger( - 'AADD9DB8DBE9C48B3FD4E6AE33C9FC07CB308DB3B3C9D20ED6639CCA703308717D4D9B009BC' . - '66842AECDA12AE6A380E62881FF2F2D82C68528AA6056583A48F0', 16), // eg. -3 - new BigInteger( - '7CBBBCF9441CFAB76E1890E46884EAE321F70C0BCB4981527897504BEC3E36A62BCDFA23049' . - '76540F6450085F2DAE145C22553B465763689180EA2571867423E', 16) - ); - $this->setBasePoint( - new BigInteger( - '640ECE5C12788717B9C1BA06CBC2A6FEBA85842458C56DDE9DB1758D39C0313D82BA51735CD' . - 'B3EA499AA77A7D6943A64F7A3F25FE26F06B51BAA2696FA9035DA', 16), - new BigInteger( - '5B534BD595F5AF0FA2C892376C84ACE1BB4E3019B71634C01131159CAE03CEE9D9932184BEE' . - 'F216BD71DF2DADF86A627306ECFF96DBB8BACE198B61E00F8B332', 16) - ); - $this->setOrder(new BigInteger( - 'AADD9DB8DBE9C48B3FD4E6AE33C9FC07CB308DB3B3C9D20ED6639CCA70330870553E5C414CA' . - '92619418661197FAC10471DB1D381085DDADDB58796829CA90069', 16)); - } + + * @copyright 2017 Jim Wigginton + * @license http://www.opensource.org/licenses/mit-license.html MIT License + * @link http://pear.php.net/package/Math_BigInteger + */ + +namespace phpseclib3\Crypt\EC\Curves; + +use phpseclib3\Crypt\EC\BaseCurves\Prime; +use phpseclib3\Math\BigInteger; + +class brainpoolP512t1 extends Prime +{ + public function __construct() + { + $this->setModulo(new BigInteger( + 'AADD9DB8DBE9C48B3FD4E6AE33C9FC07CB308DB3B3C9D20ED6639CCA703308717D4D9B009BC' . + '66842AECDA12AE6A380E62881FF2F2D82C68528AA6056583A48F3', 16)); + $this->setCoefficients( + new BigInteger( + 'AADD9DB8DBE9C48B3FD4E6AE33C9FC07CB308DB3B3C9D20ED6639CCA703308717D4D9B009BC' . + '66842AECDA12AE6A380E62881FF2F2D82C68528AA6056583A48F0', 16), // eg. -3 + new BigInteger( + '7CBBBCF9441CFAB76E1890E46884EAE321F70C0BCB4981527897504BEC3E36A62BCDFA23049' . + '76540F6450085F2DAE145C22553B465763689180EA2571867423E', 16) + ); + $this->setBasePoint( + new BigInteger( + '640ECE5C12788717B9C1BA06CBC2A6FEBA85842458C56DDE9DB1758D39C0313D82BA51735CD' . + 'B3EA499AA77A7D6943A64F7A3F25FE26F06B51BAA2696FA9035DA', 16), + new BigInteger( + '5B534BD595F5AF0FA2C892376C84ACE1BB4E3019B71634C01131159CAE03CEE9D9932184BEE' . + 'F216BD71DF2DADF86A627306ECFF96DBB8BACE198B61E00F8B332', 16) + ); + $this->setOrder(new BigInteger( + 'AADD9DB8DBE9C48B3FD4E6AE33C9FC07CB308DB3B3C9D20ED6639CCA70330870553E5C414CA' . + '92619418661197FAC10471DB1D381085DDADDB58796829CA90069', 16)); + } } \ No newline at end of file diff --git a/phpseclib/Crypt/EC/Curves/nistb233.php b/phpseclib/Crypt/EC/Curves/nistb233.php index 4420bc38..a2e974ac 100644 --- a/phpseclib/Crypt/EC/Curves/nistb233.php +++ b/phpseclib/Crypt/EC/Curves/nistb233.php @@ -13,7 +13,7 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Crypt\EC\Curves; +namespace phpseclib3\Crypt\EC\Curves; final class nistb233 extends sect233r1 { diff --git a/phpseclib/Crypt/EC/Curves/nistb409.php b/phpseclib/Crypt/EC/Curves/nistb409.php index 3441de97..c3f25829 100644 --- a/phpseclib/Crypt/EC/Curves/nistb409.php +++ b/phpseclib/Crypt/EC/Curves/nistb409.php @@ -13,7 +13,7 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Crypt\EC\Curves; +namespace phpseclib3\Crypt\EC\Curves; final class nistb409 extends sect409r1 { diff --git a/phpseclib/Crypt/EC/Curves/nistk163.php b/phpseclib/Crypt/EC/Curves/nistk163.php index 01677ce7..2d3add6e 100644 --- a/phpseclib/Crypt/EC/Curves/nistk163.php +++ b/phpseclib/Crypt/EC/Curves/nistk163.php @@ -13,7 +13,7 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Crypt\EC\Curves; +namespace phpseclib3\Crypt\EC\Curves; final class nistk163 extends sect163k1 { diff --git a/phpseclib/Crypt/EC/Curves/nistk233.php b/phpseclib/Crypt/EC/Curves/nistk233.php index 3f00cf01..05efea40 100644 --- a/phpseclib/Crypt/EC/Curves/nistk233.php +++ b/phpseclib/Crypt/EC/Curves/nistk233.php @@ -13,7 +13,7 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Crypt\EC\Curves; +namespace phpseclib3\Crypt\EC\Curves; final class nistk233 extends sect233k1 { diff --git a/phpseclib/Crypt/EC/Curves/nistk283.php b/phpseclib/Crypt/EC/Curves/nistk283.php index b30fa8f9..95420587 100644 --- a/phpseclib/Crypt/EC/Curves/nistk283.php +++ b/phpseclib/Crypt/EC/Curves/nistk283.php @@ -13,7 +13,7 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Crypt\EC\Curves; +namespace phpseclib3\Crypt\EC\Curves; final class nistk283 extends sect283k1 { diff --git a/phpseclib/Crypt/EC/Curves/nistk409.php b/phpseclib/Crypt/EC/Curves/nistk409.php index 839e331e..eb55ce7b 100644 --- a/phpseclib/Crypt/EC/Curves/nistk409.php +++ b/phpseclib/Crypt/EC/Curves/nistk409.php @@ -13,7 +13,7 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Crypt\EC\Curves; +namespace phpseclib3\Crypt\EC\Curves; final class nistk409 extends sect409k1 { diff --git a/phpseclib/Crypt/EC/Curves/nistp192.php b/phpseclib/Crypt/EC/Curves/nistp192.php index b5df3539..c600d79f 100644 --- a/phpseclib/Crypt/EC/Curves/nistp192.php +++ b/phpseclib/Crypt/EC/Curves/nistp192.php @@ -13,7 +13,7 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Crypt\EC\Curves; +namespace phpseclib3\Crypt\EC\Curves; final class nistp192 extends secp192r1 { diff --git a/phpseclib/Crypt/EC/Curves/nistp224.php b/phpseclib/Crypt/EC/Curves/nistp224.php index 286ffde8..5c4320ec 100644 --- a/phpseclib/Crypt/EC/Curves/nistp224.php +++ b/phpseclib/Crypt/EC/Curves/nistp224.php @@ -13,7 +13,7 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Crypt\EC\Curves; +namespace phpseclib3\Crypt\EC\Curves; final class nistp224 extends secp224r1 { diff --git a/phpseclib/Crypt/EC/Curves/nistp256.php b/phpseclib/Crypt/EC/Curves/nistp256.php index c6a092d6..56d0b5ad 100644 --- a/phpseclib/Crypt/EC/Curves/nistp256.php +++ b/phpseclib/Crypt/EC/Curves/nistp256.php @@ -13,7 +13,7 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Crypt\EC\Curves; +namespace phpseclib3\Crypt\EC\Curves; final class nistp256 extends secp256r1 { diff --git a/phpseclib/Crypt/EC/Curves/nistp384.php b/phpseclib/Crypt/EC/Curves/nistp384.php index 8bfad34e..7a45babf 100644 --- a/phpseclib/Crypt/EC/Curves/nistp384.php +++ b/phpseclib/Crypt/EC/Curves/nistp384.php @@ -13,7 +13,7 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Crypt\EC\Curves; +namespace phpseclib3\Crypt\EC\Curves; final class nistp384 extends secp384r1 { diff --git a/phpseclib/Crypt/EC/Curves/nistp521.php b/phpseclib/Crypt/EC/Curves/nistp521.php index 6cab5569..167b058f 100644 --- a/phpseclib/Crypt/EC/Curves/nistp521.php +++ b/phpseclib/Crypt/EC/Curves/nistp521.php @@ -13,7 +13,7 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Crypt\EC\Curves; +namespace phpseclib3\Crypt\EC\Curves; final class nistp521 extends secp521r1 { diff --git a/phpseclib/Crypt/EC/Curves/nistt571.php b/phpseclib/Crypt/EC/Curves/nistt571.php index cf7ea5d9..df92a395 100644 --- a/phpseclib/Crypt/EC/Curves/nistt571.php +++ b/phpseclib/Crypt/EC/Curves/nistt571.php @@ -13,7 +13,7 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Crypt\EC\Curves; +namespace phpseclib3\Crypt\EC\Curves; final class nistt571 extends sect571k1 { diff --git a/phpseclib/Crypt/EC/Curves/prime192v1.php b/phpseclib/Crypt/EC/Curves/prime192v1.php index d641aeb4..d329122a 100644 --- a/phpseclib/Crypt/EC/Curves/prime192v1.php +++ b/phpseclib/Crypt/EC/Curves/prime192v1.php @@ -13,7 +13,7 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Crypt\EC\Curves; +namespace phpseclib3\Crypt\EC\Curves; final class prime192v1 extends secp192r1 { diff --git a/phpseclib/Crypt/EC/Curves/prime192v2.php b/phpseclib/Crypt/EC/Curves/prime192v2.php index ffd8a6ec..f5dbfa6b 100644 --- a/phpseclib/Crypt/EC/Curves/prime192v2.php +++ b/phpseclib/Crypt/EC/Curves/prime192v2.php @@ -13,10 +13,10 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Crypt\EC\Curves; +namespace phpseclib3\Crypt\EC\Curves; -use phpseclib\Crypt\EC\BaseCurves\Prime; -use phpseclib\Math\BigInteger; +use phpseclib3\Crypt\EC\BaseCurves\Prime; +use phpseclib3\Math\BigInteger; class prime192v2 extends Prime { diff --git a/phpseclib/Crypt/EC/Curves/prime192v3.php b/phpseclib/Crypt/EC/Curves/prime192v3.php index bc745502..0bd83d37 100644 --- a/phpseclib/Crypt/EC/Curves/prime192v3.php +++ b/phpseclib/Crypt/EC/Curves/prime192v3.php @@ -13,10 +13,10 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Crypt\EC\Curves; +namespace phpseclib3\Crypt\EC\Curves; -use phpseclib\Crypt\EC\BaseCurves\Prime; -use phpseclib\Math\BigInteger; +use phpseclib3\Crypt\EC\BaseCurves\Prime; +use phpseclib3\Math\BigInteger; class prime192v3 extends Prime { diff --git a/phpseclib/Crypt/EC/Curves/prime239v1.php b/phpseclib/Crypt/EC/Curves/prime239v1.php index 473106dd..e42e6925 100644 --- a/phpseclib/Crypt/EC/Curves/prime239v1.php +++ b/phpseclib/Crypt/EC/Curves/prime239v1.php @@ -13,10 +13,10 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Crypt\EC\Curves; +namespace phpseclib3\Crypt\EC\Curves; -use phpseclib\Crypt\EC\BaseCurves\Prime; -use phpseclib\Math\BigInteger; +use phpseclib3\Crypt\EC\BaseCurves\Prime; +use phpseclib3\Math\BigInteger; class prime239v1 extends Prime { diff --git a/phpseclib/Crypt/EC/Curves/prime239v2.php b/phpseclib/Crypt/EC/Curves/prime239v2.php index 1cd52dd8..ad6a3a86 100644 --- a/phpseclib/Crypt/EC/Curves/prime239v2.php +++ b/phpseclib/Crypt/EC/Curves/prime239v2.php @@ -13,10 +13,10 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Crypt\EC\Curves; +namespace phpseclib3\Crypt\EC\Curves; -use phpseclib\Crypt\EC\BaseCurves\Prime; -use phpseclib\Math\BigInteger; +use phpseclib3\Crypt\EC\BaseCurves\Prime; +use phpseclib3\Math\BigInteger; class prime239v2 extends Prime { diff --git a/phpseclib/Crypt/EC/Curves/prime239v3.php b/phpseclib/Crypt/EC/Curves/prime239v3.php index 162143cc..ad41cfe0 100644 --- a/phpseclib/Crypt/EC/Curves/prime239v3.php +++ b/phpseclib/Crypt/EC/Curves/prime239v3.php @@ -13,10 +13,10 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Crypt\EC\Curves; +namespace phpseclib3\Crypt\EC\Curves; -use phpseclib\Crypt\EC\BaseCurves\Prime; -use phpseclib\Math\BigInteger; +use phpseclib3\Crypt\EC\BaseCurves\Prime; +use phpseclib3\Math\BigInteger; class prime239v3 extends Prime { diff --git a/phpseclib/Crypt/EC/Curves/prime256v1.php b/phpseclib/Crypt/EC/Curves/prime256v1.php index 8c249d6c..8440514a 100644 --- a/phpseclib/Crypt/EC/Curves/prime256v1.php +++ b/phpseclib/Crypt/EC/Curves/prime256v1.php @@ -13,7 +13,7 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Crypt\EC\Curves; +namespace phpseclib3\Crypt\EC\Curves; final class prime256v1 extends secp256r1 { diff --git a/phpseclib/Crypt/EC/Curves/secp112r1.php b/phpseclib/Crypt/EC/Curves/secp112r1.php index 317a6c71..4f060018 100644 --- a/phpseclib/Crypt/EC/Curves/secp112r1.php +++ b/phpseclib/Crypt/EC/Curves/secp112r1.php @@ -13,10 +13,10 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Crypt\EC\Curves; +namespace phpseclib3\Crypt\EC\Curves; -use phpseclib\Crypt\EC\BaseCurves\Prime; -use phpseclib\Math\BigInteger; +use phpseclib3\Crypt\EC\BaseCurves\Prime; +use phpseclib3\Math\BigInteger; class secp112r1 extends Prime { diff --git a/phpseclib/Crypt/EC/Curves/secp112r2.php b/phpseclib/Crypt/EC/Curves/secp112r2.php index 13ab2141..e23e6b54 100644 --- a/phpseclib/Crypt/EC/Curves/secp112r2.php +++ b/phpseclib/Crypt/EC/Curves/secp112r2.php @@ -13,10 +13,10 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Crypt\EC\Curves; +namespace phpseclib3\Crypt\EC\Curves; -use phpseclib\Crypt\EC\BaseCurves\Prime; -use phpseclib\Math\BigInteger; +use phpseclib3\Crypt\EC\BaseCurves\Prime; +use phpseclib3\Math\BigInteger; class secp112r2 extends Prime { diff --git a/phpseclib/Crypt/EC/Curves/secp128r1.php b/phpseclib/Crypt/EC/Curves/secp128r1.php index e665d191..afe1336b 100644 --- a/phpseclib/Crypt/EC/Curves/secp128r1.php +++ b/phpseclib/Crypt/EC/Curves/secp128r1.php @@ -13,10 +13,10 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Crypt\EC\Curves; +namespace phpseclib3\Crypt\EC\Curves; -use phpseclib\Crypt\EC\BaseCurves\Prime; -use phpseclib\Math\BigInteger; +use phpseclib3\Crypt\EC\BaseCurves\Prime; +use phpseclib3\Math\BigInteger; class secp128r1 extends Prime { diff --git a/phpseclib/Crypt/EC/Curves/secp128r2.php b/phpseclib/Crypt/EC/Curves/secp128r2.php index 73f05417..4e2719b1 100644 --- a/phpseclib/Crypt/EC/Curves/secp128r2.php +++ b/phpseclib/Crypt/EC/Curves/secp128r2.php @@ -13,10 +13,10 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Crypt\EC\Curves; +namespace phpseclib3\Crypt\EC\Curves; -use phpseclib\Crypt\EC\BaseCurves\Prime; -use phpseclib\Math\BigInteger; +use phpseclib3\Crypt\EC\BaseCurves\Prime; +use phpseclib3\Math\BigInteger; class secp128r2 extends Prime { diff --git a/phpseclib/Crypt/EC/Curves/secp160k1.php b/phpseclib/Crypt/EC/Curves/secp160k1.php index 87415069..80ff73e3 100644 --- a/phpseclib/Crypt/EC/Curves/secp160k1.php +++ b/phpseclib/Crypt/EC/Curves/secp160k1.php @@ -13,10 +13,10 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Crypt\EC\Curves; +namespace phpseclib3\Crypt\EC\Curves; -use phpseclib\Crypt\EC\BaseCurves\KoblitzPrime; -use phpseclib\Math\BigInteger; +use phpseclib3\Crypt\EC\BaseCurves\KoblitzPrime; +use phpseclib3\Math\BigInteger; class secp160k1 extends KoblitzPrime { diff --git a/phpseclib/Crypt/EC/Curves/secp160r1.php b/phpseclib/Crypt/EC/Curves/secp160r1.php index 354e8a8d..5d7739c4 100644 --- a/phpseclib/Crypt/EC/Curves/secp160r1.php +++ b/phpseclib/Crypt/EC/Curves/secp160r1.php @@ -13,10 +13,10 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Crypt\EC\Curves; +namespace phpseclib3\Crypt\EC\Curves; -use phpseclib\Crypt\EC\BaseCurves\Prime; -use phpseclib\Math\BigInteger; +use phpseclib3\Crypt\EC\BaseCurves\Prime; +use phpseclib3\Math\BigInteger; class secp160r1 extends Prime { diff --git a/phpseclib/Crypt/EC/Curves/secp160r2.php b/phpseclib/Crypt/EC/Curves/secp160r2.php index d3aa8752..9b2789b4 100644 --- a/phpseclib/Crypt/EC/Curves/secp160r2.php +++ b/phpseclib/Crypt/EC/Curves/secp160r2.php @@ -13,10 +13,10 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Crypt\EC\Curves; +namespace phpseclib3\Crypt\EC\Curves; -use phpseclib\Crypt\EC\BaseCurves\Prime; -use phpseclib\Math\BigInteger; +use phpseclib3\Crypt\EC\BaseCurves\Prime; +use phpseclib3\Math\BigInteger; class secp160r2 extends Prime { diff --git a/phpseclib/Crypt/EC/Curves/secp192k1.php b/phpseclib/Crypt/EC/Curves/secp192k1.php index a24349dc..79ff610c 100644 --- a/phpseclib/Crypt/EC/Curves/secp192k1.php +++ b/phpseclib/Crypt/EC/Curves/secp192k1.php @@ -13,10 +13,10 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Crypt\EC\Curves; +namespace phpseclib3\Crypt\EC\Curves; -use phpseclib\Crypt\EC\BaseCurves\KoblitzPrime; -use phpseclib\Math\BigInteger; +use phpseclib3\Crypt\EC\BaseCurves\KoblitzPrime; +use phpseclib3\Math\BigInteger; class secp192k1 extends KoblitzPrime { diff --git a/phpseclib/Crypt/EC/Curves/secp192r1.php b/phpseclib/Crypt/EC/Curves/secp192r1.php index 99045884..be7d3898 100644 --- a/phpseclib/Crypt/EC/Curves/secp192r1.php +++ b/phpseclib/Crypt/EC/Curves/secp192r1.php @@ -15,10 +15,10 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Crypt\EC\Curves; +namespace phpseclib3\Crypt\EC\Curves; -use phpseclib\Crypt\EC\BaseCurves\Prime; -use phpseclib\Math\BigInteger; +use phpseclib3\Crypt\EC\BaseCurves\Prime; +use phpseclib3\Math\BigInteger; class secp192r1 extends Prime { diff --git a/phpseclib/Crypt/EC/Curves/secp224k1.php b/phpseclib/Crypt/EC/Curves/secp224k1.php index d6880d35..6a2b9a82 100644 --- a/phpseclib/Crypt/EC/Curves/secp224k1.php +++ b/phpseclib/Crypt/EC/Curves/secp224k1.php @@ -13,10 +13,10 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Crypt\EC\Curves; +namespace phpseclib3\Crypt\EC\Curves; -use phpseclib\Crypt\EC\BaseCurves\KoblitzPrime; -use phpseclib\Math\BigInteger; +use phpseclib3\Crypt\EC\BaseCurves\KoblitzPrime; +use phpseclib3\Math\BigInteger; class secp224k1 extends KoblitzPrime { diff --git a/phpseclib/Crypt/EC/Curves/secp224r1.php b/phpseclib/Crypt/EC/Curves/secp224r1.php index f27c3736..23ac2297 100644 --- a/phpseclib/Crypt/EC/Curves/secp224r1.php +++ b/phpseclib/Crypt/EC/Curves/secp224r1.php @@ -13,10 +13,10 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Crypt\EC\Curves; +namespace phpseclib3\Crypt\EC\Curves; -use phpseclib\Crypt\EC\BaseCurves\Prime; -use phpseclib\Math\BigInteger; +use phpseclib3\Crypt\EC\BaseCurves\Prime; +use phpseclib3\Math\BigInteger; class secp224r1 extends Prime { diff --git a/phpseclib/Crypt/EC/Curves/secp256k1.php b/phpseclib/Crypt/EC/Curves/secp256k1.php index f776491a..958a4847 100644 --- a/phpseclib/Crypt/EC/Curves/secp256k1.php +++ b/phpseclib/Crypt/EC/Curves/secp256k1.php @@ -15,11 +15,11 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Crypt\EC\Curves; +namespace phpseclib3\Crypt\EC\Curves; -//use phpseclib\Crypt\EC\BaseCurves\Prime; -use phpseclib\Crypt\EC\BaseCurves\KoblitzPrime; -use phpseclib\Math\BigInteger; +//use phpseclib3\Crypt\EC\BaseCurves\Prime; +use phpseclib3\Crypt\EC\BaseCurves\KoblitzPrime; +use phpseclib3\Math\BigInteger; //class secp256k1 extends Prime class secp256k1 extends KoblitzPrime diff --git a/phpseclib/Crypt/EC/Curves/secp256r1.php b/phpseclib/Crypt/EC/Curves/secp256r1.php index cfc12247..f929f4fa 100644 --- a/phpseclib/Crypt/EC/Curves/secp256r1.php +++ b/phpseclib/Crypt/EC/Curves/secp256r1.php @@ -13,10 +13,10 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Crypt\EC\Curves; +namespace phpseclib3\Crypt\EC\Curves; -use phpseclib\Crypt\EC\BaseCurves\Prime; -use phpseclib\Math\BigInteger; +use phpseclib3\Crypt\EC\BaseCurves\Prime; +use phpseclib3\Math\BigInteger; class secp256r1 extends Prime { diff --git a/phpseclib/Crypt/EC/Curves/secp384r1.php b/phpseclib/Crypt/EC/Curves/secp384r1.php index dcff1d77..8c01a761 100644 --- a/phpseclib/Crypt/EC/Curves/secp384r1.php +++ b/phpseclib/Crypt/EC/Curves/secp384r1.php @@ -13,10 +13,10 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Crypt\EC\Curves; +namespace phpseclib3\Crypt\EC\Curves; -use phpseclib\Crypt\EC\BaseCurves\Prime; -use phpseclib\Math\BigInteger; +use phpseclib3\Crypt\EC\BaseCurves\Prime; +use phpseclib3\Math\BigInteger; class secp384r1 extends Prime { diff --git a/phpseclib/Crypt/EC/Curves/secp521r1.php b/phpseclib/Crypt/EC/Curves/secp521r1.php index 0ffc738e..8c2b9bbd 100644 --- a/phpseclib/Crypt/EC/Curves/secp521r1.php +++ b/phpseclib/Crypt/EC/Curves/secp521r1.php @@ -13,10 +13,10 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Crypt\EC\Curves; +namespace phpseclib3\Crypt\EC\Curves; -use phpseclib\Crypt\EC\BaseCurves\Prime; -use phpseclib\Math\BigInteger; +use phpseclib3\Crypt\EC\BaseCurves\Prime; +use phpseclib3\Math\BigInteger; class secp521r1 extends Prime { diff --git a/phpseclib/Crypt/EC/Curves/sect113r1.php b/phpseclib/Crypt/EC/Curves/sect113r1.php index 6caf5ff8..958082a3 100644 --- a/phpseclib/Crypt/EC/Curves/sect113r1.php +++ b/phpseclib/Crypt/EC/Curves/sect113r1.php @@ -13,10 +13,10 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Crypt\EC\Curves; +namespace phpseclib3\Crypt\EC\Curves; -use phpseclib\Crypt\EC\BaseCurves\Binary; -use phpseclib\Math\BigInteger; +use phpseclib3\Crypt\EC\BaseCurves\Binary; +use phpseclib3\Math\BigInteger; class sect113r1 extends Binary { diff --git a/phpseclib/Crypt/EC/Curves/sect113r2.php b/phpseclib/Crypt/EC/Curves/sect113r2.php index c927f6b0..9683c28f 100644 --- a/phpseclib/Crypt/EC/Curves/sect113r2.php +++ b/phpseclib/Crypt/EC/Curves/sect113r2.php @@ -13,10 +13,10 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Crypt\EC\Curves; +namespace phpseclib3\Crypt\EC\Curves; -use phpseclib\Crypt\EC\BaseCurves\Binary; -use phpseclib\Math\BigInteger; +use phpseclib3\Crypt\EC\BaseCurves\Binary; +use phpseclib3\Math\BigInteger; class sect113r2 extends Binary { diff --git a/phpseclib/Crypt/EC/Curves/sect131r1.php b/phpseclib/Crypt/EC/Curves/sect131r1.php index f354c381..f1585b7f 100644 --- a/phpseclib/Crypt/EC/Curves/sect131r1.php +++ b/phpseclib/Crypt/EC/Curves/sect131r1.php @@ -13,10 +13,10 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Crypt\EC\Curves; +namespace phpseclib3\Crypt\EC\Curves; -use phpseclib\Crypt\EC\BaseCurves\Binary; -use phpseclib\Math\BigInteger; +use phpseclib3\Crypt\EC\BaseCurves\Binary; +use phpseclib3\Math\BigInteger; class sect131r1 extends Binary { diff --git a/phpseclib/Crypt/EC/Curves/sect131r2.php b/phpseclib/Crypt/EC/Curves/sect131r2.php index 04526494..ecf7f99e 100644 --- a/phpseclib/Crypt/EC/Curves/sect131r2.php +++ b/phpseclib/Crypt/EC/Curves/sect131r2.php @@ -13,10 +13,10 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Crypt\EC\Curves; +namespace phpseclib3\Crypt\EC\Curves; -use phpseclib\Crypt\EC\BaseCurves\Binary; -use phpseclib\Math\BigInteger; +use phpseclib3\Crypt\EC\BaseCurves\Binary; +use phpseclib3\Math\BigInteger; class sect131r2 extends Binary { diff --git a/phpseclib/Crypt/EC/Curves/sect163k1.php b/phpseclib/Crypt/EC/Curves/sect163k1.php index 7e108d82..cf51933b 100644 --- a/phpseclib/Crypt/EC/Curves/sect163k1.php +++ b/phpseclib/Crypt/EC/Curves/sect163k1.php @@ -13,10 +13,10 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Crypt\EC\Curves; +namespace phpseclib3\Crypt\EC\Curves; -use phpseclib\Crypt\EC\BaseCurves\Binary; -use phpseclib\Math\BigInteger; +use phpseclib3\Crypt\EC\BaseCurves\Binary; +use phpseclib3\Math\BigInteger; class sect163k1 extends Binary { diff --git a/phpseclib/Crypt/EC/Curves/sect163r1.php b/phpseclib/Crypt/EC/Curves/sect163r1.php index 543efff4..ca1c00ff 100644 --- a/phpseclib/Crypt/EC/Curves/sect163r1.php +++ b/phpseclib/Crypt/EC/Curves/sect163r1.php @@ -13,10 +13,10 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Crypt\EC\Curves; +namespace phpseclib3\Crypt\EC\Curves; -use phpseclib\Crypt\EC\BaseCurves\Binary; -use phpseclib\Math\BigInteger; +use phpseclib3\Crypt\EC\BaseCurves\Binary; +use phpseclib3\Math\BigInteger; class sect163r1 extends Binary { diff --git a/phpseclib/Crypt/EC/Curves/sect163r2.php b/phpseclib/Crypt/EC/Curves/sect163r2.php index 5a3c17a3..c473b940 100644 --- a/phpseclib/Crypt/EC/Curves/sect163r2.php +++ b/phpseclib/Crypt/EC/Curves/sect163r2.php @@ -1,36 +1,36 @@ - - * @copyright 2017 Jim Wigginton - * @license http://www.opensource.org/licenses/mit-license.html MIT License - * @link http://pear.php.net/package/Math_BigInteger - */ - -namespace phpseclib\Crypt\EC\Curves; - -use phpseclib\Crypt\EC\BaseCurves\Binary; -use phpseclib\Math\BigInteger; - -class sect163r2 extends Binary -{ - public function __construct() - { - $this->setModulo(163, 7, 6, 3, 0); - $this->setCoefficients( - '000000000000000000000000000000000000000001', - '020A601907B8C953CA1481EB10512F78744A3205FD' - ); - $this->setBasePoint( - '03F0EBA16286A2D57EA0991168D4994637E8343E36', - '00D51FBC6C71A0094FA2CDD545B11C5C0C797324F1' - ); - $this->setOrder(new BigInteger('040000000000000000000292FE77E70C12A4234C33', 16)); - } -} + + * @copyright 2017 Jim Wigginton + * @license http://www.opensource.org/licenses/mit-license.html MIT License + * @link http://pear.php.net/package/Math_BigInteger + */ + +namespace phpseclib3\Crypt\EC\Curves; + +use phpseclib3\Crypt\EC\BaseCurves\Binary; +use phpseclib3\Math\BigInteger; + +class sect163r2 extends Binary +{ + public function __construct() + { + $this->setModulo(163, 7, 6, 3, 0); + $this->setCoefficients( + '000000000000000000000000000000000000000001', + '020A601907B8C953CA1481EB10512F78744A3205FD' + ); + $this->setBasePoint( + '03F0EBA16286A2D57EA0991168D4994637E8343E36', + '00D51FBC6C71A0094FA2CDD545B11C5C0C797324F1' + ); + $this->setOrder(new BigInteger('040000000000000000000292FE77E70C12A4234C33', 16)); + } +} diff --git a/phpseclib/Crypt/EC/Curves/sect193r1.php b/phpseclib/Crypt/EC/Curves/sect193r1.php index 801130cc..830f1ba2 100644 --- a/phpseclib/Crypt/EC/Curves/sect193r1.php +++ b/phpseclib/Crypt/EC/Curves/sect193r1.php @@ -1,36 +1,36 @@ - - * @copyright 2017 Jim Wigginton - * @license http://www.opensource.org/licenses/mit-license.html MIT License - * @link http://pear.php.net/package/Math_BigInteger - */ - -namespace phpseclib\Crypt\EC\Curves; - -use phpseclib\Crypt\EC\BaseCurves\Binary; -use phpseclib\Math\BigInteger; - -class sect193r1 extends Binary -{ - public function __construct() - { - $this->setModulo(193, 15, 0); - $this->setCoefficients( - '0017858FEB7A98975169E171F77B4087DE098AC8A911DF7B01', - '00FDFB49BFE6C3A89FACADAA7A1E5BBC7CC1C2E5D831478814' - ); - $this->setBasePoint( - '01F481BC5F0FF84A74AD6CDF6FDEF4BF6179625372D8C0C5E1', - '0025E399F2903712CCF3EA9E3A1AD17FB0B3201B6AF7CE1B05' - ); - $this->setOrder(new BigInteger('01000000000000000000000000C7F34A778F443ACC920EBA49', 16)); - } -} + + * @copyright 2017 Jim Wigginton + * @license http://www.opensource.org/licenses/mit-license.html MIT License + * @link http://pear.php.net/package/Math_BigInteger + */ + +namespace phpseclib3\Crypt\EC\Curves; + +use phpseclib3\Crypt\EC\BaseCurves\Binary; +use phpseclib3\Math\BigInteger; + +class sect193r1 extends Binary +{ + public function __construct() + { + $this->setModulo(193, 15, 0); + $this->setCoefficients( + '0017858FEB7A98975169E171F77B4087DE098AC8A911DF7B01', + '00FDFB49BFE6C3A89FACADAA7A1E5BBC7CC1C2E5D831478814' + ); + $this->setBasePoint( + '01F481BC5F0FF84A74AD6CDF6FDEF4BF6179625372D8C0C5E1', + '0025E399F2903712CCF3EA9E3A1AD17FB0B3201B6AF7CE1B05' + ); + $this->setOrder(new BigInteger('01000000000000000000000000C7F34A778F443ACC920EBA49', 16)); + } +} diff --git a/phpseclib/Crypt/EC/Curves/sect193r2.php b/phpseclib/Crypt/EC/Curves/sect193r2.php index 16992009..6bf2462b 100644 --- a/phpseclib/Crypt/EC/Curves/sect193r2.php +++ b/phpseclib/Crypt/EC/Curves/sect193r2.php @@ -1,36 +1,36 @@ - - * @copyright 2017 Jim Wigginton - * @license http://www.opensource.org/licenses/mit-license.html MIT License - * @link http://pear.php.net/package/Math_BigInteger - */ - -namespace phpseclib\Crypt\EC\Curves; - -use phpseclib\Crypt\EC\BaseCurves\Binary; -use phpseclib\Math\BigInteger; - -class sect193r2 extends Binary -{ - public function __construct() - { - $this->setModulo(193, 15, 0); - $this->setCoefficients( - '0163F35A5137C2CE3EA6ED8667190B0BC43ECD69977702709B', - '00C9BB9E8927D4D64C377E2AB2856A5B16E3EFB7F61D4316AE' - ); - $this->setBasePoint( - '00D9B67D192E0367C803F39E1A7E82CA14A651350AAE617E8F', - '01CE94335607C304AC29E7DEFBD9CA01F596F927224CDECF6C' - ); - $this->setOrder(new BigInteger('010000000000000000000000015AAB561B005413CCD4EE99D5', 16)); - } -} + + * @copyright 2017 Jim Wigginton + * @license http://www.opensource.org/licenses/mit-license.html MIT License + * @link http://pear.php.net/package/Math_BigInteger + */ + +namespace phpseclib3\Crypt\EC\Curves; + +use phpseclib3\Crypt\EC\BaseCurves\Binary; +use phpseclib3\Math\BigInteger; + +class sect193r2 extends Binary +{ + public function __construct() + { + $this->setModulo(193, 15, 0); + $this->setCoefficients( + '0163F35A5137C2CE3EA6ED8667190B0BC43ECD69977702709B', + '00C9BB9E8927D4D64C377E2AB2856A5B16E3EFB7F61D4316AE' + ); + $this->setBasePoint( + '00D9B67D192E0367C803F39E1A7E82CA14A651350AAE617E8F', + '01CE94335607C304AC29E7DEFBD9CA01F596F927224CDECF6C' + ); + $this->setOrder(new BigInteger('010000000000000000000000015AAB561B005413CCD4EE99D5', 16)); + } +} diff --git a/phpseclib/Crypt/EC/Curves/sect233k1.php b/phpseclib/Crypt/EC/Curves/sect233k1.php index 7429bbe7..7a42f299 100644 --- a/phpseclib/Crypt/EC/Curves/sect233k1.php +++ b/phpseclib/Crypt/EC/Curves/sect233k1.php @@ -1,36 +1,36 @@ - - * @copyright 2017 Jim Wigginton - * @license http://www.opensource.org/licenses/mit-license.html MIT License - * @link http://pear.php.net/package/Math_BigInteger - */ - -namespace phpseclib\Crypt\EC\Curves; - -use phpseclib\Crypt\EC\BaseCurves\Binary; -use phpseclib\Math\BigInteger; - -class sect233k1 extends Binary -{ - public function __construct() - { - $this->setModulo(233, 74, 0); - $this->setCoefficients( - '000000000000000000000000000000000000000000000000000000000000', - '000000000000000000000000000000000000000000000000000000000001' - ); - $this->setBasePoint( - '017232BA853A7E731AF129F22FF4149563A419C26BF50A4C9D6EEFAD6126', - '01DB537DECE819B7F70F555A67C427A8CD9BF18AEB9B56E0C11056FAE6A3' - ); - $this->setOrder(new BigInteger('8000000000000000000000000000069D5BB915BCD46EFB1AD5F173ABDF', 16)); - } -} + + * @copyright 2017 Jim Wigginton + * @license http://www.opensource.org/licenses/mit-license.html MIT License + * @link http://pear.php.net/package/Math_BigInteger + */ + +namespace phpseclib3\Crypt\EC\Curves; + +use phpseclib3\Crypt\EC\BaseCurves\Binary; +use phpseclib3\Math\BigInteger; + +class sect233k1 extends Binary +{ + public function __construct() + { + $this->setModulo(233, 74, 0); + $this->setCoefficients( + '000000000000000000000000000000000000000000000000000000000000', + '000000000000000000000000000000000000000000000000000000000001' + ); + $this->setBasePoint( + '017232BA853A7E731AF129F22FF4149563A419C26BF50A4C9D6EEFAD6126', + '01DB537DECE819B7F70F555A67C427A8CD9BF18AEB9B56E0C11056FAE6A3' + ); + $this->setOrder(new BigInteger('8000000000000000000000000000069D5BB915BCD46EFB1AD5F173ABDF', 16)); + } +} diff --git a/phpseclib/Crypt/EC/Curves/sect233r1.php b/phpseclib/Crypt/EC/Curves/sect233r1.php index a783c8a3..86d910c1 100644 --- a/phpseclib/Crypt/EC/Curves/sect233r1.php +++ b/phpseclib/Crypt/EC/Curves/sect233r1.php @@ -1,36 +1,36 @@ - - * @copyright 2017 Jim Wigginton - * @license http://www.opensource.org/licenses/mit-license.html MIT License - * @link http://pear.php.net/package/Math_BigInteger - */ - -namespace phpseclib\Crypt\EC\Curves; - -use phpseclib\Crypt\EC\BaseCurves\Binary; -use phpseclib\Math\BigInteger; - -class sect233r1 extends Binary -{ - public function __construct() - { - $this->setModulo(233, 74, 0); - $this->setCoefficients( - '000000000000000000000000000000000000000000000000000000000001', - '0066647EDE6C332C7F8C0923BB58213B333B20E9CE4281FE115F7D8F90AD' - ); - $this->setBasePoint( - '00FAC9DFCBAC8313BB2139F1BB755FEF65BC391F8B36F8F8EB7371FD558B', - '01006A08A41903350678E58528BEBF8A0BEFF867A7CA36716F7E01F81052' - ); - $this->setOrder(new BigInteger('01000000000000000000000000000013E974E72F8A6922031D2603CFE0D7', 16)); - } -} + + * @copyright 2017 Jim Wigginton + * @license http://www.opensource.org/licenses/mit-license.html MIT License + * @link http://pear.php.net/package/Math_BigInteger + */ + +namespace phpseclib3\Crypt\EC\Curves; + +use phpseclib3\Crypt\EC\BaseCurves\Binary; +use phpseclib3\Math\BigInteger; + +class sect233r1 extends Binary +{ + public function __construct() + { + $this->setModulo(233, 74, 0); + $this->setCoefficients( + '000000000000000000000000000000000000000000000000000000000001', + '0066647EDE6C332C7F8C0923BB58213B333B20E9CE4281FE115F7D8F90AD' + ); + $this->setBasePoint( + '00FAC9DFCBAC8313BB2139F1BB755FEF65BC391F8B36F8F8EB7371FD558B', + '01006A08A41903350678E58528BEBF8A0BEFF867A7CA36716F7E01F81052' + ); + $this->setOrder(new BigInteger('01000000000000000000000000000013E974E72F8A6922031D2603CFE0D7', 16)); + } +} diff --git a/phpseclib/Crypt/EC/Curves/sect239k1.php b/phpseclib/Crypt/EC/Curves/sect239k1.php index c70a4321..1c8fcd1f 100644 --- a/phpseclib/Crypt/EC/Curves/sect239k1.php +++ b/phpseclib/Crypt/EC/Curves/sect239k1.php @@ -1,36 +1,36 @@ - - * @copyright 2017 Jim Wigginton - * @license http://www.opensource.org/licenses/mit-license.html MIT License - * @link http://pear.php.net/package/Math_BigInteger - */ - -namespace phpseclib\Crypt\EC\Curves; - -use phpseclib\Crypt\EC\BaseCurves\Binary; -use phpseclib\Math\BigInteger; - -class sect239k1 extends Binary -{ - public function __construct() - { - $this->setModulo(239, 158, 0); - $this->setCoefficients( - '000000000000000000000000000000000000000000000000000000000000', - '000000000000000000000000000000000000000000000000000000000001' - ); - $this->setBasePoint( - '29A0B6A887A983E9730988A68727A8B2D126C44CC2CC7B2A6555193035DC', - '76310804F12E549BDB011C103089E73510ACB275FC312A5DC6B76553F0CA' - ); - $this->setOrder(new BigInteger('2000000000000000000000000000005A79FEC67CB6E91F1C1DA800E478A5', 16)); - } -} + + * @copyright 2017 Jim Wigginton + * @license http://www.opensource.org/licenses/mit-license.html MIT License + * @link http://pear.php.net/package/Math_BigInteger + */ + +namespace phpseclib3\Crypt\EC\Curves; + +use phpseclib3\Crypt\EC\BaseCurves\Binary; +use phpseclib3\Math\BigInteger; + +class sect239k1 extends Binary +{ + public function __construct() + { + $this->setModulo(239, 158, 0); + $this->setCoefficients( + '000000000000000000000000000000000000000000000000000000000000', + '000000000000000000000000000000000000000000000000000000000001' + ); + $this->setBasePoint( + '29A0B6A887A983E9730988A68727A8B2D126C44CC2CC7B2A6555193035DC', + '76310804F12E549BDB011C103089E73510ACB275FC312A5DC6B76553F0CA' + ); + $this->setOrder(new BigInteger('2000000000000000000000000000005A79FEC67CB6E91F1C1DA800E478A5', 16)); + } +} diff --git a/phpseclib/Crypt/EC/Curves/sect283k1.php b/phpseclib/Crypt/EC/Curves/sect283k1.php index e60edc32..fdd48226 100644 --- a/phpseclib/Crypt/EC/Curves/sect283k1.php +++ b/phpseclib/Crypt/EC/Curves/sect283k1.php @@ -1,36 +1,36 @@ - - * @copyright 2017 Jim Wigginton - * @license http://www.opensource.org/licenses/mit-license.html MIT License - * @link http://pear.php.net/package/Math_BigInteger - */ - -namespace phpseclib\Crypt\EC\Curves; - -use phpseclib\Crypt\EC\BaseCurves\Binary; -use phpseclib\Math\BigInteger; - -class sect283k1 extends Binary -{ - public function __construct() - { - $this->setModulo(283, 12, 7, 5, 0); - $this->setCoefficients( - '000000000000000000000000000000000000000000000000000000000000000000000000', - '000000000000000000000000000000000000000000000000000000000000000000000001' - ); - $this->setBasePoint( - '0503213F78CA44883F1A3B8162F188E553CD265F23C1567A16876913B0C2AC2458492836', - '01CCDA380F1C9E318D90F95D07E5426FE87E45C0E8184698E45962364E34116177DD2259' - ); - $this->setOrder(new BigInteger('01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE9AE2ED07577265DFF7F94451E061E163C61', 16)); - } -} + + * @copyright 2017 Jim Wigginton + * @license http://www.opensource.org/licenses/mit-license.html MIT License + * @link http://pear.php.net/package/Math_BigInteger + */ + +namespace phpseclib3\Crypt\EC\Curves; + +use phpseclib3\Crypt\EC\BaseCurves\Binary; +use phpseclib3\Math\BigInteger; + +class sect283k1 extends Binary +{ + public function __construct() + { + $this->setModulo(283, 12, 7, 5, 0); + $this->setCoefficients( + '000000000000000000000000000000000000000000000000000000000000000000000000', + '000000000000000000000000000000000000000000000000000000000000000000000001' + ); + $this->setBasePoint( + '0503213F78CA44883F1A3B8162F188E553CD265F23C1567A16876913B0C2AC2458492836', + '01CCDA380F1C9E318D90F95D07E5426FE87E45C0E8184698E45962364E34116177DD2259' + ); + $this->setOrder(new BigInteger('01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE9AE2ED07577265DFF7F94451E061E163C61', 16)); + } +} diff --git a/phpseclib/Crypt/EC/Curves/sect283r1.php b/phpseclib/Crypt/EC/Curves/sect283r1.php index abb3a818..32a52e66 100644 --- a/phpseclib/Crypt/EC/Curves/sect283r1.php +++ b/phpseclib/Crypt/EC/Curves/sect283r1.php @@ -1,36 +1,36 @@ - - * @copyright 2017 Jim Wigginton - * @license http://www.opensource.org/licenses/mit-license.html MIT License - * @link http://pear.php.net/package/Math_BigInteger - */ - -namespace phpseclib\Crypt\EC\Curves; - -use phpseclib\Crypt\EC\BaseCurves\Binary; -use phpseclib\Math\BigInteger; - -class sect283r1 extends Binary -{ - public function __construct() - { - $this->setModulo(283, 12, 7, 5, 0); - $this->setCoefficients( - '000000000000000000000000000000000000000000000000000000000000000000000001', - '027B680AC8B8596DA5A4AF8A19A0303FCA97FD7645309FA2A581485AF6263E313B79A2F5' - ); - $this->setBasePoint( - '05F939258DB7DD90E1934F8C70B0DFEC2EED25B8557EAC9C80E2E198F8CDBECD86B12053', - '03676854FE24141CB98FE6D4B20D02B4516FF702350EDDB0826779C813F0DF45BE8112F4' - ); - $this->setOrder(new BigInteger('03FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEF90399660FC938A90165B042A7CEFADB307', 16)); - } -} + + * @copyright 2017 Jim Wigginton + * @license http://www.opensource.org/licenses/mit-license.html MIT License + * @link http://pear.php.net/package/Math_BigInteger + */ + +namespace phpseclib3\Crypt\EC\Curves; + +use phpseclib3\Crypt\EC\BaseCurves\Binary; +use phpseclib3\Math\BigInteger; + +class sect283r1 extends Binary +{ + public function __construct() + { + $this->setModulo(283, 12, 7, 5, 0); + $this->setCoefficients( + '000000000000000000000000000000000000000000000000000000000000000000000001', + '027B680AC8B8596DA5A4AF8A19A0303FCA97FD7645309FA2A581485AF6263E313B79A2F5' + ); + $this->setBasePoint( + '05F939258DB7DD90E1934F8C70B0DFEC2EED25B8557EAC9C80E2E198F8CDBECD86B12053', + '03676854FE24141CB98FE6D4B20D02B4516FF702350EDDB0826779C813F0DF45BE8112F4' + ); + $this->setOrder(new BigInteger('03FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEF90399660FC938A90165B042A7CEFADB307', 16)); + } +} diff --git a/phpseclib/Crypt/EC/Curves/sect409k1.php b/phpseclib/Crypt/EC/Curves/sect409k1.php index be03a574..d9c798a2 100644 --- a/phpseclib/Crypt/EC/Curves/sect409k1.php +++ b/phpseclib/Crypt/EC/Curves/sect409k1.php @@ -1,39 +1,39 @@ - - * @copyright 2017 Jim Wigginton - * @license http://www.opensource.org/licenses/mit-license.html MIT License - * @link http://pear.php.net/package/Math_BigInteger - */ - -namespace phpseclib\Crypt\EC\Curves; - -use phpseclib\Crypt\EC\BaseCurves\Binary; -use phpseclib\Math\BigInteger; - -class sect409k1 extends Binary -{ - public function __construct() - { - $this->setModulo(409, 87, 0); - $this->setCoefficients( - '00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', - '00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001' - ); - $this->setBasePoint( - '0060F05F658F49C1AD3AB1890F7184210EFD0987E307C84C27ACCFB8F9F67CC2C460189EB5AAAA62EE222EB1B35540CFE9023746', - '01E369050B7C4E42ACBA1DACBF04299C3460782F918EA427E6325165E9EA10E3DA5F6C42E9C55215AA9CA27A5863EC48D8E0286B' - ); - $this->setOrder(new BigInteger( - '7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE5F' . - '83B2D4EA20400EC4557D5ED3E3E7CA5B4B5C83B8E01E5FCF', 16 - )); - } -} + + * @copyright 2017 Jim Wigginton + * @license http://www.opensource.org/licenses/mit-license.html MIT License + * @link http://pear.php.net/package/Math_BigInteger + */ + +namespace phpseclib3\Crypt\EC\Curves; + +use phpseclib3\Crypt\EC\BaseCurves\Binary; +use phpseclib3\Math\BigInteger; + +class sect409k1 extends Binary +{ + public function __construct() + { + $this->setModulo(409, 87, 0); + $this->setCoefficients( + '00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', + '00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001' + ); + $this->setBasePoint( + '0060F05F658F49C1AD3AB1890F7184210EFD0987E307C84C27ACCFB8F9F67CC2C460189EB5AAAA62EE222EB1B35540CFE9023746', + '01E369050B7C4E42ACBA1DACBF04299C3460782F918EA427E6325165E9EA10E3DA5F6C42E9C55215AA9CA27A5863EC48D8E0286B' + ); + $this->setOrder(new BigInteger( + '7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE5F' . + '83B2D4EA20400EC4557D5ED3E3E7CA5B4B5C83B8E01E5FCF', 16 + )); + } +} diff --git a/phpseclib/Crypt/EC/Curves/sect409r1.php b/phpseclib/Crypt/EC/Curves/sect409r1.php index c588d2dd..c441180c 100644 --- a/phpseclib/Crypt/EC/Curves/sect409r1.php +++ b/phpseclib/Crypt/EC/Curves/sect409r1.php @@ -1,39 +1,39 @@ - - * @copyright 2017 Jim Wigginton - * @license http://www.opensource.org/licenses/mit-license.html MIT License - * @link http://pear.php.net/package/Math_BigInteger - */ - -namespace phpseclib\Crypt\EC\Curves; - -use phpseclib\Crypt\EC\BaseCurves\Binary; -use phpseclib\Math\BigInteger; - -class sect409r1 extends Binary -{ - public function __construct() - { - $this->setModulo(409, 87, 0); - $this->setCoefficients( - '00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001', - '0021A5C2C8EE9FEB5C4B9A753B7B476B7FD6422EF1F3DD674761FA99D6AC27C8A9A197B272822F6CD57A55AA4F50AE317B13545F' - ); - $this->setBasePoint( - '015D4860D088DDB3496B0C6064756260441CDE4AF1771D4DB01FFE5B34E59703DC255A868A1180515603AEAB60794E54BB7996A7', - '0061B1CFAB6BE5F32BBFA78324ED106A7636B9C5A7BD198D0158AA4F5488D08F38514F1FDF4B4F40D2181B3681C364BA0273C706' - ); - $this->setOrder(new BigInteger( - '010000000000000000000000000000000000000000000000000001E2' . - 'AAD6A612F33307BE5FA47C3C9E052F838164CD37D9A21173', 16 - )); - } -} + + * @copyright 2017 Jim Wigginton + * @license http://www.opensource.org/licenses/mit-license.html MIT License + * @link http://pear.php.net/package/Math_BigInteger + */ + +namespace phpseclib3\Crypt\EC\Curves; + +use phpseclib3\Crypt\EC\BaseCurves\Binary; +use phpseclib3\Math\BigInteger; + +class sect409r1 extends Binary +{ + public function __construct() + { + $this->setModulo(409, 87, 0); + $this->setCoefficients( + '00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001', + '0021A5C2C8EE9FEB5C4B9A753B7B476B7FD6422EF1F3DD674761FA99D6AC27C8A9A197B272822F6CD57A55AA4F50AE317B13545F' + ); + $this->setBasePoint( + '015D4860D088DDB3496B0C6064756260441CDE4AF1771D4DB01FFE5B34E59703DC255A868A1180515603AEAB60794E54BB7996A7', + '0061B1CFAB6BE5F32BBFA78324ED106A7636B9C5A7BD198D0158AA4F5488D08F38514F1FDF4B4F40D2181B3681C364BA0273C706' + ); + $this->setOrder(new BigInteger( + '010000000000000000000000000000000000000000000000000001E2' . + 'AAD6A612F33307BE5FA47C3C9E052F838164CD37D9A21173', 16 + )); + } +} diff --git a/phpseclib/Crypt/EC/Curves/sect571k1.php b/phpseclib/Crypt/EC/Curves/sect571k1.php index b54caae4..c1dd4f11 100644 --- a/phpseclib/Crypt/EC/Curves/sect571k1.php +++ b/phpseclib/Crypt/EC/Curves/sect571k1.php @@ -1,43 +1,43 @@ - - * @copyright 2017 Jim Wigginton - * @license http://www.opensource.org/licenses/mit-license.html MIT License - * @link http://pear.php.net/package/Math_BigInteger - */ - -namespace phpseclib\Crypt\EC\Curves; - -use phpseclib\Crypt\EC\BaseCurves\Binary; -use phpseclib\Math\BigInteger; - -class sect571k1 extends Binary -{ - public function __construct() - { - $this->setModulo(571, 10, 5, 2, 0); - $this->setCoefficients( - '000000000000000000000000000000000000000000000000000000000000000000000000' . - '000000000000000000000000000000000000000000000000000000000000000000000000', - '000000000000000000000000000000000000000000000000000000000000000000000000' . - '000000000000000000000000000000000000000000000000000000000000000000000001' - ); - $this->setBasePoint( - '026EB7A859923FBC82189631F8103FE4AC9CA2970012D5D46024804801841CA443709584' . - '93B205E647DA304DB4CEB08CBBD1BA39494776FB988B47174DCA88C7E2945283A01C8972', - '0349DC807F4FBF374F4AEADE3BCA95314DD58CEC9F307A54FFC61EFC006D8A2C9D4979C0' . - 'AC44AEA74FBEBBB9F772AEDCB620B01A7BA7AF1B320430C8591984F601CD4C143EF1C7A3' - ); - $this->setOrder(new BigInteger( - '020000000000000000000000000000000000000000000000000000000000000000000000' . - '131850E1F19A63E4B391A8DB917F4138B630D84BE5D639381E91DEB45CFE778F637C1001', 16 - )); - } -} + + * @copyright 2017 Jim Wigginton + * @license http://www.opensource.org/licenses/mit-license.html MIT License + * @link http://pear.php.net/package/Math_BigInteger + */ + +namespace phpseclib3\Crypt\EC\Curves; + +use phpseclib3\Crypt\EC\BaseCurves\Binary; +use phpseclib3\Math\BigInteger; + +class sect571k1 extends Binary +{ + public function __construct() + { + $this->setModulo(571, 10, 5, 2, 0); + $this->setCoefficients( + '000000000000000000000000000000000000000000000000000000000000000000000000' . + '000000000000000000000000000000000000000000000000000000000000000000000000', + '000000000000000000000000000000000000000000000000000000000000000000000000' . + '000000000000000000000000000000000000000000000000000000000000000000000001' + ); + $this->setBasePoint( + '026EB7A859923FBC82189631F8103FE4AC9CA2970012D5D46024804801841CA443709584' . + '93B205E647DA304DB4CEB08CBBD1BA39494776FB988B47174DCA88C7E2945283A01C8972', + '0349DC807F4FBF374F4AEADE3BCA95314DD58CEC9F307A54FFC61EFC006D8A2C9D4979C0' . + 'AC44AEA74FBEBBB9F772AEDCB620B01A7BA7AF1B320430C8591984F601CD4C143EF1C7A3' + ); + $this->setOrder(new BigInteger( + '020000000000000000000000000000000000000000000000000000000000000000000000' . + '131850E1F19A63E4B391A8DB917F4138B630D84BE5D639381E91DEB45CFE778F637C1001', 16 + )); + } +} diff --git a/phpseclib/Crypt/EC/Curves/sect571r1.php b/phpseclib/Crypt/EC/Curves/sect571r1.php index 6aa05062..95239342 100644 --- a/phpseclib/Crypt/EC/Curves/sect571r1.php +++ b/phpseclib/Crypt/EC/Curves/sect571r1.php @@ -1,43 +1,43 @@ - - * @copyright 2017 Jim Wigginton - * @license http://www.opensource.org/licenses/mit-license.html MIT License - * @link http://pear.php.net/package/Math_BigInteger - */ - -namespace phpseclib\Crypt\EC\Curves; - -use phpseclib\Crypt\EC\BaseCurves\Binary; -use phpseclib\Math\BigInteger; - -class sect571r1 extends Binary -{ - public function __construct() - { - $this->setModulo(571, 10, 5, 2, 0); - $this->setCoefficients( - '000000000000000000000000000000000000000000000000000000000000000000000000' . - '000000000000000000000000000000000000000000000000000000000000000000000001', - '02F40E7E2221F295DE297117B7F3D62F5C6A97FFCB8CEFF1CD6BA8CE4A9A18AD84FFABBD' . - '8EFA59332BE7AD6756A66E294AFD185A78FF12AA520E4DE739BACA0C7FFEFF7F2955727A' - ); - $this->setBasePoint( - '0303001D34B856296C16C0D40D3CD7750A93D1D2955FA80AA5F40FC8DB7B2ABDBDE53950' . - 'F4C0D293CDD711A35B67FB1499AE60038614F1394ABFA3B4C850D927E1E7769C8EEC2D19', - '037BF27342DA639B6DCCFFFEB73D69D78C6C27A6009CBBCA1980F8533921E8A684423E43' . - 'BAB08A576291AF8F461BB2A8B3531D2F0485C19B16E2F1516E23DD3C1A4827AF1B8AC15B' - ); - $this->setOrder(new BigInteger( - '03FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF' . - 'E661CE18FF55987308059B186823851EC7DD9CA1161DE93D5174D66E8382E9BB2FE84E47', 16 - )); - } -} + + * @copyright 2017 Jim Wigginton + * @license http://www.opensource.org/licenses/mit-license.html MIT License + * @link http://pear.php.net/package/Math_BigInteger + */ + +namespace phpseclib3\Crypt\EC\Curves; + +use phpseclib3\Crypt\EC\BaseCurves\Binary; +use phpseclib3\Math\BigInteger; + +class sect571r1 extends Binary +{ + public function __construct() + { + $this->setModulo(571, 10, 5, 2, 0); + $this->setCoefficients( + '000000000000000000000000000000000000000000000000000000000000000000000000' . + '000000000000000000000000000000000000000000000000000000000000000000000001', + '02F40E7E2221F295DE297117B7F3D62F5C6A97FFCB8CEFF1CD6BA8CE4A9A18AD84FFABBD' . + '8EFA59332BE7AD6756A66E294AFD185A78FF12AA520E4DE739BACA0C7FFEFF7F2955727A' + ); + $this->setBasePoint( + '0303001D34B856296C16C0D40D3CD7750A93D1D2955FA80AA5F40FC8DB7B2ABDBDE53950' . + 'F4C0D293CDD711A35B67FB1499AE60038614F1394ABFA3B4C850D927E1E7769C8EEC2D19', + '037BF27342DA639B6DCCFFFEB73D69D78C6C27A6009CBBCA1980F8533921E8A684423E43' . + 'BAB08A576291AF8F461BB2A8B3531D2F0485C19B16E2F1516E23DD3C1A4827AF1B8AC15B' + ); + $this->setOrder(new BigInteger( + '03FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF' . + 'E661CE18FF55987308059B186823851EC7DD9CA1161DE93D5174D66E8382E9BB2FE84E47', 16 + )); + } +} diff --git a/phpseclib/Crypt/EC/Formats/Keys/Common.php b/phpseclib/Crypt/EC/Formats/Keys/Common.php index f158a8e5..1993002f 100644 --- a/phpseclib/Crypt/EC/Formats/Keys/Common.php +++ b/phpseclib/Crypt/EC/Formats/Keys/Common.php @@ -13,19 +13,19 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt\EC\Formats\Keys; +namespace phpseclib3\Crypt\EC\Formats\Keys; use ParagonIE\ConstantTime\Hex; -use phpseclib\Crypt\EC\BaseCurves\Base as BaseCurve; -use phpseclib\Crypt\EC\BaseCurves\Prime as PrimeCurve; -use phpseclib\Crypt\EC\BaseCurves\Binary as BinaryCurve; -use phpseclib\Crypt\EC\BaseCurves\TwistedEdwards as TwistedEdwardsCurve; -use phpseclib\Common\Functions\Strings; -use phpseclib\Math\BigInteger; -use phpseclib\Math\PrimeField; -use phpseclib\File\ASN1; -use phpseclib\File\ASN1\Maps; -use phpseclib\Exception\UnsupportedCurveException; +use phpseclib3\Crypt\EC\BaseCurves\Base as BaseCurve; +use phpseclib3\Crypt\EC\BaseCurves\Prime as PrimeCurve; +use phpseclib3\Crypt\EC\BaseCurves\Binary as BinaryCurve; +use phpseclib3\Crypt\EC\BaseCurves\TwistedEdwards as TwistedEdwardsCurve; +use phpseclib3\Common\Functions\Strings; +use phpseclib3\Math\BigInteger; +use phpseclib3\Math\PrimeField; +use phpseclib3\File\ASN1; +use phpseclib3\File\ASN1\Maps; +use phpseclib3\Exception\UnsupportedCurveException; /** * Generic EC Key Parsing Helper functions @@ -189,7 +189,7 @@ trait Common * If the key contains an implicit curve phpseclib needs the curve * to be explicitly provided * - * @param \phpseclib\Crypt\EC\BaseCurves\Base $curve + * @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve */ public static function setImplicitCurve(BaseCurve $curve) { @@ -197,11 +197,11 @@ trait Common } /** - * Returns an instance of \phpseclib\Crypt\EC\BaseCurves\Base based + * Returns an instance of \phpseclib3\Crypt\EC\BaseCurves\Base based * on the curve parameters * * @param array $params - * @return \phpseclib\Crypt\EC\BaseCurves\Base|false + * @return \phpseclib3\Crypt\EC\BaseCurves\Base|false */ protected static function loadCurveByParam(array $params) { @@ -209,7 +209,7 @@ trait Common throw new \RuntimeException('No parameters are present'); } if (isset($params['namedCurve'])) { - $curve = '\phpseclib\Crypt\EC\Curves\\' . $params['namedCurve']; + $curve = '\phpseclib3\Crypt\EC\Curves\\' . $params['namedCurve']; if (!class_exists($curve)) { throw new UnsupportedCurveException('Named Curve of ' . $params['namedCurve'] . ' is not supported'); } @@ -275,7 +275,7 @@ trait Common * Supports both compressed and uncompressed points * * @param string $str - * @param \phpseclib\Crypt\EC\BaseCurves\Base $curve + * @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve * @return object[] */ public static function extractPoint($str, BaseCurve $curve) @@ -341,7 +341,7 @@ trait Common * Encode Parameters * * @todo Maybe at some point this could be moved to __toString() for each of the curves? - * @param \phpseclib\Crypt\EC\BaseCurves\Base $curve + * @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve * @param bool $returnArray optional * @param array $options optional * @return string|false @@ -367,7 +367,7 @@ trait Common continue; } $testName = $file->getBasename('.php'); - $class = 'phpseclib\Crypt\EC\Curves\\' . $testName; + $class = 'phpseclib3\Crypt\EC\Curves\\' . $testName; $reflect = new \ReflectionClass($class); if ($reflect->isFinal()) { continue; diff --git a/phpseclib/Crypt/EC/Formats/Keys/MontgomeryPrivate.php b/phpseclib/Crypt/EC/Formats/Keys/MontgomeryPrivate.php index 7ce0a49f..b908adc1 100644 --- a/phpseclib/Crypt/EC/Formats/Keys/MontgomeryPrivate.php +++ b/phpseclib/Crypt/EC/Formats/Keys/MontgomeryPrivate.php @@ -20,13 +20,13 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt\EC\Formats\Keys; +namespace phpseclib3\Crypt\EC\Formats\Keys; -use phpseclib\Crypt\EC\Curves\Curve25519; -use phpseclib\Crypt\EC\Curves\Curve448; -use phpseclib\Crypt\EC\BaseCurves\Montgomery as MontgomeryCurve; -use phpseclib\Math\Common\FiniteField\Integer; -use phpseclib\Math\BigInteger; +use phpseclib3\Crypt\EC\Curves\Curve25519; +use phpseclib3\Crypt\EC\Curves\Curve448; +use phpseclib3\Crypt\EC\BaseCurves\Montgomery as MontgomeryCurve; +use phpseclib3\Math\Common\FiniteField\Integer; +use phpseclib3\Math\BigInteger; /** * Montgomery Curve Private Key Handler @@ -77,8 +77,8 @@ abstract class MontgomeryPrivate * Convert an EC public key to the appropriate format * * @access public - * @param \phpseclib\Crypt\EC\Curves\MontgomeryCurve $curve - * @param \phpseclib\Math\Common\FiniteField\Integer[] $publicKey + * @param \phpseclib3\Crypt\EC\Curves\MontgomeryCurve $curve + * @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey * @return string */ public static function savePublicKey(MontgomeryCurve $curve, array $publicKey) @@ -90,9 +90,9 @@ abstract class MontgomeryPrivate * Convert a private key to the appropriate format. * * @access public - * @param \phpseclib\Math\Common\FiniteField\Integer $privateKey - * @param \phpseclib\Crypt\EC\Curves\Montgomery $curve - * @param \phpseclib\Math\Common\FiniteField\Integer[] $publicKey + * @param \phpseclib3\Math\Common\FiniteField\Integer $privateKey + * @param \phpseclib3\Crypt\EC\Curves\Montgomery $curve + * @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey * @param string $password optional * @return string */ diff --git a/phpseclib/Crypt/EC/Formats/Keys/MontgomeryPublic.php b/phpseclib/Crypt/EC/Formats/Keys/MontgomeryPublic.php index 35f2b5b9..9a49ea23 100644 --- a/phpseclib/Crypt/EC/Formats/Keys/MontgomeryPublic.php +++ b/phpseclib/Crypt/EC/Formats/Keys/MontgomeryPublic.php @@ -13,13 +13,13 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt\EC\Formats\Keys; +namespace phpseclib3\Crypt\EC\Formats\Keys; -use phpseclib\Crypt\EC\Curves\Curve25519; -use phpseclib\Crypt\EC\Curves\Curve448; -use phpseclib\Crypt\EC\BaseCurves\Montgomery as MontgomeryCurve; -use phpseclib\Math\Common\FiniteField\Integer; -use phpseclib\Math\BigInteger; +use phpseclib3\Crypt\EC\Curves\Curve25519; +use phpseclib3\Crypt\EC\Curves\Curve448; +use phpseclib3\Crypt\EC\BaseCurves\Montgomery as MontgomeryCurve; +use phpseclib3\Math\Common\FiniteField\Integer; +use phpseclib3\Math\BigInteger; /** * Montgomery Public Key Handler @@ -68,8 +68,8 @@ abstract class MontgomeryPublic * Convert an EC public key to the appropriate format * * @access public - * @param \phpseclib\Crypt\EC\Curves\Montgomery $curve - * @param \phpseclib\Math\Common\FiniteField\Integer[] $publicKey + * @param \phpseclib3\Crypt\EC\Curves\Montgomery $curve + * @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey * @return string */ public static function savePublicKey(MontgomeryCurve $curve, array $publicKey) diff --git a/phpseclib/Crypt/EC/Formats/Keys/OpenSSH.php b/phpseclib/Crypt/EC/Formats/Keys/OpenSSH.php index ee8a60d8..aef216f9 100644 --- a/phpseclib/Crypt/EC/Formats/Keys/OpenSSH.php +++ b/phpseclib/Crypt/EC/Formats/Keys/OpenSSH.php @@ -15,16 +15,16 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt\EC\Formats\Keys; +namespace phpseclib3\Crypt\EC\Formats\Keys; use ParagonIE\ConstantTime\Base64; -use phpseclib\Math\BigInteger; -use phpseclib\Common\Functions\Strings; -use phpseclib\Crypt\Common\Formats\Keys\OpenSSH as Progenitor; -use phpseclib\Crypt\EC\BaseCurves\Base as BaseCurve; -use phpseclib\Exception\UnsupportedCurveException; -use phpseclib\Crypt\EC\Curves\Ed25519; -use phpseclib\Math\Common\FiniteField\Integer; +use phpseclib3\Math\BigInteger; +use phpseclib3\Common\Functions\Strings; +use phpseclib3\Crypt\Common\Formats\Keys\OpenSSH as Progenitor; +use phpseclib3\Crypt\EC\BaseCurves\Base as BaseCurve; +use phpseclib3\Exception\UnsupportedCurveException; +use phpseclib3\Crypt\EC\Curves\Ed25519; +use phpseclib3\Math\Common\FiniteField\Integer; /** * OpenSSH Formatted EC Key Handler @@ -92,7 +92,7 @@ abstract class OpenSSH extends Progenitor $qa = self::extractPoint($parsed['publicKey'], $curve); } else { list($curveName, $publicKey) = Strings::unpackSSH2('ss', $parsed['publicKey']); - $curveName = '\phpseclib\Crypt\EC\Curves\\' . $curveName; + $curveName = '\phpseclib3\Crypt\EC\Curves\\' . $curveName; $curve = new $curveName(); $qa = self::extractPoint("\0" . $publicKey, $curve); @@ -141,8 +141,8 @@ abstract class OpenSSH extends Progenitor * Convert an EC public key to the appropriate format * * @access public - * @param \phpseclib\Crypt\EC\BaseCurves\Base $curve - * @param \phpseclib\Math\Common\FiniteField\Integer[] $publicKey + * @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve + * @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey * @param array $options optional * @return string */ @@ -179,9 +179,9 @@ abstract class OpenSSH extends Progenitor * Convert a private key to the appropriate format. * * @access public - * @param \phpseclib\Math\Common\FiniteField\Integer $privateKey - * @param \phpseclib\Crypt\EC\Curves\Ed25519 $curve - * @param \phpseclib\Math\Common\FiniteField\Integer[] $publicKey + * @param \phpseclib3\Math\Common\FiniteField\Integer $privateKey + * @param \phpseclib3\Crypt\EC\Curves\Ed25519 $curve + * @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey * @param string $password optional * @param array $options optional * @return string diff --git a/phpseclib/Crypt/EC/Formats/Keys/PKCS1.php b/phpseclib/Crypt/EC/Formats/Keys/PKCS1.php index 76af302f..6c4a02c1 100644 --- a/phpseclib/Crypt/EC/Formats/Keys/PKCS1.php +++ b/phpseclib/Crypt/EC/Formats/Keys/PKCS1.php @@ -25,18 +25,18 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt\EC\Formats\Keys; +namespace phpseclib3\Crypt\EC\Formats\Keys; -use phpseclib\Math\Common\FiniteField\Integer; -use phpseclib\Crypt\Common\Formats\Keys\PKCS1 as Progenitor; -use phpseclib\File\ASN1; -use phpseclib\File\ASN1\Maps; -use phpseclib\Crypt\EC\BaseCurves\Base as BaseCurve; -use phpseclib\Math\BigInteger; +use phpseclib3\Math\Common\FiniteField\Integer; +use phpseclib3\Crypt\Common\Formats\Keys\PKCS1 as Progenitor; +use phpseclib3\File\ASN1; +use phpseclib3\File\ASN1\Maps; +use phpseclib3\Crypt\EC\BaseCurves\Base as BaseCurve; +use phpseclib3\Math\BigInteger; use ParagonIE\ConstantTime\Base64; -use phpseclib\Crypt\EC\BaseCurves\TwistedEdwards as TwistedEdwardsCurve; -use phpseclib\Crypt\EC\BaseCurves\Montgomery as MontgomeryCurve; -use phpseclib\Exception\UnsupportedCurveException; +use phpseclib3\Crypt\EC\BaseCurves\TwistedEdwards as TwistedEdwardsCurve; +use phpseclib3\Crypt\EC\BaseCurves\Montgomery as MontgomeryCurve; +use phpseclib3\Exception\UnsupportedCurveException; /** * "PKCS1" (RFC5915) Formatted EC Key Handler @@ -112,9 +112,9 @@ abstract class PKCS1 extends Progenitor * Convert a private key to the appropriate format. * * @access public - * @param \phpseclib\Math\Common\FiniteField\Integer $privateKey - * @param \phpseclib\Crypt\EC\BaseCurves\Base $curve - * @param \phpseclib\Math\Common\FiniteField\Integer[] $publicKey + * @param \phpseclib3\Math\Common\FiniteField\Integer $privateKey + * @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve + * @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey * @param string $password optional * @param array $options optional * @return string diff --git a/phpseclib/Crypt/EC/Formats/Keys/PKCS8.php b/phpseclib/Crypt/EC/Formats/Keys/PKCS8.php index d031454d..b678545e 100644 --- a/phpseclib/Crypt/EC/Formats/Keys/PKCS8.php +++ b/phpseclib/Crypt/EC/Formats/Keys/PKCS8.php @@ -23,19 +23,19 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt\EC\Formats\Keys; +namespace phpseclib3\Crypt\EC\Formats\Keys; -use phpseclib\Math\BigInteger; -use phpseclib\Crypt\Common\Formats\Keys\PKCS8 as Progenitor; -use phpseclib\File\ASN1; -use phpseclib\File\ASN1\Maps; -use phpseclib\Crypt\EC\BaseCurves\Base as BaseCurve; -use phpseclib\Crypt\EC\BaseCurves\TwistedEdwards as TwistedEdwardsCurve; -use phpseclib\Crypt\EC\BaseCurves\Montgomery as MontgomeryCurve; -use phpseclib\Math\Common\FiniteField\Integer; -use phpseclib\Crypt\EC\Curves\Ed25519; -use phpseclib\Crypt\EC\Curves\Ed448; -use phpseclib\Exception\UnsupportedCurveException; +use phpseclib3\Math\BigInteger; +use phpseclib3\Crypt\Common\Formats\Keys\PKCS8 as Progenitor; +use phpseclib3\File\ASN1; +use phpseclib3\File\ASN1\Maps; +use phpseclib3\Crypt\EC\BaseCurves\Base as BaseCurve; +use phpseclib3\Crypt\EC\BaseCurves\TwistedEdwards as TwistedEdwardsCurve; +use phpseclib3\Crypt\EC\BaseCurves\Montgomery as MontgomeryCurve; +use phpseclib3\Math\Common\FiniteField\Integer; +use phpseclib3\Crypt\EC\Curves\Ed25519; +use phpseclib3\Crypt\EC\Curves\Ed448; +use phpseclib3\Exception\UnsupportedCurveException; /** * PKCS#8 Formatted EC Key Handler @@ -169,8 +169,8 @@ abstract class PKCS8 extends Progenitor * Convert an EC public key to the appropriate format * * @access public - * @param \phpseclib\Crypt\EC\BaseCurves\Base $curve - * @param \phpseclib\Math\Common\FiniteField\Integer[] $publicKey + * @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve + * @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey * @param array $optiona optional * @return string */ @@ -201,9 +201,9 @@ abstract class PKCS8 extends Progenitor * Convert a private key to the appropriate format. * * @access public - * @param \phpseclib\Math\Common\FiniteField\Integer $privateKey - * @param \phpseclib\Crypt\EC\BaseCurves\Base $curve - * @param \phpseclib\Math\Common\FiniteField\Integer[] $publicKey + * @param \phpseclib3\Math\Common\FiniteField\Integer $privateKey + * @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve + * @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey * @param string $password optional * @param array $options optional * @return string diff --git a/phpseclib/Crypt/EC/Formats/Keys/PuTTY.php b/phpseclib/Crypt/EC/Formats/Keys/PuTTY.php index 2ee49750..181ab76c 100644 --- a/phpseclib/Crypt/EC/Formats/Keys/PuTTY.php +++ b/phpseclib/Crypt/EC/Formats/Keys/PuTTY.php @@ -13,15 +13,15 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt\EC\Formats\Keys; +namespace phpseclib3\Crypt\EC\Formats\Keys; use ParagonIE\ConstantTime\Base64; -use phpseclib\Math\BigInteger; -use phpseclib\Common\Functions\Strings; -use phpseclib\Crypt\Common\Formats\Keys\PuTTY as Progenitor; -use phpseclib\Crypt\EC\BaseCurves\Base as BaseCurve; -use phpseclib\Math\Common\FiniteField\Integer; -use phpseclib\Crypt\EC\BaseCurves\TwistedEdwards as TwistedEdwardsCurve; +use phpseclib3\Math\BigInteger; +use phpseclib3\Common\Functions\Strings; +use phpseclib3\Crypt\Common\Formats\Keys\PuTTY as Progenitor; +use phpseclib3\Crypt\EC\BaseCurves\Base as BaseCurve; +use phpseclib3\Math\Common\FiniteField\Integer; +use phpseclib3\Crypt\EC\BaseCurves\TwistedEdwards as TwistedEdwardsCurve; /** * PuTTY Formatted EC Key Handler @@ -40,7 +40,7 @@ abstract class PuTTY extends Progenitor * @var string * @access private */ - const PUBLIC_HANDLER = 'phpseclib\Crypt\EC\Formats\Keys\OpenSSH'; + const PUBLIC_HANDLER = 'phpseclib3\Crypt\EC\Formats\Keys\OpenSSH'; /** * Supported Key Types @@ -92,9 +92,9 @@ abstract class PuTTY extends Progenitor * Convert a private key to the appropriate format. * * @access public - * @param \phpseclib\Math\Common\FiniteField\Integer $privateKey - * @param \phpseclib\Crypt\EC\BaseCurves\Base $curve - * @param \phpseclib\Math\Common\FiniteField\Integer[] $publicKey + * @param \phpseclib3\Math\Common\FiniteField\Integer $privateKey + * @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve + * @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey * @param string $password optional * @param array $options optional * @return string @@ -129,8 +129,8 @@ abstract class PuTTY extends Progenitor * Convert an EC public key to the appropriate format * * @access public - * @param \phpseclib\Crypt\EC\BaseCurves\Base $curve - * @param \phpseclib\Math\Common\FiniteField[] $publicKey + * @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve + * @param \phpseclib3\Math\Common\FiniteField[] $publicKey * @return string */ public static function savePublicKey(BaseCurve $curve, array $publicKey) diff --git a/phpseclib/Crypt/EC/Formats/Keys/XML.php b/phpseclib/Crypt/EC/Formats/Keys/XML.php index 5d2c370c..0bfd81e1 100644 --- a/phpseclib/Crypt/EC/Formats/Keys/XML.php +++ b/phpseclib/Crypt/EC/Formats/Keys/XML.php @@ -18,15 +18,15 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt\EC\Formats\Keys; +namespace phpseclib3\Crypt\EC\Formats\Keys; use ParagonIE\ConstantTime\Base64; -use phpseclib\Math\BigInteger; -use phpseclib\Crypt\EC\BaseCurves\Base as BaseCurve; -use phpseclib\Crypt\EC\BaseCurves\Prime as PrimeCurve; -use phpseclib\Crypt\EC\BaseCurves\TwistedEdwards as TwistedEdwardsCurve; -use phpseclib\Crypt\EC\BaseCurves\Montgomery as MontgomeryCurve; -use phpseclib\Exception\UnsupportedCurveException; +use phpseclib3\Math\BigInteger; +use phpseclib3\Crypt\EC\BaseCurves\Base as BaseCurve; +use phpseclib3\Crypt\EC\BaseCurves\Prime as PrimeCurve; +use phpseclib3\Crypt\EC\BaseCurves\TwistedEdwards as TwistedEdwardsCurve; +use phpseclib3\Crypt\EC\BaseCurves\Montgomery as MontgomeryCurve; +use phpseclib3\Exception\UnsupportedCurveException; /** * XML Formatted EC Key Handler @@ -169,7 +169,7 @@ abstract class XML * Extract points from an XML document * * @param \DOMXPath $xpath - * @param \phpseclib\Crypt\EC\BaseCurves\Base $curve + * @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve * @return object[] */ private static function extractPointRFC4050(\DOMXPath $xpath, BaseCurve $curve) @@ -193,11 +193,11 @@ abstract class XML } /** - * Returns an instance of \phpseclib\Crypt\EC\BaseCurves\Base based + * Returns an instance of \phpseclib3\Crypt\EC\BaseCurves\Base based * on the curve parameters * * @param \DomXPath $xpath - * @return \phpseclib\Crypt\EC\BaseCurves\Base|false + * @return \phpseclib3\Crypt\EC\BaseCurves\Base|false */ private static function loadCurveByParam(\DOMXPath $xpath) { @@ -210,7 +210,7 @@ abstract class XML throw new UnsupportedCurveException('Curve with OID of ' . $oid . ' is not supported'); } - $curve = '\phpseclib\Crypt\EC\Curves\\' . $name; + $curve = '\phpseclib3\Crypt\EC\Curves\\' . $name; if (!class_exists($curve)) { throw new UnsupportedCurveException('Named Curve of ' . $name . ' is not supported'); } @@ -273,11 +273,11 @@ abstract class XML } /** - * Returns an instance of \phpseclib\Crypt\EC\BaseCurves\Base based + * Returns an instance of \phpseclib3\Crypt\EC\BaseCurves\Base based * on the curve parameters * * @param \DomXPath $xpath - * @return \phpseclib\Crypt\EC\BaseCurves\Base|false + * @return \phpseclib3\Crypt\EC\BaseCurves\Base|false */ private static function loadCurveByParamRFC4050(\DOMXPath $xpath) { @@ -364,8 +364,8 @@ abstract class XML /** * Convert a public key to the appropriate format * - * @param \phpseclib\Crypt\EC\BaseCurves\Base $curve - * @param \phpseclib\Math\Common\FiniteField\Integer[] $publicKey + * @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve + * @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey * @param array $options optional * @return string */ @@ -405,7 +405,7 @@ abstract class XML /** * Encode Parameters * - * @param \phpseclib\Crypt\EC\BaseCurves\Base $curve + * @param \phpseclib3\Crypt\EC\BaseCurves\Base $curve * @param string $pre * @param array $options optional * @return string|false diff --git a/phpseclib/Crypt/EC/Formats/Keys/libsodium.php b/phpseclib/Crypt/EC/Formats/Keys/libsodium.php index 2ddf0198..8b7f6f7d 100644 --- a/phpseclib/Crypt/EC/Formats/Keys/libsodium.php +++ b/phpseclib/Crypt/EC/Formats/Keys/libsodium.php @@ -17,10 +17,10 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt\EC\Formats\Keys; +namespace phpseclib3\Crypt\EC\Formats\Keys; -use phpseclib\Crypt\EC\Curves\Ed25519; -use phpseclib\Math\Common\FiniteField\Integer; +use phpseclib3\Crypt\EC\Curves\Ed25519; +use phpseclib3\Math\Common\FiniteField\Integer; /** * libsodium Key Handler @@ -86,8 +86,8 @@ abstract class libsodium * Convert an EC public key to the appropriate format * * @access public - * @param \phpseclib\Crypt\EC\Curves\Ed25519 $curve - * @param \phpseclib\Math\Common\FiniteField\Integer[] $publicKey + * @param \phpseclib3\Crypt\EC\Curves\Ed25519 $curve + * @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey * @return string */ public static function savePublicKey(Ed25519 $curve, array $publicKey) @@ -99,9 +99,9 @@ abstract class libsodium * Convert a private key to the appropriate format. * * @access public - * @param \phpseclib\Math\Common\FiniteField\Integer $privateKey - * @param \phpseclib\Crypt\EC\Curves\Ed25519 $curve - * @param \phpseclib\Math\Common\FiniteField\Integer[] $publicKey + * @param \phpseclib3\Math\Common\FiniteField\Integer $privateKey + * @param \phpseclib3\Crypt\EC\Curves\Ed25519 $curve + * @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey * @param string $password optional * @return string */ diff --git a/phpseclib/Crypt/EC/Formats/Signature/ASN1.php b/phpseclib/Crypt/EC/Formats/Signature/ASN1.php index c212c358..d3e1b767 100644 --- a/phpseclib/Crypt/EC/Formats/Signature/ASN1.php +++ b/phpseclib/Crypt/EC/Formats/Signature/ASN1.php @@ -16,11 +16,11 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt\EC\Formats\Signature; +namespace phpseclib3\Crypt\EC\Formats\Signature; -use phpseclib\Math\BigInteger; -use phpseclib\File\ASN1 as Encoder; -use phpseclib\File\ASN1\Maps\EcdsaSigValue; +use phpseclib3\Math\BigInteger; +use phpseclib3\File\ASN1 as Encoder; +use phpseclib3\File\ASN1\Maps\EcdsaSigValue; /** * ASN1 Signature Handler @@ -57,8 +57,8 @@ abstract class ASN1 * Returns a signature in the appropriate format * * @access public - * @param \phpseclib\Math\BigInteger $r - * @param \phpseclib\Math\BigInteger $s + * @param \phpseclib3\Math\BigInteger $r + * @param \phpseclib3\Math\BigInteger $s * @return string */ public static function save(BigInteger $r, BigInteger $s) diff --git a/phpseclib/Crypt/EC/Formats/Signature/Raw.php b/phpseclib/Crypt/EC/Formats/Signature/Raw.php index b4c06c31..eebef46b 100644 --- a/phpseclib/Crypt/EC/Formats/Signature/Raw.php +++ b/phpseclib/Crypt/EC/Formats/Signature/Raw.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt\EC\Formats\Signature; +namespace phpseclib3\Crypt\EC\Formats\Signature; -use phpseclib\Crypt\Common\Formats\Signature\Raw as Progenitor; +use phpseclib3\Crypt\Common\Formats\Signature\Raw as Progenitor; /** * Raw DSA Signature Handler diff --git a/phpseclib/Crypt/EC/Formats/Signature/SSH2.php b/phpseclib/Crypt/EC/Formats/Signature/SSH2.php index 7e1f5770..261100db 100644 --- a/phpseclib/Crypt/EC/Formats/Signature/SSH2.php +++ b/phpseclib/Crypt/EC/Formats/Signature/SSH2.php @@ -15,10 +15,10 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt\EC\Formats\Signature; +namespace phpseclib3\Crypt\EC\Formats\Signature; -use phpseclib\Math\BigInteger; -use phpseclib\Common\Functions\Strings; +use phpseclib3\Math\BigInteger; +use phpseclib3\Common\Functions\Strings; /** * SSH2 Signature Handler @@ -72,8 +72,8 @@ abstract class SSH2 * Returns a signature in the appropriate format * * @access public - * @param \phpseclib\Math\BigInteger $r - * @param \phpseclib\Math\BigInteger $s + * @param \phpseclib3\Math\BigInteger $r + * @param \phpseclib3\Math\BigInteger $s * @param string $curve * @return string */ diff --git a/phpseclib/Crypt/EC/Parameters.php b/phpseclib/Crypt/EC/Parameters.php index 0bff2efc..96527c75 100644 --- a/phpseclib/Crypt/EC/Parameters.php +++ b/phpseclib/Crypt/EC/Parameters.php @@ -11,9 +11,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt\EC; +namespace phpseclib3\Crypt\EC; -use phpseclib\Crypt\EC; +use phpseclib3\Crypt\EC; /** * EC Parameters diff --git a/phpseclib/Crypt/EC/PrivateKey.php b/phpseclib/Crypt/EC/PrivateKey.php index 4c22a6ed..887fec46 100644 --- a/phpseclib/Crypt/EC/PrivateKey.php +++ b/phpseclib/Crypt/EC/PrivateKey.php @@ -11,19 +11,19 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt\EC; +namespace phpseclib3\Crypt\EC; -use phpseclib\Crypt\EC; -use phpseclib\Crypt\EC\Formats\Signature\ASN1 as ASN1Signature; -use phpseclib\Math\BigInteger; -use phpseclib\Crypt\EC\BaseCurves\TwistedEdwards as TwistedEdwardsCurve; -use phpseclib\Crypt\EC\BaseCurves\Montgomery as MontgomeryCurve; -use phpseclib\Crypt\Hash; -use phpseclib\Crypt\EC\Curves\Ed25519; -use phpseclib\Crypt\EC\Curves\Curve25519; -use phpseclib\Crypt\EC\Formats\Keys\PKCS1; -use phpseclib\Crypt\Common; -use phpseclib\Exception\UnsupportedOperationException; +use phpseclib3\Crypt\EC; +use phpseclib3\Crypt\EC\Formats\Signature\ASN1 as ASN1Signature; +use phpseclib3\Math\BigInteger; +use phpseclib3\Crypt\EC\BaseCurves\TwistedEdwards as TwistedEdwardsCurve; +use phpseclib3\Crypt\EC\BaseCurves\Montgomery as MontgomeryCurve; +use phpseclib3\Crypt\Hash; +use phpseclib3\Crypt\EC\Curves\Ed25519; +use phpseclib3\Crypt\EC\Curves\Curve25519; +use phpseclib3\Crypt\EC\Formats\Keys\PKCS1; +use phpseclib3\Crypt\Common; +use phpseclib3\Exception\UnsupportedOperationException; /** * EC Private Key diff --git a/phpseclib/Crypt/EC/PublicKey.php b/phpseclib/Crypt/EC/PublicKey.php index d88dc1bb..d627b282 100644 --- a/phpseclib/Crypt/EC/PublicKey.php +++ b/phpseclib/Crypt/EC/PublicKey.php @@ -11,18 +11,18 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt\EC; +namespace phpseclib3\Crypt\EC; -use phpseclib\Crypt\EC; -use phpseclib\Crypt\Hash; -use phpseclib\Math\BigInteger; -use phpseclib\Crypt\EC\Formats\Signature\ASN1 as ASN1Signature; -use phpseclib\Crypt\EC\BaseCurves\TwistedEdwards as TwistedEdwardsCurve; -use phpseclib\Crypt\EC\BaseCurves\Montgomery as MontgomeryCurve; -use phpseclib\Crypt\EC\Curves\Ed25519; -use phpseclib\Crypt\EC\Formats\Keys\PKCS1; -use phpseclib\Crypt\Common; -use phpseclib\Exception\UnsupportedOperationException; +use phpseclib3\Crypt\EC; +use phpseclib3\Crypt\Hash; +use phpseclib3\Math\BigInteger; +use phpseclib3\Crypt\EC\Formats\Signature\ASN1 as ASN1Signature; +use phpseclib3\Crypt\EC\BaseCurves\TwistedEdwards as TwistedEdwardsCurve; +use phpseclib3\Crypt\EC\BaseCurves\Montgomery as MontgomeryCurve; +use phpseclib3\Crypt\EC\Curves\Ed25519; +use phpseclib3\Crypt\EC\Formats\Keys\PKCS1; +use phpseclib3\Crypt\Common; +use phpseclib3\Exception\UnsupportedOperationException; /** * EC Public Key diff --git a/phpseclib/Crypt/Hash.php b/phpseclib/Crypt/Hash.php index 41615317..6c91dcd1 100644 --- a/phpseclib/Crypt/Hash.php +++ b/phpseclib/Crypt/Hash.php @@ -13,7 +13,7 @@ * setKey('abcdefg'); * @@ -31,14 +31,14 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt; +namespace phpseclib3\Crypt; -use phpseclib\Math\BigInteger; -use phpseclib\Exception\UnsupportedAlgorithmException; -use phpseclib\Exception\InsufficientSetupException; -use phpseclib\Common\Functions\Strings; -use phpseclib\Crypt\AES; -use phpseclib\Math\PrimeField; +use phpseclib3\Math\BigInteger; +use phpseclib3\Exception\UnsupportedAlgorithmException; +use phpseclib3\Exception\InsufficientSetupException; +use phpseclib3\Common\Functions\Strings; +use phpseclib3\Crypt\AES; +use phpseclib3\Math\PrimeField; /** * @package Hash @@ -167,7 +167,7 @@ class Hash * umac cipher object * * @see self::hash() - * @var \phpseclib\Crypt\AES + * @var \phpseclib3\Crypt\AES * @access private */ private $c; @@ -404,7 +404,7 @@ class Hash 'length' => $this->length, 'padding' => $this->paddingType ]; - $hash = ['phpseclib\Crypt\Hash', PHP_INT_SIZE == 8 ? 'sha3_64' : 'sha3_32']; + $hash = ['phpseclib3\Crypt\Hash', PHP_INT_SIZE == 8 ? 'sha3_64' : 'sha3_32']; } } @@ -429,7 +429,7 @@ class Hash $this->parameters = compact('initial'); - $hash = ['phpseclib\Crypt\Hash', 'sha512']; + $hash = ['phpseclib3\Crypt\Hash', 'sha512']; } } @@ -1455,7 +1455,7 @@ class Hash } // Produce the final hash value (big-endian) - // (\phpseclib\Crypt\Hash::hash() trims the output for hashes but not for HMACs. as such, we trim the output here) + // (\phpseclib3\Crypt\Hash::hash() trims the output for hashes but not for HMACs. as such, we trim the output here) $temp = $hash[0]->toBytes() . $hash[1]->toBytes() . $hash[2]->toBytes() . $hash[3]->toBytes() . $hash[4]->toBytes() . $hash[5]->toBytes() . $hash[6]->toBytes() . $hash[7]->toBytes(); diff --git a/phpseclib/Crypt/PublicKeyLoader.php b/phpseclib/Crypt/PublicKeyLoader.php index a1fdee98..f718d1f5 100644 --- a/phpseclib/Crypt/PublicKeyLoader.php +++ b/phpseclib/Crypt/PublicKeyLoader.php @@ -13,11 +13,11 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt; +namespace phpseclib3\Crypt; -use phpseclib\Exception\NoKeyLoadedException; -use phpseclib\Crypt\Common\PrivateKey; -use phpseclib\File\X509; +use phpseclib3\Exception\NoKeyLoadedException; +use phpseclib3\Crypt\Common\PrivateKey; +use phpseclib3\File\X509; /** * PublicKeyLoader diff --git a/phpseclib/Crypt/RC2.php b/phpseclib/Crypt/RC2.php index 9f4acfce..43f76c40 100644 --- a/phpseclib/Crypt/RC2.php +++ b/phpseclib/Crypt/RC2.php @@ -16,7 +16,7 @@ * setKey('abcdefgh'); * @@ -33,10 +33,10 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt; +namespace phpseclib3\Crypt; -use phpseclib\Crypt\Common\BlockCipher; -use phpseclib\Exception\BadModeException; +use phpseclib3\Crypt\Common\BlockCipher; +use phpseclib3\Exception\BadModeException; /** * Pure-PHP implementation of RC2. @@ -49,7 +49,7 @@ class RC2 extends BlockCipher /** * Block Length of the cipher * - * @see \phpseclib\Crypt\Common\SymmetricKey::block_size + * @see \phpseclib3\Crypt\Common\SymmetricKey::block_size * @var int * @access private */ @@ -58,7 +58,7 @@ class RC2 extends BlockCipher /** * The Key * - * @see \phpseclib\Crypt\Common\SymmetricKey::key + * @see \phpseclib3\Crypt\Common\SymmetricKey::key * @see self::setKey() * @var string * @access private @@ -68,7 +68,7 @@ class RC2 extends BlockCipher /** * The Original (unpadded) Key * - * @see \phpseclib\Crypt\Common\SymmetricKey::key + * @see \phpseclib3\Crypt\Common\SymmetricKey::key * @see self::setKey() * @see self::encrypt() * @see self::decrypt() @@ -80,7 +80,7 @@ class RC2 extends BlockCipher /** * Don't truncate / null pad key * - * @see \phpseclib\Crypt\Common\SymmetricKey::clearBuffers() + * @see \phpseclib3\Crypt\Common\SymmetricKey::clearBuffers() * @var bool * @access private */ @@ -89,7 +89,7 @@ class RC2 extends BlockCipher /** * Key Length (in bytes) * - * @see \phpseclib\Crypt\RC2::setKeyLength() + * @see \phpseclib3\Crypt\RC2::setKeyLength() * @var int * @access private */ @@ -98,7 +98,7 @@ class RC2 extends BlockCipher /** * The mcrypt specific name of the cipher * - * @see \phpseclib\Crypt\Common\SymmetricKey::cipher_name_mcrypt + * @see \phpseclib3\Crypt\Common\SymmetricKey::cipher_name_mcrypt * @var string * @access private */ @@ -107,7 +107,7 @@ class RC2 extends BlockCipher /** * Optimizing value while CFB-encrypting * - * @see \phpseclib\Crypt\Common\SymmetricKey::cfb_init_len + * @see \phpseclib3\Crypt\Common\SymmetricKey::cfb_init_len * @var int * @access private */ @@ -281,9 +281,9 @@ class RC2 extends BlockCipher /** * Test for engine validity * - * This is mainly just a wrapper to set things up for \phpseclib\Crypt\Common\SymmetricKey::isValidEngine() + * This is mainly just a wrapper to set things up for \phpseclib3\Crypt\Common\SymmetricKey::isValidEngine() * - * @see \phpseclib\Crypt\Common\SymmetricKey::__construct() + * @see \phpseclib3\Crypt\Common\SymmetricKey::__construct() * @param int $engine * @access protected * @return bool @@ -307,7 +307,7 @@ class RC2 extends BlockCipher * * Valid key lengths are 8 to 1024. * Calling this function after setting the key has no effect until the next - * \phpseclib\Crypt\RC2::setKey() call. + * \phpseclib3\Crypt\RC2::setKey() call. * * @access public * @param int $length in bits @@ -342,7 +342,7 @@ class RC2 extends BlockCipher * has more then 128 bytes in it, and set $key to a single null byte if * it is empty. * - * @see \phpseclib\Crypt\Common\SymmetricKey::setKey() + * @see \phpseclib3\Crypt\Common\SymmetricKey::setKey() * @access public * @param string $key * @param int|boolean $t1 optional Effective key length in bits. @@ -402,7 +402,7 @@ class RC2 extends BlockCipher /** * Encrypts a message. * - * Mostly a wrapper for \phpseclib\Crypt\Common\SymmetricKey::encrypt, with some additional OpenSSL handling code + * Mostly a wrapper for \phpseclib3\Crypt\Common\SymmetricKey::encrypt, with some additional OpenSSL handling code * * @see self::decrypt() * @access public @@ -425,7 +425,7 @@ class RC2 extends BlockCipher /** * Decrypts a message. * - * Mostly a wrapper for \phpseclib\Crypt\Common\SymmetricKey::decrypt, with some additional OpenSSL handling code + * Mostly a wrapper for \phpseclib3\Crypt\Common\SymmetricKey::decrypt, with some additional OpenSSL handling code * * @see self::encrypt() * @access public @@ -448,8 +448,8 @@ class RC2 extends BlockCipher /** * Encrypts a block * - * @see \phpseclib\Crypt\Common\SymmetricKey::encryptBlock() - * @see \phpseclib\Crypt\Common\SymmetricKey::encrypt() + * @see \phpseclib3\Crypt\Common\SymmetricKey::encryptBlock() + * @see \phpseclib3\Crypt\Common\SymmetricKey::encrypt() * @access private * @param string $in * @return string @@ -493,8 +493,8 @@ class RC2 extends BlockCipher /** * Decrypts a block * - * @see \phpseclib\Crypt\Common\SymmetricKey::decryptBlock() - * @see \phpseclib\Crypt\Common\SymmetricKey::decrypt() + * @see \phpseclib3\Crypt\Common\SymmetricKey::decryptBlock() + * @see \phpseclib3\Crypt\Common\SymmetricKey::decrypt() * @access private * @param string $in * @return string @@ -538,7 +538,7 @@ class RC2 extends BlockCipher /** * Creates the key schedule * - * @see \phpseclib\Crypt\Common\SymmetricKey::setupKey() + * @see \phpseclib3\Crypt\Common\SymmetricKey::setupKey() * @access private */ protected function setupKey() @@ -547,7 +547,7 @@ class RC2 extends BlockCipher $this->setKey(''); } - // Key has already been expanded in \phpseclib\Crypt\RC2::setKey(): + // Key has already been expanded in \phpseclib3\Crypt\RC2::setKey(): // Only the first value must be altered. $l = unpack('Ca/Cb/v*', $this->key); array_unshift($l, self::$pitable[$l['a']] | ($l['b'] << 8)); @@ -559,7 +559,7 @@ class RC2 extends BlockCipher /** * Setup the performance-optimized function for de/encrypt() * - * @see \phpseclib\Crypt\Common\SymmetricKey::setupInlineCrypt() + * @see \phpseclib3\Crypt\Common\SymmetricKey::setupInlineCrypt() * @access private */ protected function setupInlineCrypt() diff --git a/phpseclib/Crypt/RC4.php b/phpseclib/Crypt/RC4.php index c658144a..35efd30a 100644 --- a/phpseclib/Crypt/RC4.php +++ b/phpseclib/Crypt/RC4.php @@ -20,7 +20,7 @@ * setKey('abcdefgh'); * @@ -42,9 +42,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt; +namespace phpseclib3\Crypt; -use phpseclib\Crypt\Common\StreamCipher; +use phpseclib3\Crypt\Common\StreamCipher; /** * Pure-PHP implementation of RC4. @@ -57,7 +57,7 @@ class RC4 extends StreamCipher { /**#@+ * @access private - * @see \phpseclib\Crypt\RC4::_crypt() + * @see \phpseclib3\Crypt\RC4::_crypt() */ const ENCRYPT = 0; const DECRYPT = 1; @@ -69,7 +69,7 @@ class RC4 extends StreamCipher * RC4 is a stream cipher * so we the block_size to 0 * - * @see \phpseclib\Crypt\Common\SymmetricKey::block_size + * @see \phpseclib3\Crypt\Common\SymmetricKey::block_size * @var int * @access private */ @@ -78,7 +78,7 @@ class RC4 extends StreamCipher /** * Key Length (in bytes) * - * @see \phpseclib\Crypt\RC4::setKeyLength() + * @see \phpseclib3\Crypt\RC4::setKeyLength() * @var int * @access private */ @@ -87,7 +87,7 @@ class RC4 extends StreamCipher /** * The mcrypt specific name of the cipher * - * @see \phpseclib\Crypt\Common\SymmetricKey::cipher_name_mcrypt + * @see \phpseclib3\Crypt\Common\SymmetricKey::cipher_name_mcrypt * @var string * @access private */ @@ -114,8 +114,8 @@ class RC4 extends StreamCipher /** * Default Constructor. * - * @see \phpseclib\Crypt\Common\SymmetricKey::__construct() - * @return \phpseclib\Crypt\RC4 + * @see \phpseclib3\Crypt\Common\SymmetricKey::__construct() + * @return \phpseclib3\Crypt\RC4 * @access public */ public function __construct() @@ -126,9 +126,9 @@ class RC4 extends StreamCipher /** * Test for engine validity * - * This is mainly just a wrapper to set things up for \phpseclib\Crypt\Common\SymmetricKey::isValidEngine() + * This is mainly just a wrapper to set things up for \phpseclib3\Crypt\Common\SymmetricKey::isValidEngine() * - * @see \phpseclib\Crypt\Common\SymmetricKey::__construct() + * @see \phpseclib3\Crypt\Common\SymmetricKey::__construct() * @param int $engine * @access protected * @return bool @@ -213,7 +213,7 @@ class RC4 extends StreamCipher /** * Encrypts a message. * - * @see \phpseclib\Crypt\Common\SymmetricKey::decrypt() + * @see \phpseclib3\Crypt\Common\SymmetricKey::decrypt() * @see self::crypt() * @access public * @param string $plaintext @@ -233,7 +233,7 @@ class RC4 extends StreamCipher * $this->decrypt($this->encrypt($plaintext)) == $this->encrypt($this->encrypt($plaintext)). * At least if the continuous buffer is disabled. * - * @see \phpseclib\Crypt\Common\SymmetricKey::encrypt() + * @see \phpseclib3\Crypt\Common\SymmetricKey::encrypt() * @see self::crypt() * @access public * @param string $ciphertext @@ -272,7 +272,7 @@ class RC4 extends StreamCipher /** * Setup the key (expansion) * - * @see \phpseclib\Crypt\Common\SymmetricKey::_setupKey() + * @see \phpseclib3\Crypt\Common\SymmetricKey::_setupKey() * @access private */ protected function setupKey() diff --git a/phpseclib/Crypt/RSA.php b/phpseclib/Crypt/RSA.php index 978509b4..d73da4c4 100644 --- a/phpseclib/Crypt/RSA.php +++ b/phpseclib/Crypt/RSA.php @@ -10,7 +10,7 @@ * getPublicKey(); * * $plaintext = 'terrafrost'; @@ -26,7 +26,7 @@ * getPublicKey(); * * $plaintext = 'terrafrost'; @@ -45,15 +45,15 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt; +namespace phpseclib3\Crypt; -use phpseclib\Crypt\Common\AsymmetricKey; -use phpseclib\Crypt\RSA\PrivateKey; -use phpseclib\Crypt\RSA\PublicKey; -use phpseclib\Math\BigInteger; -use phpseclib\Exception\UnsupportedAlgorithmException; -use phpseclib\Exception\InconsistentSetupException; -use phpseclib\Crypt\RSA\Formats\Keys\PSS; +use phpseclib3\Crypt\Common\AsymmetricKey; +use phpseclib3\Crypt\RSA\PrivateKey; +use phpseclib3\Crypt\RSA\PublicKey; +use phpseclib3\Math\BigInteger; +use phpseclib3\Exception\UnsupportedAlgorithmException; +use phpseclib3\Exception\InconsistentSetupException; +use phpseclib3\Crypt\RSA\Formats\Keys\PSS; /** * Pure-PHP PKCS#1 compliant implementation of RSA. @@ -178,7 +178,7 @@ abstract class RSA extends AsymmetricKey /** * Hash function for the Mask Generation Function * - * @var \phpseclib\Crypt\Hash + * @var \phpseclib3\Crypt\Hash * @access private */ protected $mgfHash; @@ -194,7 +194,7 @@ abstract class RSA extends AsymmetricKey /** * Modulus (ie. n) * - * @var \phpseclib\Math\BigInteger + * @var \phpseclib3\Math\BigInteger * @access private */ protected $modulus; @@ -202,7 +202,7 @@ abstract class RSA extends AsymmetricKey /** * Modulus length * - * @var \phpseclib\Math\BigInteger + * @var \phpseclib3\Math\BigInteger * @access private */ protected $k; @@ -210,7 +210,7 @@ abstract class RSA extends AsymmetricKey /** * Exponent (ie. e or d) * - * @var \phpseclib\Math\BigInteger + * @var \phpseclib3\Math\BigInteger * @access private */ protected $exponent; @@ -457,7 +457,7 @@ abstract class RSA extends AsymmetricKey * See {@link http://tools.ietf.org/html/rfc3447#section-4.1 RFC3447#section-4.1}. * * @access private - * @param bool|\phpseclib\Math\BigInteger $x + * @param bool|\phpseclib3\Math\BigInteger $x * @param int $xLen * @return bool|string */ @@ -480,7 +480,7 @@ abstract class RSA extends AsymmetricKey * * @access private * @param string $x - * @return \phpseclib\Math\BigInteger + * @return \phpseclib3\Math\BigInteger */ protected function os2ip($x) { @@ -596,7 +596,7 @@ abstract class RSA extends AsymmetricKey { $new = clone $this; - // \phpseclib\Crypt\Hash supports algorithms that PKCS#1 doesn't support. md5-96 and sha1-96, for example. + // \phpseclib3\Crypt\Hash supports algorithms that PKCS#1 doesn't support. md5-96 and sha1-96, for example. switch (strtolower($hash)) { case 'md2': case 'md5': @@ -632,7 +632,7 @@ abstract class RSA extends AsymmetricKey { $new = clone $this; - // \phpseclib\Crypt\Hash supports algorithms that PKCS#1 doesn't support. md5-96 and sha1-96, for example. + // \phpseclib3\Crypt\Hash supports algorithms that PKCS#1 doesn't support. md5-96 and sha1-96, for example. switch (strtolower($hash)) { case 'md2': case 'md5': diff --git a/phpseclib/Crypt/RSA/Formats/Keys/MSBLOB.php b/phpseclib/Crypt/RSA/Formats/Keys/MSBLOB.php index 96a25cc6..deb9467b 100644 --- a/phpseclib/Crypt/RSA/Formats/Keys/MSBLOB.php +++ b/phpseclib/Crypt/RSA/Formats/Keys/MSBLOB.php @@ -17,11 +17,11 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt\RSA\Formats\Keys; +namespace phpseclib3\Crypt\RSA\Formats\Keys; use ParagonIE\ConstantTime\Base64; -use phpseclib\Math\BigInteger; -use phpseclib\Common\Functions\Strings; +use phpseclib3\Math\BigInteger; +use phpseclib3\Common\Functions\Strings; /** * Microsoft BLOB Formatted RSA Key Handler @@ -176,9 +176,9 @@ abstract class MSBLOB * Convert a private key to the appropriate format. * * @access public - * @param \phpseclib\Math\BigInteger $n - * @param \phpseclib\Math\BigInteger $e - * @param \phpseclib\Math\BigInteger $d + * @param \phpseclib3\Math\BigInteger $n + * @param \phpseclib3\Math\BigInteger $e + * @param \phpseclib3\Math\BigInteger $d * @param array $primes * @param array $exponents * @param array $coefficients @@ -210,8 +210,8 @@ abstract class MSBLOB * Convert a public key to the appropriate format * * @access public - * @param \phpseclib\Math\BigInteger $n - * @param \phpseclib\Math\BigInteger $e + * @param \phpseclib3\Math\BigInteger $n + * @param \phpseclib3\Math\BigInteger $e * @return string */ public static function savePublicKey(BigInteger $n, BigInteger $e) diff --git a/phpseclib/Crypt/RSA/Formats/Keys/OpenSSH.php b/phpseclib/Crypt/RSA/Formats/Keys/OpenSSH.php index 3e0161a6..3eebcd14 100644 --- a/phpseclib/Crypt/RSA/Formats/Keys/OpenSSH.php +++ b/phpseclib/Crypt/RSA/Formats/Keys/OpenSSH.php @@ -15,12 +15,12 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt\RSA\Formats\Keys; +namespace phpseclib3\Crypt\RSA\Formats\Keys; use ParagonIE\ConstantTime\Base64; -use phpseclib\Math\BigInteger; -use phpseclib\Common\Functions\Strings; -use phpseclib\Crypt\Common\Formats\Keys\OpenSSH as Progenitor; +use phpseclib3\Math\BigInteger; +use phpseclib3\Common\Functions\Strings; +use phpseclib3\Crypt\Common\Formats\Keys\OpenSSH as Progenitor; /** * OpenSSH Formatted RSA Key Handler @@ -97,8 +97,8 @@ abstract class OpenSSH extends Progenitor * Convert a public key to the appropriate format * * @access public - * @param \phpseclib\Math\BigInteger $n - * @param \phpseclib\Math\BigInteger $e + * @param \phpseclib3\Math\BigInteger $n + * @param \phpseclib3\Math\BigInteger $e * @param array $options optional * @return string */ @@ -120,9 +120,9 @@ abstract class OpenSSH extends Progenitor * Convert a private key to the appropriate format. * * @access public - * @param \phpseclib\Math\BigInteger $n - * @param \phpseclib\Math\BigInteger $e - * @param \phpseclib\Math\BigInteger $d + * @param \phpseclib3\Math\BigInteger $n + * @param \phpseclib3\Math\BigInteger $e + * @param \phpseclib3\Math\BigInteger $d * @param array $primes * @param array $exponents * @param array $coefficients diff --git a/phpseclib/Crypt/RSA/Formats/Keys/PKCS1.php b/phpseclib/Crypt/RSA/Formats/Keys/PKCS1.php index 5d44a67b..6ca838d5 100644 --- a/phpseclib/Crypt/RSA/Formats/Keys/PKCS1.php +++ b/phpseclib/Crypt/RSA/Formats/Keys/PKCS1.php @@ -22,12 +22,12 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt\RSA\Formats\Keys; +namespace phpseclib3\Crypt\RSA\Formats\Keys; -use phpseclib\Math\BigInteger; -use phpseclib\Crypt\Common\Formats\Keys\PKCS1 as Progenitor; -use phpseclib\File\ASN1; -use phpseclib\File\ASN1\Maps; +use phpseclib3\Math\BigInteger; +use phpseclib3\Crypt\Common\Formats\Keys\PKCS1 as Progenitor; +use phpseclib3\File\ASN1; +use phpseclib3\File\ASN1\Maps; /** * PKCS#1 Formatted RSA Key Handler @@ -94,9 +94,9 @@ abstract class PKCS1 extends Progenitor * Convert a private key to the appropriate format. * * @access public - * @param \phpseclib\Math\BigInteger $n - * @param \phpseclib\Math\BigInteger $e - * @param \phpseclib\Math\BigInteger $d + * @param \phpseclib3\Math\BigInteger $n + * @param \phpseclib3\Math\BigInteger $e + * @param \phpseclib3\Math\BigInteger $d * @param array $primes * @param array $exponents * @param array $coefficients @@ -135,8 +135,8 @@ abstract class PKCS1 extends Progenitor * Convert a public key to the appropriate format * * @access public - * @param \phpseclib\Math\BigInteger $n - * @param \phpseclib\Math\BigInteger $e + * @param \phpseclib3\Math\BigInteger $n + * @param \phpseclib3\Math\BigInteger $e * @return string */ public static function savePublicKey(BigInteger $n, BigInteger $e) diff --git a/phpseclib/Crypt/RSA/Formats/Keys/PKCS8.php b/phpseclib/Crypt/RSA/Formats/Keys/PKCS8.php index f1488f58..45a25683 100644 --- a/phpseclib/Crypt/RSA/Formats/Keys/PKCS8.php +++ b/phpseclib/Crypt/RSA/Formats/Keys/PKCS8.php @@ -25,11 +25,11 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt\RSA\Formats\Keys; +namespace phpseclib3\Crypt\RSA\Formats\Keys; -use phpseclib\Math\BigInteger; -use phpseclib\Crypt\Common\Formats\Keys\PKCS8 as Progenitor; -use phpseclib\File\ASN1; +use phpseclib3\Math\BigInteger; +use phpseclib3\Crypt\Common\Formats\Keys\PKCS8 as Progenitor; +use phpseclib3\File\ASN1; /** * PKCS#8 Formatted RSA Key Handler @@ -97,9 +97,9 @@ abstract class PKCS8 extends Progenitor * Convert a private key to the appropriate format. * * @access public - * @param \phpseclib\Math\BigInteger $n - * @param \phpseclib\Math\BigInteger $e - * @param \phpseclib\Math\BigInteger $d + * @param \phpseclib3\Math\BigInteger $n + * @param \phpseclib3\Math\BigInteger $e + * @param \phpseclib3\Math\BigInteger $d * @param array $primes * @param array $exponents * @param array $coefficients @@ -118,8 +118,8 @@ abstract class PKCS8 extends Progenitor * Convert a public key to the appropriate format * * @access public - * @param \phpseclib\Math\BigInteger $n - * @param \phpseclib\Math\BigInteger $e + * @param \phpseclib3\Math\BigInteger $n + * @param \phpseclib3\Math\BigInteger $e * @param array $options optional * @return string */ diff --git a/phpseclib/Crypt/RSA/Formats/Keys/PSS.php b/phpseclib/Crypt/RSA/Formats/Keys/PSS.php index 80a045d8..69818f4d 100644 --- a/phpseclib/Crypt/RSA/Formats/Keys/PSS.php +++ b/phpseclib/Crypt/RSA/Formats/Keys/PSS.php @@ -23,12 +23,12 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt\RSA\Formats\Keys; +namespace phpseclib3\Crypt\RSA\Formats\Keys; -use phpseclib\Math\BigInteger; -use phpseclib\Crypt\Common\Formats\Keys\PKCS8 as Progenitor; -use phpseclib\File\ASN1; -use phpseclib\File\ASN1\Maps; +use phpseclib3\Math\BigInteger; +use phpseclib3\Crypt\Common\Formats\Keys\PKCS8 as Progenitor; +use phpseclib3\File\ASN1; +use phpseclib3\File\ASN1\Maps; /** * PKCS#8 Formatted RSA-PSS Key Handler @@ -156,9 +156,9 @@ abstract class PSS extends Progenitor * Convert a private key to the appropriate format. * * @access public - * @param \phpseclib\Math\BigInteger $n - * @param \phpseclib\Math\BigInteger $e - * @param \phpseclib\Math\BigInteger $d + * @param \phpseclib3\Math\BigInteger $n + * @param \phpseclib3\Math\BigInteger $e + * @param \phpseclib3\Math\BigInteger $d * @param array $primes * @param array $exponents * @param array $coefficients @@ -180,8 +180,8 @@ abstract class PSS extends Progenitor * Convert a public key to the appropriate format * * @access public - * @param \phpseclib\Math\BigInteger $n - * @param \phpseclib\Math\BigInteger $e + * @param \phpseclib3\Math\BigInteger $n + * @param \phpseclib3\Math\BigInteger $e * @param array $options optional * @return string */ diff --git a/phpseclib/Crypt/RSA/Formats/Keys/PuTTY.php b/phpseclib/Crypt/RSA/Formats/Keys/PuTTY.php index c80af466..30acd328 100644 --- a/phpseclib/Crypt/RSA/Formats/Keys/PuTTY.php +++ b/phpseclib/Crypt/RSA/Formats/Keys/PuTTY.php @@ -13,11 +13,11 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt\RSA\Formats\Keys; +namespace phpseclib3\Crypt\RSA\Formats\Keys; -use phpseclib\Math\BigInteger; -use phpseclib\Common\Functions\Strings; -use phpseclib\Crypt\Common\Formats\Keys\PuTTY as Progenitor; +use phpseclib3\Math\BigInteger; +use phpseclib3\Common\Functions\Strings; +use phpseclib3\Crypt\Common\Formats\Keys\PuTTY as Progenitor; /** * PuTTY Formatted RSA Key Handler @@ -34,7 +34,7 @@ abstract class PuTTY extends Progenitor * @var string * @access private */ - const PUBLIC_HANDLER = 'phpseclib\Crypt\RSA\Formats\Keys\OpenSSH'; + const PUBLIC_HANDLER = 'phpseclib3\Crypt\RSA\Formats\Keys\OpenSSH'; /** * Algorithm Identifier @@ -93,9 +93,9 @@ abstract class PuTTY extends Progenitor * Convert a private key to the appropriate format. * * @access public - * @param \phpseclib\Math\BigInteger $n - * @param \phpseclib\Math\BigInteger $e - * @param \phpseclib\Math\BigInteger $d + * @param \phpseclib3\Math\BigInteger $n + * @param \phpseclib3\Math\BigInteger $e + * @param \phpseclib3\Math\BigInteger $d * @param array $primes * @param array $exponents * @param array $coefficients @@ -119,8 +119,8 @@ abstract class PuTTY extends Progenitor * Convert a public key to the appropriate format * * @access public - * @param \phpseclib\Math\BigInteger $n - * @param \phpseclib\Math\BigInteger $e + * @param \phpseclib3\Math\BigInteger $n + * @param \phpseclib3\Math\BigInteger $e * @return string */ public static function savePublicKey(BigInteger $n, BigInteger $e) diff --git a/phpseclib/Crypt/RSA/Formats/Keys/Raw.php b/phpseclib/Crypt/RSA/Formats/Keys/Raw.php index 689372bd..49d78928 100644 --- a/phpseclib/Crypt/RSA/Formats/Keys/Raw.php +++ b/phpseclib/Crypt/RSA/Formats/Keys/Raw.php @@ -5,7 +5,7 @@ * * PHP version 5 * - * An array containing two \phpseclib\Math\BigInteger objects. + * An array containing two \phpseclib3\Math\BigInteger objects. * * The exponent can be indexed with any of the following: * @@ -23,9 +23,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt\RSA\Formats\Keys; +namespace phpseclib3\Crypt\RSA\Formats\Keys; -use phpseclib\Math\BigInteger; +use phpseclib3\Math\BigInteger; /** * Raw RSA Key Handler @@ -97,8 +97,8 @@ abstract class Raw * Convert a public key to the appropriate format * * @access public - * @param \phpseclib\Math\BigInteger $n - * @param \phpseclib\Math\BigInteger $e + * @param \phpseclib3\Math\BigInteger $n + * @param \phpseclib3\Math\BigInteger $e * @return array */ public static function savePublicKey(BigInteger $n, BigInteger $e) diff --git a/phpseclib/Crypt/RSA/Formats/Keys/XML.php b/phpseclib/Crypt/RSA/Formats/Keys/XML.php index ba4bbace..9d3d2822 100644 --- a/phpseclib/Crypt/RSA/Formats/Keys/XML.php +++ b/phpseclib/Crypt/RSA/Formats/Keys/XML.php @@ -20,10 +20,10 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt\RSA\Formats\Keys; +namespace phpseclib3\Crypt\RSA\Formats\Keys; use ParagonIE\ConstantTime\Base64; -use phpseclib\Math\BigInteger; +use phpseclib3\Math\BigInteger; /** * XML Formatted RSA Key Handler @@ -122,9 +122,9 @@ abstract class XML * Convert a private key to the appropriate format. * * @access public - * @param \phpseclib\Math\BigInteger $n - * @param \phpseclib\Math\BigInteger $e - * @param \phpseclib\Math\BigInteger $d + * @param \phpseclib3\Math\BigInteger $n + * @param \phpseclib3\Math\BigInteger $e + * @param \phpseclib3\Math\BigInteger $d * @param array $primes * @param array $exponents * @param array $coefficients @@ -152,8 +152,8 @@ abstract class XML * Convert a public key to the appropriate format * * @access public - * @param \phpseclib\Math\BigInteger $n - * @param \phpseclib\Math\BigInteger $e + * @param \phpseclib3\Math\BigInteger $n + * @param \phpseclib3\Math\BigInteger $e * @return string */ public static function savePublicKey(BigInteger $n, BigInteger $e) diff --git a/phpseclib/Crypt/RSA/PrivateKey.php b/phpseclib/Crypt/RSA/PrivateKey.php index d1e5826c..fdcdca3d 100644 --- a/phpseclib/Crypt/RSA/PrivateKey.php +++ b/phpseclib/Crypt/RSA/PrivateKey.php @@ -11,18 +11,18 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt\RSA; +namespace phpseclib3\Crypt\RSA; -use phpseclib\Crypt\RSA; -use phpseclib\Math\BigInteger; -use phpseclib\File\ASN1; -use phpseclib\Common\Functions\Strings; -use phpseclib\Crypt\Hash; -use phpseclib\Exceptions\NoKeyLoadedException; -use phpseclib\Exception\UnsupportedFormatException; -use phpseclib\Crypt\Random; -use phpseclib\Crypt\Common; -use phpseclib\Crypt\RSA\Formats\Keys\PSS; +use phpseclib3\Crypt\RSA; +use phpseclib3\Math\BigInteger; +use phpseclib3\File\ASN1; +use phpseclib3\Common\Functions\Strings; +use phpseclib3\Crypt\Hash; +use phpseclib3\Exceptions\NoKeyLoadedException; +use phpseclib3\Exception\UnsupportedFormatException; +use phpseclib3\Crypt\Random; +use phpseclib3\Crypt\Common; +use phpseclib3\Crypt\RSA\Formats\Keys\PSS; /** * Raw RSA Key Handler @@ -73,8 +73,8 @@ class PrivateKey extends RSA implements Common\PrivateKey * See {@link http://tools.ietf.org/html/rfc3447#section-5.1.2 RFC3447#section-5.1.2}. * * @access private - * @param \phpseclib\Math\BigInteger $c - * @return bool|\phpseclib\Math\BigInteger + * @param \phpseclib3\Math\BigInteger $c + * @return bool|\phpseclib3\Math\BigInteger */ private function rsadp($c) { @@ -90,8 +90,8 @@ class PrivateKey extends RSA implements Common\PrivateKey * See {@link http://tools.ietf.org/html/rfc3447#section-5.2.1 RFC3447#section-5.2.1}. * * @access private - * @param \phpseclib\Math\BigInteger $m - * @return bool|\phpseclib\Math\BigInteger + * @param \phpseclib3\Math\BigInteger $m + * @return bool|\phpseclib3\Math\BigInteger */ private function rsasp1($m) { @@ -104,8 +104,8 @@ class PrivateKey extends RSA implements Common\PrivateKey /** * Exponentiate * - * @param \phpseclib\Math\BigInteger $x - * @return \phpseclib\Math\BigInteger + * @param \phpseclib3\Math\BigInteger $x + * @return \phpseclib3\Math\BigInteger */ protected function exponentiate(BigInteger $x) { @@ -186,10 +186,10 @@ class PrivateKey extends RSA implements Common\PrivateKey * Returns $x->modPow($this->exponents[$i], $this->primes[$i]) * * @access private - * @param \phpseclib\Math\BigInteger $x - * @param \phpseclib\Math\BigInteger $r + * @param \phpseclib3\Math\BigInteger $x + * @param \phpseclib3\Math\BigInteger $r * @param int $i - * @return \phpseclib\Math\BigInteger + * @return \phpseclib3\Math\BigInteger */ private function blind($x, $r, $i) { @@ -331,7 +331,7 @@ class PrivateKey extends RSA implements Common\PrivateKey * to be 2 regardless of which key is used. For compatibility purposes, we'll just check to make sure the * second byte is 2 or less. If it is, we'll accept the decrypted string as valid. * - * As a consequence of this, a private key encrypted ciphertext produced with \phpseclib\Crypt\RSA may not decrypt + * As a consequence of this, a private key encrypted ciphertext produced with \phpseclib3\Crypt\RSA may not decrypt * with a strictly PKCS#1 v1.5 compliant RSA implementation. Public key encrypted ciphertext's should but * not private key encrypted ciphertext's. * diff --git a/phpseclib/Crypt/RSA/PublicKey.php b/phpseclib/Crypt/RSA/PublicKey.php index a0b47e28..5715a699 100644 --- a/phpseclib/Crypt/RSA/PublicKey.php +++ b/phpseclib/Crypt/RSA/PublicKey.php @@ -11,19 +11,19 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt\RSA; +namespace phpseclib3\Crypt\RSA; -use phpseclib\Crypt\RSA; -use phpseclib\Math\BigInteger; -use phpseclib\File\ASN1; -use phpseclib\Common\Functions\Strings; -use phpseclib\Crypt\Hash; -use phpseclib\Exception\NoKeyLoadedException; -use phpseclib\Exception\UnsupportedFormatException; -use phpseclib\Crypt\Random; -use phpseclib\Crypt\Common; -use phpseclib\File\ASN1\Maps\DigestInfo; -use phpseclib\Crypt\RSA\Formats\Keys\PSS; +use phpseclib3\Crypt\RSA; +use phpseclib3\Math\BigInteger; +use phpseclib3\File\ASN1; +use phpseclib3\Common\Functions\Strings; +use phpseclib3\Crypt\Hash; +use phpseclib3\Exception\NoKeyLoadedException; +use phpseclib3\Exception\UnsupportedFormatException; +use phpseclib3\Crypt\Random; +use phpseclib3\Crypt\Common; +use phpseclib3\File\ASN1\Maps\DigestInfo; +use phpseclib3\Crypt\RSA\Formats\Keys\PSS; /** * Raw RSA Key Handler @@ -39,8 +39,8 @@ class PublicKey extends RSA implements Common\PublicKey /** * Exponentiate * - * @param \phpseclib\Math\BigInteger $x - * @return \phpseclib\Math\BigInteger + * @param \phpseclib3\Math\BigInteger $x + * @return \phpseclib3\Math\BigInteger */ private function exponentiate(BigInteger $x) { @@ -53,8 +53,8 @@ class PublicKey extends RSA implements Common\PublicKey * See {@link http://tools.ietf.org/html/rfc3447#section-5.2.2 RFC3447#section-5.2.2}. * * @access private - * @param \phpseclib\Math\BigInteger $s - * @return bool|\phpseclib\Math\BigInteger + * @param \phpseclib3\Math\BigInteger $s + * @return bool|\phpseclib3\Math\BigInteger */ private function rsavp1($s) { @@ -400,8 +400,8 @@ class PublicKey extends RSA implements Common\PublicKey * See {@link http://tools.ietf.org/html/rfc3447#section-5.1.1 RFC3447#section-5.1.1}. * * @access private - * @param \phpseclib\Math\BigInteger $m - * @return bool|\phpseclib\Math\BigInteger + * @param \phpseclib3\Math\BigInteger $m + * @return bool|\phpseclib3\Math\BigInteger */ private function rsaep($m) { diff --git a/phpseclib/Crypt/Random.php b/phpseclib/Crypt/Random.php index 8d5b2df1..b05f040e 100644 --- a/phpseclib/Crypt/Random.php +++ b/phpseclib/Crypt/Random.php @@ -10,7 +10,7 @@ * * * @@ -22,7 +22,7 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt; +namespace phpseclib3\Crypt; /** * Pure-PHP Random Number Generator @@ -142,22 +142,22 @@ abstract class Random // // http://en.wikipedia.org/wiki/Cryptographically_secure_pseudorandom_number_generator#Designs_based_on_cryptographic_primitives switch (true) { - case class_exists('\phpseclib\Crypt\AES'): + case class_exists('\phpseclib3\Crypt\AES'): $crypto = new AES('ctr'); break; - case class_exists('\phpseclib\Crypt\Twofish'): + case class_exists('\phpseclib3\Crypt\Twofish'): $crypto = new Twofish('ctr'); break; - case class_exists('\phpseclib\Crypt\Blowfish'): + case class_exists('\phpseclib3\Crypt\Blowfish'): $crypto = new Blowfish('ctr'); break; - case class_exists('\phpseclib\Crypt\TripleDES'): + case class_exists('\phpseclib3\Crypt\TripleDES'): $crypto = new TripleDES('ctr'); break; - case class_exists('\phpseclib\Crypt\DES'): + case class_exists('\phpseclib3\Crypt\DES'): $crypto = new DES('ctr'); break; - case class_exists('\phpseclib\Crypt\RC4'): + case class_exists('\phpseclib3\Crypt\RC4'): $crypto = new RC4(); break; default: diff --git a/phpseclib/Crypt/Rijndael.php b/phpseclib/Crypt/Rijndael.php index 0fe13c90..4d460db3 100644 --- a/phpseclib/Crypt/Rijndael.php +++ b/phpseclib/Crypt/Rijndael.php @@ -30,7 +30,7 @@ * setKey('abcdefghijklmnop'); * @@ -52,14 +52,14 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt; +namespace phpseclib3\Crypt; -use phpseclib\Crypt\Common\BlockCipher; +use phpseclib3\Crypt\Common\BlockCipher; -use phpseclib\Common\Functions\Strings; -use phpseclib\Exception\BadModeException; -use phpseclib\Exception\InsufficientSetupException; -use phpseclib\Exception\BadDecryptionException; +use phpseclib3\Common\Functions\Strings; +use phpseclib3\Exception\BadModeException; +use phpseclib3\Exception\InsufficientSetupException; +use phpseclib3\Exception\BadDecryptionException; /** * Pure-PHP implementation of Rijndael. @@ -74,12 +74,12 @@ class Rijndael extends BlockCipher * The mcrypt specific name of the cipher * * Mcrypt is useable for 128/192/256-bit $block_size/$key_length. For 160/224 not. - * \phpseclib\Crypt\Rijndael determines automatically whether mcrypt is useable + * \phpseclib3\Crypt\Rijndael determines automatically whether mcrypt is useable * or not for the current $block_size/$key_length. * In case of, $cipher_name_mcrypt will be set dynamically at run time accordingly. * - * @see \phpseclib\Crypt\Common\SymmetricKey::cipher_name_mcrypt - * @see \phpseclib\Crypt\Common\SymmetricKey::engine + * @see \phpseclib3\Crypt\Common\SymmetricKey::cipher_name_mcrypt + * @see \phpseclib3\Crypt\Common\SymmetricKey::engine * @see self::isValidEngine() * @var string * @access private @@ -274,9 +274,9 @@ class Rijndael extends BlockCipher /** * Test for engine validity * - * This is mainly just a wrapper to set things up for \phpseclib\Crypt\Common\SymmetricKey::isValidEngine() + * This is mainly just a wrapper to set things up for \phpseclib3\Crypt\Common\SymmetricKey::isValidEngine() * - * @see \phpseclib\Crypt\Common\SymmetricKey::__construct() + * @see \phpseclib3\Crypt\Common\SymmetricKey::__construct() * @param int $engine * @access protected * @return bool @@ -490,7 +490,7 @@ class Rijndael extends BlockCipher /** * Setup the key (expansion) * - * @see \phpseclib\Crypt\Common\SymmetricKey::setupKey() + * @see \phpseclib3\Crypt\Common\SymmetricKey::setupKey() * @access private */ protected function setupKey() @@ -796,7 +796,7 @@ class Rijndael extends BlockCipher /** * Setup the performance-optimized function for de/encrypt() * - * @see \phpseclib\Crypt\Common\SymmetricKey::setupInlineCrypt() + * @see \phpseclib3\Crypt\Common\SymmetricKey::setupInlineCrypt() * @access private */ protected function setupInlineCrypt() diff --git a/phpseclib/Crypt/Salsa20.php b/phpseclib/Crypt/Salsa20.php index 7f51a93c..ba60af6e 100644 --- a/phpseclib/Crypt/Salsa20.php +++ b/phpseclib/Crypt/Salsa20.php @@ -13,12 +13,12 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt; +namespace phpseclib3\Crypt; -use phpseclib\Crypt\Common\StreamCipher; -use phpseclib\Exception\InsufficientSetupException; -use phpseclib\Exception\BadDecryptionException; -use phpseclib\Common\Functions\Strings; +use phpseclib3\Crypt\Common\StreamCipher; +use phpseclib3\Exception\InsufficientSetupException; +use phpseclib3\Exception\BadDecryptionException; +use phpseclib3\Common\Functions\Strings; /** * Pure-PHP implementation of Salsa20. @@ -62,7 +62,7 @@ class Salsa20 extends StreamCipher /**#@+ * @access private - * @see \phpseclib\Crypt\Salsa20::crypt() + * @see \phpseclib3\Crypt\Salsa20::crypt() */ const ENCRYPT = 0; const DECRYPT = 1; @@ -99,8 +99,8 @@ class Salsa20 extends StreamCipher /** * Default Constructor. * - * @see \phpseclib\Crypt\Common\SymmetricKey::__construct() - * @return \phpseclib\Crypt\Salsa20 + * @see \phpseclib3\Crypt\Common\SymmetricKey::__construct() + * @return \phpseclib3\Crypt\Salsa20 */ public function __construct() { @@ -269,7 +269,7 @@ class Salsa20 extends StreamCipher /** * Encrypts a message. * - * @see \phpseclib\Crypt\Common\SymmetricKey::decrypt() + * @see \phpseclib3\Crypt\Common\SymmetricKey::decrypt() * @see self::crypt() * @param string $plaintext * @return string $ciphertext @@ -289,7 +289,7 @@ class Salsa20 extends StreamCipher * $this->decrypt($this->encrypt($plaintext)) == $this->encrypt($this->encrypt($plaintext)). * At least if the continuous buffer is disabled. * - * @see \phpseclib\Crypt\Common\SymmetricKey::encrypt() + * @see \phpseclib3\Crypt\Common\SymmetricKey::encrypt() * @see self::crypt() * @param string $ciphertext * @return string $plaintext diff --git a/phpseclib/Crypt/TripleDES.php b/phpseclib/Crypt/TripleDES.php index f530758a..2c98d639 100644 --- a/phpseclib/Crypt/TripleDES.php +++ b/phpseclib/Crypt/TripleDES.php @@ -12,7 +12,7 @@ * setKey('abcdefghijklmnopqrstuvwx'); * @@ -34,7 +34,7 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt; +namespace phpseclib3\Crypt; /** * Pure-PHP implementation of Triple DES. @@ -55,14 +55,14 @@ class TripleDES extends DES /** * Encrypt / decrypt using outer chaining * - * Outer chaining is used by SSH-2 and when the mode is set to \phpseclib\Crypt\Common\BlockCipher::MODE_CBC. + * Outer chaining is used by SSH-2 and when the mode is set to \phpseclib3\Crypt\Common\BlockCipher::MODE_CBC. */ const MODE_CBC3 = self::MODE_CBC; /** * Key Length (in bytes) * - * @see \phpseclib\Crypt\TripleDES::setKeyLength() + * @see \phpseclib3\Crypt\TripleDES::setKeyLength() * @var int * @access private */ @@ -71,8 +71,8 @@ class TripleDES extends DES /** * The mcrypt specific name of the cipher * - * @see \phpseclib\Crypt\DES::cipher_name_mcrypt - * @see \phpseclib\Crypt\Common\SymmetricKey::cipher_name_mcrypt + * @see \phpseclib3\Crypt\DES::cipher_name_mcrypt + * @see \phpseclib3\Crypt\Common\SymmetricKey::cipher_name_mcrypt * @var string * @access private */ @@ -81,7 +81,7 @@ class TripleDES extends DES /** * Optimizing value while CFB-encrypting * - * @see \phpseclib\Crypt\Common\SymmetricKey::cfb_init_len + * @see \phpseclib3\Crypt\Common\SymmetricKey::cfb_init_len * @var int * @access private */ @@ -91,7 +91,7 @@ class TripleDES extends DES * max possible size of $key * * @see self::setKey() - * @see \phpseclib\Crypt\DES::setKey() + * @see \phpseclib3\Crypt\DES::setKey() * @var string * @access private */ @@ -106,7 +106,7 @@ class TripleDES extends DES private $mode_3cbc; /** - * The \phpseclib\Crypt\DES objects + * The \phpseclib3\Crypt\DES objects * * Used only if $mode_3cbc === true * @@ -136,8 +136,8 @@ class TripleDES extends DES * * - cbc3 (same as cbc) * - * @see \phpseclib\Crypt\DES::__construct() - * @see \phpseclib\Crypt\Common\SymmetricKey::__construct() + * @see \phpseclib3\Crypt\DES::__construct() + * @see \phpseclib3\Crypt\Common\SymmetricKey::__construct() * @param string $mode * @access public */ @@ -157,7 +157,7 @@ class TripleDES extends DES new DES('cbc'), ]; - // we're going to be doing the padding, ourselves, so disable it in the \phpseclib\Crypt\DES objects + // we're going to be doing the padding, ourselves, so disable it in the \phpseclib3\Crypt\DES objects $this->des[0]->disablePadding(); $this->des[1]->disablePadding(); $this->des[2]->disablePadding(); @@ -177,9 +177,9 @@ class TripleDES extends DES /** * Test for engine validity * - * This is mainly just a wrapper to set things up for \phpseclib\Crypt\Common\SymmetricKey::isValidEngine() + * This is mainly just a wrapper to set things up for \phpseclib3\Crypt\Common\SymmetricKey::isValidEngine() * - * @see \phpseclib\Crypt\Common\SymmetricKey::__construct() + * @see \phpseclib3\Crypt\Common\SymmetricKey::__construct() * @param int $engine * @access protected * @return bool @@ -198,9 +198,9 @@ class TripleDES extends DES /** * Sets the initialization vector. * - * SetIV is not required when \phpseclib\Crypt\Common\SymmetricKey::MODE_ECB is being used. + * SetIV is not required when \phpseclib3\Crypt\Common\SymmetricKey::MODE_ECB is being used. * - * @see \phpseclib\Crypt\Common\SymmetricKey::setIV() + * @see \phpseclib3\Crypt\Common\SymmetricKey::setIV() * @access public * @param string $iv */ @@ -221,7 +221,7 @@ class TripleDES extends DES * * If you want to use a 64-bit key use DES.php * - * @see \phpseclib\Crypt\Common\SymmetricKey:setKeyLength() + * @see \phpseclib3\Crypt\Common\SymmetricKey:setKeyLength() * @access public * @throws \LengthException if the key length is invalid * @param int $length @@ -247,8 +247,8 @@ class TripleDES extends DES * DES also requires that every eighth bit be a parity bit, however, we'll ignore that. * * @access public - * @see \phpseclib\Crypt\DES::setKey() - * @see \phpseclib\Crypt\Common\SymmetricKey::setKey() + * @see \phpseclib3\Crypt\DES::setKey() + * @see \phpseclib3\Crypt\Common\SymmetricKey::setKey() * @throws \LengthException if the key length is invalid * @param string $key */ @@ -284,7 +284,7 @@ class TripleDES extends DES /** * Encrypts a message. * - * @see \phpseclib\Crypt\Common\SymmetricKey::encrypt() + * @see \phpseclib3\Crypt\Common\SymmetricKey::encrypt() * @access public * @param string $plaintext * @return string $cipertext @@ -311,7 +311,7 @@ class TripleDES extends DES /** * Decrypts a message. * - * @see \phpseclib\Crypt\Common\SymmetricKey::decrypt() + * @see \phpseclib3\Crypt\Common\SymmetricKey::decrypt() * @access public * @param string $ciphertext * @return string $plaintext @@ -362,12 +362,12 @@ class TripleDES extends DES * outputs. The reason is due to the fact that the initialization vector's change after every encryption / * decryption round when the continuous buffer is enabled. When it's disabled, they remain constant. * - * Put another way, when the continuous buffer is enabled, the state of the \phpseclib\Crypt\DES() object changes after each + * Put another way, when the continuous buffer is enabled, the state of the \phpseclib3\Crypt\DES() object changes after each * encryption / decryption round, whereas otherwise, it'd remain constant. For this reason, it's recommended that * continuous buffers not be used. They do offer better security and are, in fact, sometimes required (SSH uses them), * however, they are also less intuitive and more likely to cause you problems. * - * @see \phpseclib\Crypt\Common\SymmetricKey::enableContinuousBuffer() + * @see \phpseclib3\Crypt\Common\SymmetricKey::enableContinuousBuffer() * @see self::disableContinuousBuffer() * @access public */ @@ -386,7 +386,7 @@ class TripleDES extends DES * * The default behavior. * - * @see \phpseclib\Crypt\Common\SymmetricKey::disableContinuousBuffer() + * @see \phpseclib3\Crypt\Common\SymmetricKey::disableContinuousBuffer() * @see self::enableContinuousBuffer() * @access public */ @@ -403,8 +403,8 @@ class TripleDES extends DES /** * Creates the key schedule * - * @see \phpseclib\Crypt\DES::setupKey() - * @see \phpseclib\Crypt\Common\SymmetricKey::setupKey() + * @see \phpseclib3\Crypt\DES::setupKey() + * @see \phpseclib3\Crypt\Common\SymmetricKey::setupKey() * @access private */ protected function setupKey() @@ -438,8 +438,8 @@ class TripleDES extends DES /** * Sets the internal crypt engine * - * @see \phpseclib\Crypt\Common\SymmetricKey::__construct() - * @see \phpseclib\Crypt\Common\SymmetricKey::setPreferredEngine() + * @see \phpseclib3\Crypt\Common\SymmetricKey::__construct() + * @see \phpseclib3\Crypt\Common\SymmetricKey::setPreferredEngine() * @param int $engine * @access public */ diff --git a/phpseclib/Crypt/Twofish.php b/phpseclib/Crypt/Twofish.php index f9f1dce3..c9cc5b46 100644 --- a/phpseclib/Crypt/Twofish.php +++ b/phpseclib/Crypt/Twofish.php @@ -16,7 +16,7 @@ * setKey('12345678901234567890123456789012'); * @@ -35,10 +35,10 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Crypt; +namespace phpseclib3\Crypt; -use phpseclib\Crypt\Common\BlockCipher; -use phpseclib\Exception\BadModeException; +use phpseclib3\Crypt\Common\BlockCipher; +use phpseclib3\Exception\BadModeException; /** * Pure-PHP implementation of Twofish. @@ -53,7 +53,7 @@ class Twofish extends BlockCipher /** * The mcrypt specific name of the cipher * - * @see \phpseclib\Crypt\Common\SymmetricKey::cipher_name_mcrypt + * @see \phpseclib3\Crypt\Common\SymmetricKey::cipher_name_mcrypt * @var string * @access private */ @@ -62,7 +62,7 @@ class Twofish extends BlockCipher /** * Optimizing value while CFB-encrypting * - * @see \phpseclib\Crypt\Common\SymmetricKey::cfb_init_len + * @see \phpseclib3\Crypt\Common\SymmetricKey::cfb_init_len * @var int * @access private */ @@ -436,7 +436,7 @@ class Twofish extends BlockCipher /** * Setup the key (expansion) * - * @see \phpseclib\Crypt\Common\SymmetricKey::_setupKey() + * @see \phpseclib3\Crypt\Common\SymmetricKey::_setupKey() * @access private */ protected function setupKey() @@ -709,7 +709,7 @@ class Twofish extends BlockCipher /** * Setup the performance-optimized function for de/encrypt() * - * @see \phpseclib\Crypt\Common\SymmetricKey::_setupInlineCrypt() + * @see \phpseclib3\Crypt\Common\SymmetricKey::_setupInlineCrypt() * @access private */ protected function setupInlineCrypt() diff --git a/phpseclib/Exception/BadConfigurationException.php b/phpseclib/Exception/BadConfigurationException.php index 096148a0..fa5a818a 100644 --- a/phpseclib/Exception/BadConfigurationException.php +++ b/phpseclib/Exception/BadConfigurationException.php @@ -13,7 +13,7 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Exception; +namespace phpseclib3\Exception; /** * BadConfigurationException diff --git a/phpseclib/Exception/BadDecryptionException.php b/phpseclib/Exception/BadDecryptionException.php index 8a37b541..c1171b15 100644 --- a/phpseclib/Exception/BadDecryptionException.php +++ b/phpseclib/Exception/BadDecryptionException.php @@ -13,7 +13,7 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Exception; +namespace phpseclib3\Exception; /** * BadDecryptionException diff --git a/phpseclib/Exception/BadModeException.php b/phpseclib/Exception/BadModeException.php index ec6af369..ace9f578 100644 --- a/phpseclib/Exception/BadModeException.php +++ b/phpseclib/Exception/BadModeException.php @@ -13,7 +13,7 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Exception; +namespace phpseclib3\Exception; /** * BadModeException diff --git a/phpseclib/Exception/ConnectionClosedException.php b/phpseclib/Exception/ConnectionClosedException.php index 68bc3faf..d6300d5c 100644 --- a/phpseclib/Exception/ConnectionClosedException.php +++ b/phpseclib/Exception/ConnectionClosedException.php @@ -13,7 +13,7 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Exception; +namespace phpseclib3\Exception; /** * ConnectionClosedException diff --git a/phpseclib/Exception/FileNotFoundException.php b/phpseclib/Exception/FileNotFoundException.php index 984edfcc..bc1b9189 100644 --- a/phpseclib/Exception/FileNotFoundException.php +++ b/phpseclib/Exception/FileNotFoundException.php @@ -13,7 +13,7 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Exception; +namespace phpseclib3\Exception; /** * FileNotFoundException diff --git a/phpseclib/Exception/InconsistentSetupException.php b/phpseclib/Exception/InconsistentSetupException.php index b93ae4f8..77db4a0e 100644 --- a/phpseclib/Exception/InconsistentSetupException.php +++ b/phpseclib/Exception/InconsistentSetupException.php @@ -13,7 +13,7 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Exception; +namespace phpseclib3\Exception; /** * InconsistentSetupException diff --git a/phpseclib/Exception/InsufficientSetupException.php b/phpseclib/Exception/InsufficientSetupException.php index e97b0d52..27f49f2f 100644 --- a/phpseclib/Exception/InsufficientSetupException.php +++ b/phpseclib/Exception/InsufficientSetupException.php @@ -13,7 +13,7 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Exception; +namespace phpseclib3\Exception; /** * InsufficientSetupException diff --git a/phpseclib/Exception/NoKeyLoadedException.php b/phpseclib/Exception/NoKeyLoadedException.php index e7fab5ce..95152eb4 100644 --- a/phpseclib/Exception/NoKeyLoadedException.php +++ b/phpseclib/Exception/NoKeyLoadedException.php @@ -13,7 +13,7 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Exception; +namespace phpseclib3\Exception; /** * NoKeyLoadedException diff --git a/phpseclib/Exception/NoSupportedAlgorithmsException.php b/phpseclib/Exception/NoSupportedAlgorithmsException.php index bca9a753..7a7471dc 100644 --- a/phpseclib/Exception/NoSupportedAlgorithmsException.php +++ b/phpseclib/Exception/NoSupportedAlgorithmsException.php @@ -13,7 +13,7 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Exception; +namespace phpseclib3\Exception; /** * NoSupportedAlgorithmsException diff --git a/phpseclib/Exception/UnableToConnectException.php b/phpseclib/Exception/UnableToConnectException.php index 58b43298..909ef67f 100644 --- a/phpseclib/Exception/UnableToConnectException.php +++ b/phpseclib/Exception/UnableToConnectException.php @@ -13,7 +13,7 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Exception; +namespace phpseclib3\Exception; /** * UnableToConnectException diff --git a/phpseclib/Exception/UnsupportedAlgorithmException.php b/phpseclib/Exception/UnsupportedAlgorithmException.php index 47cc41d4..e0c07a43 100644 --- a/phpseclib/Exception/UnsupportedAlgorithmException.php +++ b/phpseclib/Exception/UnsupportedAlgorithmException.php @@ -13,7 +13,7 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Exception; +namespace phpseclib3\Exception; /** * UnsupportedAlgorithmException diff --git a/phpseclib/Exception/UnsupportedCurveException.php b/phpseclib/Exception/UnsupportedCurveException.php index bd2c81b5..6d746ab1 100644 --- a/phpseclib/Exception/UnsupportedCurveException.php +++ b/phpseclib/Exception/UnsupportedCurveException.php @@ -13,7 +13,7 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Exception; +namespace phpseclib3\Exception; /** * UnsupportedCurveException diff --git a/phpseclib/Exception/UnsupportedFormatException.php b/phpseclib/Exception/UnsupportedFormatException.php index 439163a5..f58f812d 100644 --- a/phpseclib/Exception/UnsupportedFormatException.php +++ b/phpseclib/Exception/UnsupportedFormatException.php @@ -13,7 +13,7 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Exception; +namespace phpseclib3\Exception; /** * UnsupportedFormatException diff --git a/phpseclib/Exception/UnsupportedOperationException.php b/phpseclib/Exception/UnsupportedOperationException.php index 9ca819fc..7872a1a8 100644 --- a/phpseclib/Exception/UnsupportedOperationException.php +++ b/phpseclib/Exception/UnsupportedOperationException.php @@ -13,7 +13,7 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Exception; +namespace phpseclib3\Exception; /** * UnsupportedOperationException diff --git a/phpseclib/File/ANSI.php b/phpseclib/File/ANSI.php index 6c2c8239..78dc894c 100644 --- a/phpseclib/File/ANSI.php +++ b/phpseclib/File/ANSI.php @@ -5,10 +5,10 @@ * * PHP version 5 * - * If you call read() in \phpseclib\Net\SSH2 you may get {@link http://en.wikipedia.org/wiki/ANSI_escape_code ANSI escape codes} back. + * If you call read() in \phpseclib3\Net\SSH2 you may get {@link http://en.wikipedia.org/wiki/ANSI_escape_code ANSI escape codes} back. * They'd look like chr(0x1B) . '[00m' or whatever (0x1B = ESC). They tell a * {@link http://en.wikipedia.org/wiki/Terminal_emulator terminal emulator} how to format the characters, what - * color to display them in, etc. \phpseclib\File\ANSI is a {@link http://en.wikipedia.org/wiki/VT100 VT100} terminal emulator. + * color to display them in, etc. \phpseclib3\File\ANSI is a {@link http://en.wikipedia.org/wiki/VT100 VT100} terminal emulator. * * @category File * @package ANSI @@ -18,7 +18,7 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File; +namespace phpseclib3\File; /** * Pure-PHP ANSI Decoder @@ -160,7 +160,7 @@ class ANSI /** * Default Constructor. * - * @return \phpseclib\File\ANSI + * @return \phpseclib3\File\ANSI * @access public */ public function __construct() diff --git a/phpseclib/File/ASN1.php b/phpseclib/File/ASN1.php index 30f9e4d2..6e0f72cb 100644 --- a/phpseclib/File/ASN1.php +++ b/phpseclib/File/ASN1.php @@ -9,7 +9,7 @@ * utilized scheme is DER or the "Distinguished Encoding Rules". PEM's are base64 encoded * DER blobs. * - * \phpseclib\File\ASN1 decodes and encodes DER formatted messages and places them in a semantic context. + * \phpseclib3\File\ASN1 decodes and encodes DER formatted messages and places them in a semantic context. * * Uses the 1988 ASN.1 syntax. * @@ -21,12 +21,12 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File; +namespace phpseclib3\File; use ParagonIE\ConstantTime\Base64; -use phpseclib\File\ASN1\Element; -use phpseclib\Math\BigInteger; -use phpseclib\Common\Functions\Strings; +use phpseclib3\File\ASN1\Element; +use phpseclib3\Math\BigInteger; +use phpseclib3\Common\Functions\Strings; use DateTime; use DateTimeZone; @@ -167,7 +167,7 @@ abstract class ASN1 /** * Type mapping table for the ANY type. * - * Structured or unknown types are mapped to a \phpseclib\File\ASN1\Element. + * Structured or unknown types are mapped to a \phpseclib3\File\ASN1\Element. * Unambiguous types get the direct mapping (int/real/bool). * Others are mapped as a choice, with an extra indexing level. * @@ -1325,7 +1325,7 @@ abstract class ASN1 /** * Set filters * - * See \phpseclib\File\X509, etc, for an example. + * See \phpseclib3\File\X509, etc, for an example. * Previously loaded filters are not retained. * * @access public diff --git a/phpseclib/File/ASN1/Element.php b/phpseclib/File/ASN1/Element.php index 048104e6..ade26ae5 100644 --- a/phpseclib/File/ASN1/Element.php +++ b/phpseclib/File/ASN1/Element.php @@ -13,7 +13,7 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1; +namespace phpseclib3\File\ASN1; /** * ASN.1 Raw Element @@ -39,7 +39,7 @@ class Element * Constructor * * @param string $encoded - * @return \phpseclib\File\ASN1\Element + * @return \phpseclib3\File\ASN1\Element * @access public */ public function __construct($encoded) diff --git a/phpseclib/File/ASN1/Maps/AccessDescription.php b/phpseclib/File/ASN1/Maps/AccessDescription.php index 4e1d91b1..969de8c4 100644 --- a/phpseclib/File/ASN1/Maps/AccessDescription.php +++ b/phpseclib/File/ASN1/Maps/AccessDescription.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * AccessDescription diff --git a/phpseclib/File/ASN1/Maps/AdministrationDomainName.php b/phpseclib/File/ASN1/Maps/AdministrationDomainName.php index 911ed130..1b607e7c 100644 --- a/phpseclib/File/ASN1/Maps/AdministrationDomainName.php +++ b/phpseclib/File/ASN1/Maps/AdministrationDomainName.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * AdministrationDomainName @@ -28,8 +28,8 @@ abstract class AdministrationDomainName { const MAP = [ 'type' => ASN1::TYPE_CHOICE, - // if class isn't present it's assumed to be \phpseclib\File\ASN1::CLASS_UNIVERSAL or - // (if constant is present) \phpseclib\File\ASN1::CLASS_CONTEXT_SPECIFIC + // if class isn't present it's assumed to be \phpseclib3\File\ASN1::CLASS_UNIVERSAL or + // (if constant is present) \phpseclib3\File\ASN1::CLASS_CONTEXT_SPECIFIC 'class' => ASN1::CLASS_APPLICATION, 'cast' => 2, 'children' => [ diff --git a/phpseclib/File/ASN1/Maps/AlgorithmIdentifier.php b/phpseclib/File/ASN1/Maps/AlgorithmIdentifier.php index f2ed617c..f9f25334 100644 --- a/phpseclib/File/ASN1/Maps/AlgorithmIdentifier.php +++ b/phpseclib/File/ASN1/Maps/AlgorithmIdentifier.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * AlgorithmIdentifier diff --git a/phpseclib/File/ASN1/Maps/AnotherName.php b/phpseclib/File/ASN1/Maps/AnotherName.php index f00b3974..3fe2ba0b 100644 --- a/phpseclib/File/ASN1/Maps/AnotherName.php +++ b/phpseclib/File/ASN1/Maps/AnotherName.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * AnotherName diff --git a/phpseclib/File/ASN1/Maps/Attribute.php b/phpseclib/File/ASN1/Maps/Attribute.php index cf657fa9..a80dad31 100644 --- a/phpseclib/File/ASN1/Maps/Attribute.php +++ b/phpseclib/File/ASN1/Maps/Attribute.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * Attribute diff --git a/phpseclib/File/ASN1/Maps/AttributeType.php b/phpseclib/File/ASN1/Maps/AttributeType.php index 354ed10e..891b8082 100644 --- a/phpseclib/File/ASN1/Maps/AttributeType.php +++ b/phpseclib/File/ASN1/Maps/AttributeType.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * AttributeType diff --git a/phpseclib/File/ASN1/Maps/AttributeTypeAndValue.php b/phpseclib/File/ASN1/Maps/AttributeTypeAndValue.php index 4982e5e4..ff4faa07 100644 --- a/phpseclib/File/ASN1/Maps/AttributeTypeAndValue.php +++ b/phpseclib/File/ASN1/Maps/AttributeTypeAndValue.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * AttributeTypeAndValue diff --git a/phpseclib/File/ASN1/Maps/AttributeValue.php b/phpseclib/File/ASN1/Maps/AttributeValue.php index 10b8ad09..eca03273 100644 --- a/phpseclib/File/ASN1/Maps/AttributeValue.php +++ b/phpseclib/File/ASN1/Maps/AttributeValue.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * AttributeValue diff --git a/phpseclib/File/ASN1/Maps/Attributes.php b/phpseclib/File/ASN1/Maps/Attributes.php index 2614ef45..563a6900 100644 --- a/phpseclib/File/ASN1/Maps/Attributes.php +++ b/phpseclib/File/ASN1/Maps/Attributes.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * Attributes diff --git a/phpseclib/File/ASN1/Maps/AuthorityInfoAccessSyntax.php b/phpseclib/File/ASN1/Maps/AuthorityInfoAccessSyntax.php index 8fc7bfe7..38c714d5 100644 --- a/phpseclib/File/ASN1/Maps/AuthorityInfoAccessSyntax.php +++ b/phpseclib/File/ASN1/Maps/AuthorityInfoAccessSyntax.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * AuthorityInfoAccessSyntax diff --git a/phpseclib/File/ASN1/Maps/AuthorityKeyIdentifier.php b/phpseclib/File/ASN1/Maps/AuthorityKeyIdentifier.php index 634d3a42..b6b08ae0 100644 --- a/phpseclib/File/ASN1/Maps/AuthorityKeyIdentifier.php +++ b/phpseclib/File/ASN1/Maps/AuthorityKeyIdentifier.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * AuthorityKeyIdentifier diff --git a/phpseclib/File/ASN1/Maps/BaseDistance.php b/phpseclib/File/ASN1/Maps/BaseDistance.php index cdeb5665..8453e49d 100644 --- a/phpseclib/File/ASN1/Maps/BaseDistance.php +++ b/phpseclib/File/ASN1/Maps/BaseDistance.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * BaseDistance diff --git a/phpseclib/File/ASN1/Maps/BasicConstraints.php b/phpseclib/File/ASN1/Maps/BasicConstraints.php index 4fd2c637..490bc920 100644 --- a/phpseclib/File/ASN1/Maps/BasicConstraints.php +++ b/phpseclib/File/ASN1/Maps/BasicConstraints.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * BasicConstraints diff --git a/phpseclib/File/ASN1/Maps/BuiltInDomainDefinedAttribute.php b/phpseclib/File/ASN1/Maps/BuiltInDomainDefinedAttribute.php index 6b81a18c..19f31c24 100644 --- a/phpseclib/File/ASN1/Maps/BuiltInDomainDefinedAttribute.php +++ b/phpseclib/File/ASN1/Maps/BuiltInDomainDefinedAttribute.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * BuiltInDomainDefinedAttribute diff --git a/phpseclib/File/ASN1/Maps/BuiltInDomainDefinedAttributes.php b/phpseclib/File/ASN1/Maps/BuiltInDomainDefinedAttributes.php index 82d18354..dc412118 100644 --- a/phpseclib/File/ASN1/Maps/BuiltInDomainDefinedAttributes.php +++ b/phpseclib/File/ASN1/Maps/BuiltInDomainDefinedAttributes.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * BuiltInDomainDefinedAttributes diff --git a/phpseclib/File/ASN1/Maps/BuiltInStandardAttributes.php b/phpseclib/File/ASN1/Maps/BuiltInStandardAttributes.php index 1b581674..4cbe0b09 100644 --- a/phpseclib/File/ASN1/Maps/BuiltInStandardAttributes.php +++ b/phpseclib/File/ASN1/Maps/BuiltInStandardAttributes.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * BuiltInStandardAttributes diff --git a/phpseclib/File/ASN1/Maps/CPSuri.php b/phpseclib/File/ASN1/Maps/CPSuri.php index 96ad09af..78733df9 100644 --- a/phpseclib/File/ASN1/Maps/CPSuri.php +++ b/phpseclib/File/ASN1/Maps/CPSuri.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * CPSuri diff --git a/phpseclib/File/ASN1/Maps/CRLDistributionPoints.php b/phpseclib/File/ASN1/Maps/CRLDistributionPoints.php index a06d474c..21ab6623 100644 --- a/phpseclib/File/ASN1/Maps/CRLDistributionPoints.php +++ b/phpseclib/File/ASN1/Maps/CRLDistributionPoints.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * CRLDistributionPoints diff --git a/phpseclib/File/ASN1/Maps/CRLNumber.php b/phpseclib/File/ASN1/Maps/CRLNumber.php index 83eebd83..921fdd52 100644 --- a/phpseclib/File/ASN1/Maps/CRLNumber.php +++ b/phpseclib/File/ASN1/Maps/CRLNumber.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * CRLNumber diff --git a/phpseclib/File/ASN1/Maps/CRLReason.php b/phpseclib/File/ASN1/Maps/CRLReason.php index ae5475e8..e43e4dd7 100644 --- a/phpseclib/File/ASN1/Maps/CRLReason.php +++ b/phpseclib/File/ASN1/Maps/CRLReason.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * CRLReason diff --git a/phpseclib/File/ASN1/Maps/CertPolicyId.php b/phpseclib/File/ASN1/Maps/CertPolicyId.php index c8fac468..a4620e7d 100644 --- a/phpseclib/File/ASN1/Maps/CertPolicyId.php +++ b/phpseclib/File/ASN1/Maps/CertPolicyId.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * CertPolicyId diff --git a/phpseclib/File/ASN1/Maps/Certificate.php b/phpseclib/File/ASN1/Maps/Certificate.php index 0b6bcd71..f8ff4130 100644 --- a/phpseclib/File/ASN1/Maps/Certificate.php +++ b/phpseclib/File/ASN1/Maps/Certificate.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * Certificate diff --git a/phpseclib/File/ASN1/Maps/CertificateIssuer.php b/phpseclib/File/ASN1/Maps/CertificateIssuer.php index 51696784..ba4504af 100644 --- a/phpseclib/File/ASN1/Maps/CertificateIssuer.php +++ b/phpseclib/File/ASN1/Maps/CertificateIssuer.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * CertificateIssuer diff --git a/phpseclib/File/ASN1/Maps/CertificateList.php b/phpseclib/File/ASN1/Maps/CertificateList.php index 2ce3872a..79a1f324 100644 --- a/phpseclib/File/ASN1/Maps/CertificateList.php +++ b/phpseclib/File/ASN1/Maps/CertificateList.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * CertificateList diff --git a/phpseclib/File/ASN1/Maps/CertificatePolicies.php b/phpseclib/File/ASN1/Maps/CertificatePolicies.php index 65bd8a44..e9f9354a 100644 --- a/phpseclib/File/ASN1/Maps/CertificatePolicies.php +++ b/phpseclib/File/ASN1/Maps/CertificatePolicies.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * CertificatePolicies diff --git a/phpseclib/File/ASN1/Maps/CertificateSerialNumber.php b/phpseclib/File/ASN1/Maps/CertificateSerialNumber.php index c9cc70db..83f26d31 100644 --- a/phpseclib/File/ASN1/Maps/CertificateSerialNumber.php +++ b/phpseclib/File/ASN1/Maps/CertificateSerialNumber.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * CertificateSerialNumber diff --git a/phpseclib/File/ASN1/Maps/CertificationRequest.php b/phpseclib/File/ASN1/Maps/CertificationRequest.php index 97ff23c7..23587f08 100644 --- a/phpseclib/File/ASN1/Maps/CertificationRequest.php +++ b/phpseclib/File/ASN1/Maps/CertificationRequest.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * CertificationRequest diff --git a/phpseclib/File/ASN1/Maps/CertificationRequestInfo.php b/phpseclib/File/ASN1/Maps/CertificationRequestInfo.php index f1f62aa4..1ebff5ff 100644 --- a/phpseclib/File/ASN1/Maps/CertificationRequestInfo.php +++ b/phpseclib/File/ASN1/Maps/CertificationRequestInfo.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * CertificationRequestInfo diff --git a/phpseclib/File/ASN1/Maps/Characteristic_two.php b/phpseclib/File/ASN1/Maps/Characteristic_two.php index 92817031..b73e0ba2 100644 --- a/phpseclib/File/ASN1/Maps/Characteristic_two.php +++ b/phpseclib/File/ASN1/Maps/Characteristic_two.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * Characteristic_two diff --git a/phpseclib/File/ASN1/Maps/CountryName.php b/phpseclib/File/ASN1/Maps/CountryName.php index 98e7a887..83b3a2c3 100644 --- a/phpseclib/File/ASN1/Maps/CountryName.php +++ b/phpseclib/File/ASN1/Maps/CountryName.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * CountryName @@ -28,8 +28,8 @@ abstract class CountryName { const MAP = [ 'type' => ASN1::TYPE_CHOICE, - // if class isn't present it's assumed to be \phpseclib\File\ASN1::CLASS_UNIVERSAL or - // (if constant is present) \phpseclib\File\ASN1::CLASS_CONTEXT_SPECIFIC + // if class isn't present it's assumed to be \phpseclib3\File\ASN1::CLASS_UNIVERSAL or + // (if constant is present) \phpseclib3\File\ASN1::CLASS_CONTEXT_SPECIFIC 'class' => ASN1::CLASS_APPLICATION, 'cast' => 1, 'children' => [ diff --git a/phpseclib/File/ASN1/Maps/Curve.php b/phpseclib/File/ASN1/Maps/Curve.php index 1a438028..1a574583 100644 --- a/phpseclib/File/ASN1/Maps/Curve.php +++ b/phpseclib/File/ASN1/Maps/Curve.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * Curve diff --git a/phpseclib/File/ASN1/Maps/DHParameter.php b/phpseclib/File/ASN1/Maps/DHParameter.php index de074308..8edd9d06 100644 --- a/phpseclib/File/ASN1/Maps/DHParameter.php +++ b/phpseclib/File/ASN1/Maps/DHParameter.php @@ -15,9 +15,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * DHParameter diff --git a/phpseclib/File/ASN1/Maps/DSAParams.php b/phpseclib/File/ASN1/Maps/DSAParams.php index c3941eda..c89fd84b 100644 --- a/phpseclib/File/ASN1/Maps/DSAParams.php +++ b/phpseclib/File/ASN1/Maps/DSAParams.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * DSAParams diff --git a/phpseclib/File/ASN1/Maps/DSAPrivateKey.php b/phpseclib/File/ASN1/Maps/DSAPrivateKey.php index 06174178..eaec347d 100644 --- a/phpseclib/File/ASN1/Maps/DSAPrivateKey.php +++ b/phpseclib/File/ASN1/Maps/DSAPrivateKey.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * DSAPrivateKey diff --git a/phpseclib/File/ASN1/Maps/DSAPublicKey.php b/phpseclib/File/ASN1/Maps/DSAPublicKey.php index abe808d7..867d80b7 100644 --- a/phpseclib/File/ASN1/Maps/DSAPublicKey.php +++ b/phpseclib/File/ASN1/Maps/DSAPublicKey.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * DSAPublicKey diff --git a/phpseclib/File/ASN1/Maps/DigestInfo.php b/phpseclib/File/ASN1/Maps/DigestInfo.php index d326e343..828c2798 100644 --- a/phpseclib/File/ASN1/Maps/DigestInfo.php +++ b/phpseclib/File/ASN1/Maps/DigestInfo.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * DigestInfo diff --git a/phpseclib/File/ASN1/Maps/DirectoryString.php b/phpseclib/File/ASN1/Maps/DirectoryString.php index 555aee24..458acab1 100644 --- a/phpseclib/File/ASN1/Maps/DirectoryString.php +++ b/phpseclib/File/ASN1/Maps/DirectoryString.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * DirectoryString diff --git a/phpseclib/File/ASN1/Maps/DisplayText.php b/phpseclib/File/ASN1/Maps/DisplayText.php index 1e3f60f9..6c88b41c 100644 --- a/phpseclib/File/ASN1/Maps/DisplayText.php +++ b/phpseclib/File/ASN1/Maps/DisplayText.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * DisplayText diff --git a/phpseclib/File/ASN1/Maps/DistributionPoint.php b/phpseclib/File/ASN1/Maps/DistributionPoint.php index 110ad459..91b3feef 100644 --- a/phpseclib/File/ASN1/Maps/DistributionPoint.php +++ b/phpseclib/File/ASN1/Maps/DistributionPoint.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * DistributionPoint diff --git a/phpseclib/File/ASN1/Maps/DistributionPointName.php b/phpseclib/File/ASN1/Maps/DistributionPointName.php index 8ea5ba05..fc157bca 100644 --- a/phpseclib/File/ASN1/Maps/DistributionPointName.php +++ b/phpseclib/File/ASN1/Maps/DistributionPointName.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * DistributionPointName diff --git a/phpseclib/File/ASN1/Maps/DssSigValue.php b/phpseclib/File/ASN1/Maps/DssSigValue.php index 05eda2c3..1bffe925 100644 --- a/phpseclib/File/ASN1/Maps/DssSigValue.php +++ b/phpseclib/File/ASN1/Maps/DssSigValue.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * DssSigValue diff --git a/phpseclib/File/ASN1/Maps/ECParameters.php b/phpseclib/File/ASN1/Maps/ECParameters.php index 21e096ea..c27d16f9 100644 --- a/phpseclib/File/ASN1/Maps/ECParameters.php +++ b/phpseclib/File/ASN1/Maps/ECParameters.php @@ -15,9 +15,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * ECParameters diff --git a/phpseclib/File/ASN1/Maps/ECPoint.php b/phpseclib/File/ASN1/Maps/ECPoint.php index bd6ea09e..1a9429a4 100644 --- a/phpseclib/File/ASN1/Maps/ECPoint.php +++ b/phpseclib/File/ASN1/Maps/ECPoint.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * ECPoint diff --git a/phpseclib/File/ASN1/Maps/ECPrivateKey.php b/phpseclib/File/ASN1/Maps/ECPrivateKey.php index fb17c412..a0d7a066 100644 --- a/phpseclib/File/ASN1/Maps/ECPrivateKey.php +++ b/phpseclib/File/ASN1/Maps/ECPrivateKey.php @@ -15,9 +15,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * ECPrivateKey diff --git a/phpseclib/File/ASN1/Maps/EDIPartyName.php b/phpseclib/File/ASN1/Maps/EDIPartyName.php index 3ac07e9d..0c2327b8 100644 --- a/phpseclib/File/ASN1/Maps/EDIPartyName.php +++ b/phpseclib/File/ASN1/Maps/EDIPartyName.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * EDIPartyName @@ -34,7 +34,7 @@ abstract class EDIPartyName 'optional' => true, 'implicit' => true ] + DirectoryString::MAP, - // partyName is technically required but \phpseclib\File\ASN1 doesn't currently support non-optional constants and + // partyName is technically required but \phpseclib3\File\ASN1 doesn't currently support non-optional constants and // setting it to optional gets the job done in any event. 'partyName' => [ 'constant' => 1, diff --git a/phpseclib/File/ASN1/Maps/EcdsaSigValue.php b/phpseclib/File/ASN1/Maps/EcdsaSigValue.php index 69f95bda..98dd965a 100644 --- a/phpseclib/File/ASN1/Maps/EcdsaSigValue.php +++ b/phpseclib/File/ASN1/Maps/EcdsaSigValue.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * EcdsaSigValue diff --git a/phpseclib/File/ASN1/Maps/EncryptedData.php b/phpseclib/File/ASN1/Maps/EncryptedData.php index 79e361c8..7873579f 100644 --- a/phpseclib/File/ASN1/Maps/EncryptedData.php +++ b/phpseclib/File/ASN1/Maps/EncryptedData.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * EncryptedData diff --git a/phpseclib/File/ASN1/Maps/EncryptedPrivateKeyInfo.php b/phpseclib/File/ASN1/Maps/EncryptedPrivateKeyInfo.php index ca8d5590..5d409eb1 100644 --- a/phpseclib/File/ASN1/Maps/EncryptedPrivateKeyInfo.php +++ b/phpseclib/File/ASN1/Maps/EncryptedPrivateKeyInfo.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * EncryptedPrivateKeyInfo diff --git a/phpseclib/File/ASN1/Maps/ExtKeyUsageSyntax.php b/phpseclib/File/ASN1/Maps/ExtKeyUsageSyntax.php index 9a257c5e..c61116df 100644 --- a/phpseclib/File/ASN1/Maps/ExtKeyUsageSyntax.php +++ b/phpseclib/File/ASN1/Maps/ExtKeyUsageSyntax.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * ExtKeyUsageSyntax diff --git a/phpseclib/File/ASN1/Maps/Extension.php b/phpseclib/File/ASN1/Maps/Extension.php index d59e2d3c..39200793 100644 --- a/phpseclib/File/ASN1/Maps/Extension.php +++ b/phpseclib/File/ASN1/Maps/Extension.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * Extension diff --git a/phpseclib/File/ASN1/Maps/ExtensionAttribute.php b/phpseclib/File/ASN1/Maps/ExtensionAttribute.php index cf537f63..6455e189 100644 --- a/phpseclib/File/ASN1/Maps/ExtensionAttribute.php +++ b/phpseclib/File/ASN1/Maps/ExtensionAttribute.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * ExtensionAttribute diff --git a/phpseclib/File/ASN1/Maps/ExtensionAttributes.php b/phpseclib/File/ASN1/Maps/ExtensionAttributes.php index 60189d8b..047bb29a 100644 --- a/phpseclib/File/ASN1/Maps/ExtensionAttributes.php +++ b/phpseclib/File/ASN1/Maps/ExtensionAttributes.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * ExtensionAttributes diff --git a/phpseclib/File/ASN1/Maps/Extensions.php b/phpseclib/File/ASN1/Maps/Extensions.php index 152316de..e3d528d4 100644 --- a/phpseclib/File/ASN1/Maps/Extensions.php +++ b/phpseclib/File/ASN1/Maps/Extensions.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * Extensions diff --git a/phpseclib/File/ASN1/Maps/FieldElement.php b/phpseclib/File/ASN1/Maps/FieldElement.php index 5617607f..6666e2ad 100644 --- a/phpseclib/File/ASN1/Maps/FieldElement.php +++ b/phpseclib/File/ASN1/Maps/FieldElement.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * FieldElement diff --git a/phpseclib/File/ASN1/Maps/FieldID.php b/phpseclib/File/ASN1/Maps/FieldID.php index b5642030..13c6ac49 100644 --- a/phpseclib/File/ASN1/Maps/FieldID.php +++ b/phpseclib/File/ASN1/Maps/FieldID.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * FieldID diff --git a/phpseclib/File/ASN1/Maps/GeneralName.php b/phpseclib/File/ASN1/Maps/GeneralName.php index 38e00790..ba0b9e48 100644 --- a/phpseclib/File/ASN1/Maps/GeneralName.php +++ b/phpseclib/File/ASN1/Maps/GeneralName.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * GeneralName diff --git a/phpseclib/File/ASN1/Maps/GeneralNames.php b/phpseclib/File/ASN1/Maps/GeneralNames.php index 263e2a2d..c8a3c89b 100644 --- a/phpseclib/File/ASN1/Maps/GeneralNames.php +++ b/phpseclib/File/ASN1/Maps/GeneralNames.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * GeneralNames diff --git a/phpseclib/File/ASN1/Maps/GeneralSubtree.php b/phpseclib/File/ASN1/Maps/GeneralSubtree.php index 6b42f034..15d95430 100644 --- a/phpseclib/File/ASN1/Maps/GeneralSubtree.php +++ b/phpseclib/File/ASN1/Maps/GeneralSubtree.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * GeneralSubtree diff --git a/phpseclib/File/ASN1/Maps/GeneralSubtrees.php b/phpseclib/File/ASN1/Maps/GeneralSubtrees.php index 4d3a948e..3b10265c 100644 --- a/phpseclib/File/ASN1/Maps/GeneralSubtrees.php +++ b/phpseclib/File/ASN1/Maps/GeneralSubtrees.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * GeneralSubtrees diff --git a/phpseclib/File/ASN1/Maps/HashAlgorithm.php b/phpseclib/File/ASN1/Maps/HashAlgorithm.php index 49e718ec..02f587d1 100644 --- a/phpseclib/File/ASN1/Maps/HashAlgorithm.php +++ b/phpseclib/File/ASN1/Maps/HashAlgorithm.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * HashAglorithm diff --git a/phpseclib/File/ASN1/Maps/HoldInstructionCode.php b/phpseclib/File/ASN1/Maps/HoldInstructionCode.php index fe4b991a..7d495961 100644 --- a/phpseclib/File/ASN1/Maps/HoldInstructionCode.php +++ b/phpseclib/File/ASN1/Maps/HoldInstructionCode.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * HoldInstructionCode diff --git a/phpseclib/File/ASN1/Maps/InvalidityDate.php b/phpseclib/File/ASN1/Maps/InvalidityDate.php index e776b5fb..0ae964ce 100644 --- a/phpseclib/File/ASN1/Maps/InvalidityDate.php +++ b/phpseclib/File/ASN1/Maps/InvalidityDate.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * InvalidityDate diff --git a/phpseclib/File/ASN1/Maps/IssuerAltName.php b/phpseclib/File/ASN1/Maps/IssuerAltName.php index 7d526636..5f71db8f 100644 --- a/phpseclib/File/ASN1/Maps/IssuerAltName.php +++ b/phpseclib/File/ASN1/Maps/IssuerAltName.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * IssuerAltName diff --git a/phpseclib/File/ASN1/Maps/IssuingDistributionPoint.php b/phpseclib/File/ASN1/Maps/IssuingDistributionPoint.php index 15c22501..f4b35b38 100644 --- a/phpseclib/File/ASN1/Maps/IssuingDistributionPoint.php +++ b/phpseclib/File/ASN1/Maps/IssuingDistributionPoint.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * IssuingDistributionPoint diff --git a/phpseclib/File/ASN1/Maps/KeyIdentifier.php b/phpseclib/File/ASN1/Maps/KeyIdentifier.php index caf16d85..eb2939b8 100644 --- a/phpseclib/File/ASN1/Maps/KeyIdentifier.php +++ b/phpseclib/File/ASN1/Maps/KeyIdentifier.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * KeyIdentifier diff --git a/phpseclib/File/ASN1/Maps/KeyPurposeId.php b/phpseclib/File/ASN1/Maps/KeyPurposeId.php index b401d7eb..7aee54ad 100644 --- a/phpseclib/File/ASN1/Maps/KeyPurposeId.php +++ b/phpseclib/File/ASN1/Maps/KeyPurposeId.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * KeyPurposeId diff --git a/phpseclib/File/ASN1/Maps/KeyUsage.php b/phpseclib/File/ASN1/Maps/KeyUsage.php index a743def6..abf599ed 100644 --- a/phpseclib/File/ASN1/Maps/KeyUsage.php +++ b/phpseclib/File/ASN1/Maps/KeyUsage.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * KeyUsage diff --git a/phpseclib/File/ASN1/Maps/MaskGenAlgorithm.php b/phpseclib/File/ASN1/Maps/MaskGenAlgorithm.php index b47bbddf..5e0e26f0 100644 --- a/phpseclib/File/ASN1/Maps/MaskGenAlgorithm.php +++ b/phpseclib/File/ASN1/Maps/MaskGenAlgorithm.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * MaskGenAglorithm diff --git a/phpseclib/File/ASN1/Maps/Name.php b/phpseclib/File/ASN1/Maps/Name.php index 22419743..a4ba82a0 100644 --- a/phpseclib/File/ASN1/Maps/Name.php +++ b/phpseclib/File/ASN1/Maps/Name.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * Name diff --git a/phpseclib/File/ASN1/Maps/NameConstraints.php b/phpseclib/File/ASN1/Maps/NameConstraints.php index 0f3d8c46..518e68f6 100644 --- a/phpseclib/File/ASN1/Maps/NameConstraints.php +++ b/phpseclib/File/ASN1/Maps/NameConstraints.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * NameConstraints diff --git a/phpseclib/File/ASN1/Maps/NetworkAddress.php b/phpseclib/File/ASN1/Maps/NetworkAddress.php index 2edab3c8..a67c0276 100644 --- a/phpseclib/File/ASN1/Maps/NetworkAddress.php +++ b/phpseclib/File/ASN1/Maps/NetworkAddress.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * NetworkAddress diff --git a/phpseclib/File/ASN1/Maps/NoticeReference.php b/phpseclib/File/ASN1/Maps/NoticeReference.php index 66aa93b6..cea26773 100644 --- a/phpseclib/File/ASN1/Maps/NoticeReference.php +++ b/phpseclib/File/ASN1/Maps/NoticeReference.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * NoticeReference diff --git a/phpseclib/File/ASN1/Maps/NumericUserIdentifier.php b/phpseclib/File/ASN1/Maps/NumericUserIdentifier.php index 9ed3d717..04998393 100644 --- a/phpseclib/File/ASN1/Maps/NumericUserIdentifier.php +++ b/phpseclib/File/ASN1/Maps/NumericUserIdentifier.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * NumericUserIdentifier diff --git a/phpseclib/File/ASN1/Maps/ORAddress.php b/phpseclib/File/ASN1/Maps/ORAddress.php index e3119a46..cde7b3d6 100644 --- a/phpseclib/File/ASN1/Maps/ORAddress.php +++ b/phpseclib/File/ASN1/Maps/ORAddress.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * ORAddress diff --git a/phpseclib/File/ASN1/Maps/OneAsymmetricKey.php b/phpseclib/File/ASN1/Maps/OneAsymmetricKey.php index 73af0695..9a5c1687 100644 --- a/phpseclib/File/ASN1/Maps/OneAsymmetricKey.php +++ b/phpseclib/File/ASN1/Maps/OneAsymmetricKey.php @@ -15,9 +15,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * OneAsymmetricKey diff --git a/phpseclib/File/ASN1/Maps/OrganizationName.php b/phpseclib/File/ASN1/Maps/OrganizationName.php index 04dd9d1b..250c9277 100644 --- a/phpseclib/File/ASN1/Maps/OrganizationName.php +++ b/phpseclib/File/ASN1/Maps/OrganizationName.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * OrganizationName diff --git a/phpseclib/File/ASN1/Maps/OrganizationalUnitNames.php b/phpseclib/File/ASN1/Maps/OrganizationalUnitNames.php index 8a36c988..eb2ac677 100644 --- a/phpseclib/File/ASN1/Maps/OrganizationalUnitNames.php +++ b/phpseclib/File/ASN1/Maps/OrganizationalUnitNames.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * OrganizationalUnitNames diff --git a/phpseclib/File/ASN1/Maps/OtherPrimeInfo.php b/phpseclib/File/ASN1/Maps/OtherPrimeInfo.php index 1ff4bc51..d75fa3f7 100644 --- a/phpseclib/File/ASN1/Maps/OtherPrimeInfo.php +++ b/phpseclib/File/ASN1/Maps/OtherPrimeInfo.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * OtherPrimeInfo diff --git a/phpseclib/File/ASN1/Maps/OtherPrimeInfos.php b/phpseclib/File/ASN1/Maps/OtherPrimeInfos.php index 3a4ebd2d..bb833171 100644 --- a/phpseclib/File/ASN1/Maps/OtherPrimeInfos.php +++ b/phpseclib/File/ASN1/Maps/OtherPrimeInfos.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * OtherPrimeInfos diff --git a/phpseclib/File/ASN1/Maps/PBEParameter.php b/phpseclib/File/ASN1/Maps/PBEParameter.php index 174a84d8..bd17291f 100644 --- a/phpseclib/File/ASN1/Maps/PBEParameter.php +++ b/phpseclib/File/ASN1/Maps/PBEParameter.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * PBEParameter diff --git a/phpseclib/File/ASN1/Maps/PBES2params.php b/phpseclib/File/ASN1/Maps/PBES2params.php index 3c50fe92..1d807db7 100644 --- a/phpseclib/File/ASN1/Maps/PBES2params.php +++ b/phpseclib/File/ASN1/Maps/PBES2params.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * PBES2params diff --git a/phpseclib/File/ASN1/Maps/PBKDF2params.php b/phpseclib/File/ASN1/Maps/PBKDF2params.php index 3d0d4501..16d37a95 100644 --- a/phpseclib/File/ASN1/Maps/PBKDF2params.php +++ b/phpseclib/File/ASN1/Maps/PBKDF2params.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * PBKDF2params diff --git a/phpseclib/File/ASN1/Maps/PBMAC1params.php b/phpseclib/File/ASN1/Maps/PBMAC1params.php index ec46ebde..f375aa16 100644 --- a/phpseclib/File/ASN1/Maps/PBMAC1params.php +++ b/phpseclib/File/ASN1/Maps/PBMAC1params.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * PBMAC1params diff --git a/phpseclib/File/ASN1/Maps/PKCS9String.php b/phpseclib/File/ASN1/Maps/PKCS9String.php index 9cbceae8..11c638bd 100644 --- a/phpseclib/File/ASN1/Maps/PKCS9String.php +++ b/phpseclib/File/ASN1/Maps/PKCS9String.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * PKCS9String diff --git a/phpseclib/File/ASN1/Maps/Pentanomial.php b/phpseclib/File/ASN1/Maps/Pentanomial.php index 2474680e..493cd299 100644 --- a/phpseclib/File/ASN1/Maps/Pentanomial.php +++ b/phpseclib/File/ASN1/Maps/Pentanomial.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * Pentanomial diff --git a/phpseclib/File/ASN1/Maps/PersonalName.php b/phpseclib/File/ASN1/Maps/PersonalName.php index c308bfdb..c9492c9e 100644 --- a/phpseclib/File/ASN1/Maps/PersonalName.php +++ b/phpseclib/File/ASN1/Maps/PersonalName.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * PersonalName diff --git a/phpseclib/File/ASN1/Maps/PolicyInformation.php b/phpseclib/File/ASN1/Maps/PolicyInformation.php index 7d89f43b..cfda3990 100644 --- a/phpseclib/File/ASN1/Maps/PolicyInformation.php +++ b/phpseclib/File/ASN1/Maps/PolicyInformation.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * PolicyInformation diff --git a/phpseclib/File/ASN1/Maps/PolicyMappings.php b/phpseclib/File/ASN1/Maps/PolicyMappings.php index eaa5b497..c1086477 100644 --- a/phpseclib/File/ASN1/Maps/PolicyMappings.php +++ b/phpseclib/File/ASN1/Maps/PolicyMappings.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * PolicyMappings diff --git a/phpseclib/File/ASN1/Maps/PolicyQualifierId.php b/phpseclib/File/ASN1/Maps/PolicyQualifierId.php index e657d2ce..454a9d1a 100644 --- a/phpseclib/File/ASN1/Maps/PolicyQualifierId.php +++ b/phpseclib/File/ASN1/Maps/PolicyQualifierId.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * PolicyQualifierId diff --git a/phpseclib/File/ASN1/Maps/PolicyQualifierInfo.php b/phpseclib/File/ASN1/Maps/PolicyQualifierInfo.php index 83fc872e..a1d7e172 100644 --- a/phpseclib/File/ASN1/Maps/PolicyQualifierInfo.php +++ b/phpseclib/File/ASN1/Maps/PolicyQualifierInfo.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * PolicyQualifierInfo diff --git a/phpseclib/File/ASN1/Maps/PostalAddress.php b/phpseclib/File/ASN1/Maps/PostalAddress.php index 2a0e446d..ec8354fa 100644 --- a/phpseclib/File/ASN1/Maps/PostalAddress.php +++ b/phpseclib/File/ASN1/Maps/PostalAddress.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * PostalAddress diff --git a/phpseclib/File/ASN1/Maps/Prime_p.php b/phpseclib/File/ASN1/Maps/Prime_p.php index fe107750..09c8006b 100644 --- a/phpseclib/File/ASN1/Maps/Prime_p.php +++ b/phpseclib/File/ASN1/Maps/Prime_p.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * Prime_p diff --git a/phpseclib/File/ASN1/Maps/PrivateDomainName.php b/phpseclib/File/ASN1/Maps/PrivateDomainName.php index 16ffc539..b26c0cba 100644 --- a/phpseclib/File/ASN1/Maps/PrivateDomainName.php +++ b/phpseclib/File/ASN1/Maps/PrivateDomainName.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * PrivateDomainName diff --git a/phpseclib/File/ASN1/Maps/PrivateKey.php b/phpseclib/File/ASN1/Maps/PrivateKey.php index e8e4409a..7670f4ad 100644 --- a/phpseclib/File/ASN1/Maps/PrivateKey.php +++ b/phpseclib/File/ASN1/Maps/PrivateKey.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * PrivateKey diff --git a/phpseclib/File/ASN1/Maps/PrivateKeyInfo.php b/phpseclib/File/ASN1/Maps/PrivateKeyInfo.php index 04b6a22e..170f6f27 100644 --- a/phpseclib/File/ASN1/Maps/PrivateKeyInfo.php +++ b/phpseclib/File/ASN1/Maps/PrivateKeyInfo.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * PrivateKeyInfo diff --git a/phpseclib/File/ASN1/Maps/PrivateKeyUsagePeriod.php b/phpseclib/File/ASN1/Maps/PrivateKeyUsagePeriod.php index 3d994199..8c396a00 100644 --- a/phpseclib/File/ASN1/Maps/PrivateKeyUsagePeriod.php +++ b/phpseclib/File/ASN1/Maps/PrivateKeyUsagePeriod.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * PrivateKeyUsagePeriod diff --git a/phpseclib/File/ASN1/Maps/PublicKey.php b/phpseclib/File/ASN1/Maps/PublicKey.php index 1f269480..b8239aa6 100644 --- a/phpseclib/File/ASN1/Maps/PublicKey.php +++ b/phpseclib/File/ASN1/Maps/PublicKey.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * PublicKey diff --git a/phpseclib/File/ASN1/Maps/PublicKeyAndChallenge.php b/phpseclib/File/ASN1/Maps/PublicKeyAndChallenge.php index 18a0e7d3..ef212812 100644 --- a/phpseclib/File/ASN1/Maps/PublicKeyAndChallenge.php +++ b/phpseclib/File/ASN1/Maps/PublicKeyAndChallenge.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * PublicKeyAndChallenge diff --git a/phpseclib/File/ASN1/Maps/PublicKeyInfo.php b/phpseclib/File/ASN1/Maps/PublicKeyInfo.php index 8f8b8966..587230bc 100644 --- a/phpseclib/File/ASN1/Maps/PublicKeyInfo.php +++ b/phpseclib/File/ASN1/Maps/PublicKeyInfo.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * PublicKeyInfo diff --git a/phpseclib/File/ASN1/Maps/RC2CBCParameter.php b/phpseclib/File/ASN1/Maps/RC2CBCParameter.php index 59254c0e..3697f103 100644 --- a/phpseclib/File/ASN1/Maps/RC2CBCParameter.php +++ b/phpseclib/File/ASN1/Maps/RC2CBCParameter.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * RC2CBCParameter diff --git a/phpseclib/File/ASN1/Maps/RDNSequence.php b/phpseclib/File/ASN1/Maps/RDNSequence.php index e9197d64..848e2c93 100644 --- a/phpseclib/File/ASN1/Maps/RDNSequence.php +++ b/phpseclib/File/ASN1/Maps/RDNSequence.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * RDNSequence diff --git a/phpseclib/File/ASN1/Maps/RSAPrivateKey.php b/phpseclib/File/ASN1/Maps/RSAPrivateKey.php index a7f06a49..fbbb0f7c 100644 --- a/phpseclib/File/ASN1/Maps/RSAPrivateKey.php +++ b/phpseclib/File/ASN1/Maps/RSAPrivateKey.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * RSAPrivateKey diff --git a/phpseclib/File/ASN1/Maps/RSAPublicKey.php b/phpseclib/File/ASN1/Maps/RSAPublicKey.php index 15a0da75..1ea441d0 100644 --- a/phpseclib/File/ASN1/Maps/RSAPublicKey.php +++ b/phpseclib/File/ASN1/Maps/RSAPublicKey.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * RSAPublicKey diff --git a/phpseclib/File/ASN1/Maps/RSASSA_PSS_params.php b/phpseclib/File/ASN1/Maps/RSASSA_PSS_params.php index 12d72d24..b9ad46b0 100644 --- a/phpseclib/File/ASN1/Maps/RSASSA_PSS_params.php +++ b/phpseclib/File/ASN1/Maps/RSASSA_PSS_params.php @@ -15,9 +15,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * RSASSA_PSS_params diff --git a/phpseclib/File/ASN1/Maps/ReasonFlags.php b/phpseclib/File/ASN1/Maps/ReasonFlags.php index 4ba69dfd..3cb32c48 100644 --- a/phpseclib/File/ASN1/Maps/ReasonFlags.php +++ b/phpseclib/File/ASN1/Maps/ReasonFlags.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * ReasonFlags diff --git a/phpseclib/File/ASN1/Maps/RelativeDistinguishedName.php b/phpseclib/File/ASN1/Maps/RelativeDistinguishedName.php index f9034586..de9dfaf6 100644 --- a/phpseclib/File/ASN1/Maps/RelativeDistinguishedName.php +++ b/phpseclib/File/ASN1/Maps/RelativeDistinguishedName.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * RelativeDistinguishedName diff --git a/phpseclib/File/ASN1/Maps/RevokedCertificate.php b/phpseclib/File/ASN1/Maps/RevokedCertificate.php index f5b9c02b..b012d9df 100644 --- a/phpseclib/File/ASN1/Maps/RevokedCertificate.php +++ b/phpseclib/File/ASN1/Maps/RevokedCertificate.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * RevokedCertificate diff --git a/phpseclib/File/ASN1/Maps/SignedPublicKeyAndChallenge.php b/phpseclib/File/ASN1/Maps/SignedPublicKeyAndChallenge.php index b7e3efbd..c3591e2f 100644 --- a/phpseclib/File/ASN1/Maps/SignedPublicKeyAndChallenge.php +++ b/phpseclib/File/ASN1/Maps/SignedPublicKeyAndChallenge.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * SignedPublicKeyAndChallenge diff --git a/phpseclib/File/ASN1/Maps/SpecifiedECDomain.php b/phpseclib/File/ASN1/Maps/SpecifiedECDomain.php index b44541e2..fb437eab 100644 --- a/phpseclib/File/ASN1/Maps/SpecifiedECDomain.php +++ b/phpseclib/File/ASN1/Maps/SpecifiedECDomain.php @@ -15,9 +15,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * SpecifiedECDomain diff --git a/phpseclib/File/ASN1/Maps/SubjectAltName.php b/phpseclib/File/ASN1/Maps/SubjectAltName.php index 65ecbf7a..02d2d6d4 100644 --- a/phpseclib/File/ASN1/Maps/SubjectAltName.php +++ b/phpseclib/File/ASN1/Maps/SubjectAltName.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * SubjectAltName diff --git a/phpseclib/File/ASN1/Maps/SubjectDirectoryAttributes.php b/phpseclib/File/ASN1/Maps/SubjectDirectoryAttributes.php index bba456a6..1eff925a 100644 --- a/phpseclib/File/ASN1/Maps/SubjectDirectoryAttributes.php +++ b/phpseclib/File/ASN1/Maps/SubjectDirectoryAttributes.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * SubjectDirectoryAttributes diff --git a/phpseclib/File/ASN1/Maps/SubjectInfoAccessSyntax.php b/phpseclib/File/ASN1/Maps/SubjectInfoAccessSyntax.php index c395ca1a..98ab3ddd 100644 --- a/phpseclib/File/ASN1/Maps/SubjectInfoAccessSyntax.php +++ b/phpseclib/File/ASN1/Maps/SubjectInfoAccessSyntax.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * SubjectInfoAccessSyntax diff --git a/phpseclib/File/ASN1/Maps/SubjectPublicKeyInfo.php b/phpseclib/File/ASN1/Maps/SubjectPublicKeyInfo.php index 2ccd9076..c367608c 100644 --- a/phpseclib/File/ASN1/Maps/SubjectPublicKeyInfo.php +++ b/phpseclib/File/ASN1/Maps/SubjectPublicKeyInfo.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * SubjectPublicKeyInfo diff --git a/phpseclib/File/ASN1/Maps/TBSCertList.php b/phpseclib/File/ASN1/Maps/TBSCertList.php index df9549a3..49be58eb 100644 --- a/phpseclib/File/ASN1/Maps/TBSCertList.php +++ b/phpseclib/File/ASN1/Maps/TBSCertList.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * TBSCertList diff --git a/phpseclib/File/ASN1/Maps/TBSCertificate.php b/phpseclib/File/ASN1/Maps/TBSCertificate.php index b0567446..dc5fe2aa 100644 --- a/phpseclib/File/ASN1/Maps/TBSCertificate.php +++ b/phpseclib/File/ASN1/Maps/TBSCertificate.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * TBSCertificate diff --git a/phpseclib/File/ASN1/Maps/TerminalIdentifier.php b/phpseclib/File/ASN1/Maps/TerminalIdentifier.php index be191dfd..5c6fdddb 100644 --- a/phpseclib/File/ASN1/Maps/TerminalIdentifier.php +++ b/phpseclib/File/ASN1/Maps/TerminalIdentifier.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * TerminalIdentifier diff --git a/phpseclib/File/ASN1/Maps/Time.php b/phpseclib/File/ASN1/Maps/Time.php index 6b1389a3..a673c3af 100644 --- a/phpseclib/File/ASN1/Maps/Time.php +++ b/phpseclib/File/ASN1/Maps/Time.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * Time diff --git a/phpseclib/File/ASN1/Maps/Trinomial.php b/phpseclib/File/ASN1/Maps/Trinomial.php index 3e0dac82..7cd4ba27 100644 --- a/phpseclib/File/ASN1/Maps/Trinomial.php +++ b/phpseclib/File/ASN1/Maps/Trinomial.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * Trinomial diff --git a/phpseclib/File/ASN1/Maps/UniqueIdentifier.php b/phpseclib/File/ASN1/Maps/UniqueIdentifier.php index 68e46bab..64645773 100644 --- a/phpseclib/File/ASN1/Maps/UniqueIdentifier.php +++ b/phpseclib/File/ASN1/Maps/UniqueIdentifier.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * UniqueIdentifier diff --git a/phpseclib/File/ASN1/Maps/UserNotice.php b/phpseclib/File/ASN1/Maps/UserNotice.php index 296670ef..2a0c8654 100644 --- a/phpseclib/File/ASN1/Maps/UserNotice.php +++ b/phpseclib/File/ASN1/Maps/UserNotice.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * UserNotice diff --git a/phpseclib/File/ASN1/Maps/Validity.php b/phpseclib/File/ASN1/Maps/Validity.php index 65199bda..040aa7f5 100644 --- a/phpseclib/File/ASN1/Maps/Validity.php +++ b/phpseclib/File/ASN1/Maps/Validity.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * Validity diff --git a/phpseclib/File/ASN1/Maps/netscape_ca_policy_url.php b/phpseclib/File/ASN1/Maps/netscape_ca_policy_url.php index 88e3a54a..1da389a7 100644 --- a/phpseclib/File/ASN1/Maps/netscape_ca_policy_url.php +++ b/phpseclib/File/ASN1/Maps/netscape_ca_policy_url.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * netscape_ca_policy_url diff --git a/phpseclib/File/ASN1/Maps/netscape_cert_type.php b/phpseclib/File/ASN1/Maps/netscape_cert_type.php index 833e40bc..c5845b59 100644 --- a/phpseclib/File/ASN1/Maps/netscape_cert_type.php +++ b/phpseclib/File/ASN1/Maps/netscape_cert_type.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * netscape_cert_type diff --git a/phpseclib/File/ASN1/Maps/netscape_comment.php b/phpseclib/File/ASN1/Maps/netscape_comment.php index 266d6e76..8ff14dac 100644 --- a/phpseclib/File/ASN1/Maps/netscape_comment.php +++ b/phpseclib/File/ASN1/Maps/netscape_comment.php @@ -13,9 +13,9 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File\ASN1\Maps; +namespace phpseclib3\File\ASN1\Maps; -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; /** * netscape_comment diff --git a/phpseclib/File/X509.php b/phpseclib/File/X509.php index ca7b3987..4ae21291 100644 --- a/phpseclib/File/X509.php +++ b/phpseclib/File/X509.php @@ -24,21 +24,21 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\File; +namespace phpseclib3\File; use ParagonIE\ConstantTime\Base64; use ParagonIE\ConstantTime\Hex; -use phpseclib\Crypt\Hash; -use phpseclib\Crypt\Random; -use phpseclib\Crypt\RSA; -use phpseclib\Crypt\DSA; -use phpseclib\Crypt\EC; -use phpseclib\Crypt\Common\PublicKey; -use phpseclib\Crypt\Common\PrivateKey; -use phpseclib\Exception\UnsupportedAlgorithmException; -use phpseclib\File\ASN1\Element; -use phpseclib\Math\BigInteger; -use phpseclib\File\ASN1\Maps; +use phpseclib3\Crypt\Hash; +use phpseclib3\Crypt\Random; +use phpseclib3\Crypt\RSA; +use phpseclib3\Crypt\DSA; +use phpseclib3\Crypt\EC; +use phpseclib3\Crypt\Common\PublicKey; +use phpseclib3\Crypt\Common\PrivateKey; +use phpseclib3\Exception\UnsupportedAlgorithmException; +use phpseclib3\File\ASN1\Element; +use phpseclib3\Math\BigInteger; +use phpseclib3\File\ASN1\Maps; use DateTime; use DateTimeZone; @@ -62,7 +62,7 @@ class X509 /**#@+ * @access public - * @see \phpseclib\File\X509::getDN() + * @see \phpseclib3\File\X509::getDN() */ /** * Return internal array representation @@ -92,9 +92,9 @@ class X509 /**#@+ * @access public - * @see \phpseclib\File\X509::saveX509() - * @see \phpseclib\File\X509::saveCSR() - * @see \phpseclib\File\X509::saveCRL() + * @see \phpseclib3\File\X509::saveX509() + * @see \phpseclib3\File\X509::saveCSR() + * @see \phpseclib3\File\X509::saveCRL() */ /** * Save as PEM @@ -180,7 +180,7 @@ class X509 /** * The signature subject * - * There's no guarantee \phpseclib\File\X509 is going to re-encode an X.509 cert in the same way it was originally + * There's no guarantee \phpseclib3\File\X509 is going to re-encode an X.509 cert in the same way it was originally * encoded so we take save the portion of the original cert that the signature would have made for. * * @var string @@ -266,7 +266,7 @@ class X509 /** * Default Constructor. * - * @return \phpseclib\File\X509 + * @return \phpseclib3\File\X509 * @access public */ public function __construct() @@ -530,8 +530,8 @@ class X509 $filters['distributionPoint']['fullName']['directoryName']['rdnSequence']['value'] = $type_utf8_string; $filters['directoryName']['rdnSequence']['value'] = $type_utf8_string; - /* in the case of policyQualifiers/qualifier, the type has to be \phpseclib\File\ASN1::TYPE_IA5_STRING. - \phpseclib\File\ASN1::TYPE_PRINTABLE_STRING will cause OpenSSL's X.509 parser to spit out random + /* in the case of policyQualifiers/qualifier, the type has to be \phpseclib3\File\ASN1::TYPE_IA5_STRING. + \phpseclib3\File\ASN1::TYPE_PRINTABLE_STRING will cause OpenSSL's X.509 parser to spit out random characters. */ $filters['policyQualifiers']['qualifier'] @@ -636,8 +636,8 @@ class X509 $map = $this->getMapping($subid); $subvalue = &$value[$j]['policyQualifiers'][$k]['qualifier']; if ($map !== false) { - // by default \phpseclib\File\ASN1 will try to render qualifier as a \phpseclib\File\ASN1::TYPE_IA5_STRING since it's - // actual type is \phpseclib\File\ASN1::TYPE_ANY + // by default \phpseclib3\File\ASN1 will try to render qualifier as a \phpseclib3\File\ASN1::TYPE_IA5_STRING since it's + // actual type is \phpseclib3\File\ASN1::TYPE_ANY $subvalue = new Element(ASN1::encodeDER($subvalue, $map)); } } @@ -818,7 +818,7 @@ class X509 */ private function getMapping($extnId) { - if (!is_string($extnId)) { // eg. if it's a \phpseclib\File\ASN1\Element object + if (!is_string($extnId)) { // eg. if it's a \phpseclib3\File\ASN1\Element object return true; } @@ -1354,7 +1354,7 @@ class X509 * @param string $signature * @param string $signatureSubject * @access private - * @throws \phpseclib\Exception\UnsupportedAlgorithmException if the algorithm is unsupported + * @throws \phpseclib3\Exception\UnsupportedAlgorithmException if the algorithm is unsupported * @return bool */ private function validateSignatureHelper($publicKeyAlgorithm, $publicKey, $signatureAlgorithm, $signature, $signatureSubject) @@ -2044,7 +2044,7 @@ class X509 /** * Set public key * - * Key needs to be a \phpseclib\Crypt\RSA object + * Key needs to be a \phpseclib3\Crypt\RSA object * * @param object $key * @access public @@ -2058,7 +2058,7 @@ class X509 /** * Set private key * - * Key needs to be a \phpseclib\Crypt\RSA object + * Key needs to be a \phpseclib3\Crypt\RSA object * * @param object $key * @access public @@ -2084,7 +2084,7 @@ class X509 /** * Gets the public key * - * Returns a \phpseclib\Crypt\RSA object or a false. + * Returns a \phpseclib3\Crypt\RSA object or a false. * * @access public * @return mixed @@ -2501,8 +2501,8 @@ class X509 * $subject can be either an existing X.509 cert (if you want to resign it), * a CSR or something with the DN and public key explicitly set. * - * @param \phpseclib\File\X509 $issuer - * @param \phpseclib\File\X509 $subject + * @param \phpseclib3\File\X509 $issuer + * @param \phpseclib3\File\X509 $subject * @param string $signatureAlgorithm optional * @access public * @return mixed @@ -2620,7 +2620,7 @@ class X509 $altName = []; if (isset($subject->domains) && count($subject->domains)) { - $altName = array_map(['\phpseclib\File\X509', 'dnsName'], $subject->domains); + $altName = array_map(['\phpseclib3\File\X509', 'dnsName'], $subject->domains); } if (isset($subject->ipAddresses) && count($subject->ipAddresses)) { @@ -2670,7 +2670,7 @@ class X509 } // resync $this->signatureSubject - // save $tbsCertificate in case there are any \phpseclib\File\ASN1\Element objects in it + // save $tbsCertificate in case there are any \phpseclib3\File\ASN1\Element objects in it $tbsCertificate = $this->currentCert['tbsCertificate']; $this->loadX509($this->saveX509($this->currentCert)); @@ -2726,7 +2726,7 @@ class X509 } // resync $this->signatureSubject - // save $certificationRequestInfo in case there are any \phpseclib\File\ASN1\Element objects in it + // save $certificationRequestInfo in case there are any \phpseclib3\File\ASN1\Element objects in it $certificationRequestInfo = $this->currentCert['certificationRequestInfo']; $this->loadCSR($this->saveCSR($this->currentCert)); @@ -2788,7 +2788,7 @@ class X509 } // resync $this->signatureSubject - // save $publicKeyAndChallenge in case there are any \phpseclib\File\ASN1\Element objects in it + // save $publicKeyAndChallenge in case there are any \phpseclib3\File\ASN1\Element objects in it $publicKeyAndChallenge = $this->currentCert['publicKeyAndChallenge']; $this->loadSPKAC($this->saveSPKAC($this->currentCert)); @@ -2807,8 +2807,8 @@ class X509 * * $issuer's private key needs to be loaded. * - * @param \phpseclib\File\X509 $issuer - * @param \phpseclib\File\X509 $crl + * @param \phpseclib3\File\X509 $issuer + * @param \phpseclib3\File\X509 $crl * @param string $signatureAlgorithm optional * @access public * @return mixed @@ -2923,7 +2923,7 @@ class X509 unset($tbsCertList); // resync $this->signatureSubject - // save $tbsCertList in case there are any \phpseclib\File\ASN1\Element objects in it + // save $tbsCertList in case there are any \phpseclib3\File\ASN1\Element objects in it $tbsCertList = $this->currentCert['tbsCertList']; $this->loadCRL($this->saveCRL($this->currentCert)); @@ -2942,7 +2942,7 @@ class X509 * * @param object $key * @access private - * @throws \phpseclib\Exception\UnsupportedAlgorithmException if the algorithm is unsupported + * @throws \phpseclib3\Exception\UnsupportedAlgorithmException if the algorithm is unsupported * @return string */ private static function identifySignatureAlgorithm(PrivateKey $key) @@ -3590,9 +3590,9 @@ class X509 * recommended methods (4.2.1.2 RFC 3280). * Highly polymorphic: try to accept all possible forms of key: * - Key object - * - \phpseclib\File\X509 object with public or private key defined + * - \phpseclib3\File\X509 object with public or private key defined * - Certificate or CSR array - * - \phpseclib\File\ASN1\Element object + * - \phpseclib3\File\ASN1\Element object * - PEM or DER string * * @param mixed $key optional @@ -3646,7 +3646,7 @@ class X509 return $this->computeKeyIdentifier($key->currentCert, $method); } return false; - default: // Should be a key object (i.e.: \phpseclib\Crypt\RSA). + default: // Should be a key object (i.e.: \phpseclib3\Crypt\RSA). $key = $key->getPublicKey(); break; } diff --git a/phpseclib/Math/BigInteger.php b/phpseclib/Math/BigInteger.php index a9163b2b..5b3ade34 100644 --- a/phpseclib/Math/BigInteger.php +++ b/phpseclib/Math/BigInteger.php @@ -11,8 +11,8 @@ * Here's an example of how to use this library: * * add($b); * @@ -27,9 +27,9 @@ * @license http://www.opensource.org/licenses/mit-license.html MIT License */ -namespace phpseclib\Math; +namespace phpseclib3\Math; -use phpseclib\Exception\BadConfigurationException; +use phpseclib3\Exception\BadConfigurationException; /** * Pure-PHP arbitrary precision integer arithmetic library. Supports base-2, base-10, base-16, and base-256 @@ -81,7 +81,7 @@ class BigInteger implements \Serializable { self::$engines = []; - $fqmain = 'phpseclib\\Math\\BigInteger\\Engines\\' . $main; + $fqmain = 'phpseclib3\\Math\\BigInteger\\Engines\\' . $main; if (!class_exists($fqmain) || !method_exists($fqmain, 'isValidEngine')) { throw new \InvalidArgumentException("$main is not a valid engine"); } @@ -279,8 +279,8 @@ class BigInteger implements \Serializable * Here's an example: * * divide($b); * @@ -852,7 +852,7 @@ class BigInteger implements \Serializable * Splits BigInteger's into chunks of $split bits * * @param int $split - * @return \phpseclib\Math\BigInteger[] + * @return \phpseclib3\Math\BigInteger[] */ public function bitwise_split($split) { diff --git a/phpseclib/Math/BigInteger/Engines/BCMath.php b/phpseclib/Math/BigInteger/Engines/BCMath.php index 75de6d78..84c249b2 100644 --- a/phpseclib/Math/BigInteger/Engines/BCMath.php +++ b/phpseclib/Math/BigInteger/Engines/BCMath.php @@ -13,10 +13,10 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Math\BigInteger\Engines; +namespace phpseclib3\Math\BigInteger\Engines; use ParagonIE\ConstantTime\Hex; -use phpseclib\Exception\BadConfigurationException; +use phpseclib3\Exception\BadConfigurationException; /** * BCMath Engine. @@ -61,21 +61,21 @@ class BCMath extends Engine /** * BigInteger(0) * - * @var \phpseclib\Math\BigInteger\Engines\BCMath + * @var \phpseclib3\Math\BigInteger\Engines\BCMath */ protected static $zero; /** * BigInteger(1) * - * @var \phpseclib\Math\BigInteger\Engines\BCMath + * @var \phpseclib3\Math\BigInteger\Engines\BCMath */ protected static $one; /** * BigInteger(2) * - * @var \phpseclib\Math\BigInteger\Engines\BCMath + * @var \phpseclib3\Math\BigInteger\Engines\BCMath */ protected static $two; @@ -103,7 +103,7 @@ class BCMath extends Engine * @param mixed $x integer Base-10 number or base-$base number if $base set. * @param int $base * @see parent::__construct() - * @return \phpseclib\Math\BigInteger\Engines\BCMath + * @return \phpseclib3\Math\BigInteger\Engines\BCMath */ public function __construct($x = 0, $base = 10) { @@ -275,7 +275,7 @@ class BCMath extends Engine * Say you have (30 mod 17 * x mod 17) mod 17 == 1. x can be found using modular inverses. * * @return false|BCMath - * @param \phpseclib\Math\BigInteger\Engines\BCMath $n + * @param \phpseclib3\Math\BigInteger\Engines\BCMath $n */ public function modInverse(BCMath $n) { @@ -348,7 +348,7 @@ class BCMath extends Engine /** * Absolute value. * - * @return \phpseclib\Math\BigInteger\Engines\BCMath + * @return \phpseclib3\Math\BigInteger\Engines\BCMath */ public function abs() { @@ -399,7 +399,7 @@ class BCMath extends Engine * Shifts BigInteger's by $shift bits, effectively dividing by 2**$shift. * * @param int $shift - * @return \phpseclib\Math\BigInteger\Engines\BCMath + * @return \phpseclib3\Math\BigInteger\Engines\BCMath */ public function bitwise_rightShift($shift) { @@ -415,7 +415,7 @@ class BCMath extends Engine * Shifts BigInteger's by $shift bits, effectively multiplying by 2**$shift. * * @param int $shift - * @return \phpseclib\Math\BigInteger\Engines\BCMath + * @return \phpseclib3\Math\BigInteger\Engines\BCMath */ public function bitwise_leftShift($shift) { diff --git a/phpseclib/Math/BigInteger/Engines/BCMath/Base.php b/phpseclib/Math/BigInteger/Engines/BCMath/Base.php index d2c1314d..595c39cf 100644 --- a/phpseclib/Math/BigInteger/Engines/BCMath/Base.php +++ b/phpseclib/Math/BigInteger/Engines/BCMath/Base.php @@ -13,9 +13,9 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Math\BigInteger\Engines\BCMath; +namespace phpseclib3\Math\BigInteger\Engines\BCMath; -use phpseclib\Math\BigInteger\Engines\BCMath; +use phpseclib3\Math\BigInteger\Engines\BCMath; /** * Sliding Window Exponentiation Engine @@ -54,11 +54,11 @@ abstract class Base extends BCMath /** * Performs modular exponentiation. * - * @param \phpseclib\Math\BigInteger\Engines\BCMath $x - * @param \phpseclib\Math\BigInteger\Engines\BCMath $e - * @param \phpseclib\Math\BigInteger\Engines\BCMath $n + * @param \phpseclib3\Math\BigInteger\Engines\BCMath $x + * @param \phpseclib3\Math\BigInteger\Engines\BCMath $e + * @param \phpseclib3\Math\BigInteger\Engines\BCMath $n * @param string $class - * @return \phpseclib\Math\BigInteger\Engines\BCMath + * @return \phpseclib3\Math\BigInteger\Engines\BCMath */ protected static function powModHelper(BCMath $x, BCMath $e, BCMath $n, $class) { diff --git a/phpseclib/Math/BigInteger/Engines/BCMath/BuiltIn.php b/phpseclib/Math/BigInteger/Engines/BCMath/BuiltIn.php index cb9ed1c4..f312be15 100644 --- a/phpseclib/Math/BigInteger/Engines/BCMath/BuiltIn.php +++ b/phpseclib/Math/BigInteger/Engines/BCMath/BuiltIn.php @@ -13,9 +13,9 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Math\BigInteger\Engines\BCMath; +namespace phpseclib3\Math\BigInteger\Engines\BCMath; -use phpseclib\Math\BigInteger\Engines\BCMath; +use phpseclib3\Math\BigInteger\Engines\BCMath; /** * Built-In BCMath Modular Exponentiation Engine diff --git a/phpseclib/Math/BigInteger/Engines/BCMath/DefaultEngine.php b/phpseclib/Math/BigInteger/Engines/BCMath/DefaultEngine.php index 6a3b1331..a6d175f5 100644 --- a/phpseclib/Math/BigInteger/Engines/BCMath/DefaultEngine.php +++ b/phpseclib/Math/BigInteger/Engines/BCMath/DefaultEngine.php @@ -13,9 +13,9 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Math\BigInteger\Engines\BCMath; +namespace phpseclib3\Math\BigInteger\Engines\BCMath; -use phpseclib\Math\BigInteger\Engines\BCMath\Reductions\Barrett; +use phpseclib3\Math\BigInteger\Engines\BCMath\Reductions\Barrett; /** * PHP Default Modular Exponentiation Engine diff --git a/phpseclib/Math/BigInteger/Engines/BCMath/OpenSSL.php b/phpseclib/Math/BigInteger/Engines/BCMath/OpenSSL.php index 1187240f..df7c965d 100644 --- a/phpseclib/Math/BigInteger/Engines/BCMath/OpenSSL.php +++ b/phpseclib/Math/BigInteger/Engines/BCMath/OpenSSL.php @@ -13,9 +13,9 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Math\BigInteger\Engines\BCMath; +namespace phpseclib3\Math\BigInteger\Engines\BCMath; -use phpseclib\Math\BigInteger\Engines\OpenSSL as Progenitor; +use phpseclib3\Math\BigInteger\Engines\OpenSSL as Progenitor; /** * OpenSSL Modular Exponentiation Engine diff --git a/phpseclib/Math/BigInteger/Engines/BCMath/Reductions/Barrett.php b/phpseclib/Math/BigInteger/Engines/BCMath/Reductions/Barrett.php index f858ce17..ef571dc7 100644 --- a/phpseclib/Math/BigInteger/Engines/BCMath/Reductions/Barrett.php +++ b/phpseclib/Math/BigInteger/Engines/BCMath/Reductions/Barrett.php @@ -13,9 +13,9 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Math\BigInteger\Engines\BCMath\Reductions; +namespace phpseclib3\Math\BigInteger\Engines\BCMath\Reductions; -use phpseclib\Math\BigInteger\Engines\BCMath\Base; +use phpseclib3\Math\BigInteger\Engines\BCMath\Base; /** * PHP Barrett Modular Exponentiation Engine diff --git a/phpseclib/Math/BigInteger/Engines/BCMath/Reductions/EvalBarrett.php b/phpseclib/Math/BigInteger/Engines/BCMath/Reductions/EvalBarrett.php index 2b5a387f..27530ec7 100644 --- a/phpseclib/Math/BigInteger/Engines/BCMath/Reductions/EvalBarrett.php +++ b/phpseclib/Math/BigInteger/Engines/BCMath/Reductions/EvalBarrett.php @@ -13,10 +13,10 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Math\BigInteger\Engines\BCMath\Reductions; +namespace phpseclib3\Math\BigInteger\Engines\BCMath\Reductions; -use phpseclib\Math\BigInteger\Engines\BCMath\Base; -use phpseclib\Math\BigInteger\Engines\BCMath; +use phpseclib3\Math\BigInteger\Engines\BCMath\Base; +use phpseclib3\Math\BigInteger\Engines\BCMath; /** * PHP Barrett Modular Exponentiation Engine diff --git a/phpseclib/Math/BigInteger/Engines/Engine.php b/phpseclib/Math/BigInteger/Engines/Engine.php index 39b641cf..0d79736a 100644 --- a/phpseclib/Math/BigInteger/Engines/Engine.php +++ b/phpseclib/Math/BigInteger/Engines/Engine.php @@ -13,13 +13,13 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Math\BigInteger\Engines; +namespace phpseclib3\Math\BigInteger\Engines; use ParagonIE\ConstantTime\Hex; -use phpseclib\Exception\BadConfigurationException; -use phpseclib\Crypt\Random; -use phpseclib\Math\BigInteger; -use phpseclib\Common\Functions\Strings; +use phpseclib3\Exception\BadConfigurationException; +use phpseclib3\Crypt\Random; +use phpseclib3\Math\BigInteger; +use phpseclib3\Common\Functions\Strings; /** * Base Engine. @@ -180,7 +180,7 @@ abstract class Engine implements \Serializable */ public static function setModExpEngine($engine) { - $fqengine = '\\phpseclib\\Math\\BigInteger\\Engines\\' . static::ENGINE_DIR . '\\' . $engine; + $fqengine = '\\phpseclib3\\Math\\BigInteger\\Engines\\' . static::ENGINE_DIR . '\\' . $engine; if (!class_exists($fqengine) || !method_exists($fqengine, 'isValidEngine')) { throw new \InvalidArgumentException("$engine is not a valid engine"); } @@ -257,8 +257,8 @@ abstract class Engine implements \Serializable * * Say you have (30 mod 17 * x mod 17) mod 17 == 1. x can be found using modular inverses. * - * @param \phpseclib\Math\BigInteger\Engines\Engine $n - * @return \phpseclib\Math\BigInteger\Engines\Engine|false + * @param \phpseclib3\Math\BigInteger\Engines\Engine $n + * @return \phpseclib3\Math\BigInteger\Engines\Engine|false * @internal See {@link http://www.cacr.math.uwaterloo.ca/hac/about/chap14.pdf#page=21 HAC 14.64} for more information. */ protected function modInverseHelper(Engine $n) @@ -463,7 +463,7 @@ abstract class Engine implements \Serializable * Instead of the top x bits being dropped they're appended to the shifted bit string. * * @param int $shift - * @return \phpseclib\Math\BigInteger\Engines\Engine + * @return \phpseclib3\Math\BigInteger\Engines\Engine */ public function bitwise_leftRotate($shift) { @@ -507,7 +507,7 @@ abstract class Engine implements \Serializable * Instead of the bottom x bits being dropped they're prepended to the shifted bit string. * * @param int $shift - * @return \phpseclib\Math\BigInteger\Engines\Engine + * @return \phpseclib3\Math\BigInteger\Engines\Engine */ public function bitwise_rightRotate($shift) { @@ -518,7 +518,7 @@ abstract class Engine implements \Serializable * Returns the smallest and largest n-bit number * * @param int $bits - * @return \phpseclib\Math\BigInteger\Engines\Engine[] + * @return \phpseclib3\Math\BigInteger\Engines\Engine[] */ public static function minMaxBits($bits) { @@ -591,11 +591,11 @@ abstract class Engine implements \Serializable * however, this function performs a modular reduction after every multiplication and squaring operation. * As such, this function has the same preconditions that the reductions being used do. * - * @param \phpseclib\Math\BigInteger\Engines\Engine $x - * @param \phpseclib\Math\BigInteger\Engines\Engine $e - * @param \phpseclib\Math\BigInteger\Engines\Engine $n + * @param \phpseclib3\Math\BigInteger\Engines\Engine $x + * @param \phpseclib3\Math\BigInteger\Engines\Engine $e + * @param \phpseclib3\Math\BigInteger\Engines\Engine $n * @param string $class - * @return \phpseclib\Math\BigInteger\Engines\Engine + * @return \phpseclib3\Math\BigInteger\Engines\Engine */ protected static function slidingWindow(Engine $x, Engine $e, Engine $n, $class) { @@ -666,7 +666,7 @@ abstract class Engine implements \Serializable * Bit length is equal to $size * * @param int $size - * @return \phpseclib\Math\BigInteger\Engines\Engine + * @return \phpseclib3\Math\BigInteger\Engines\Engine */ public static function random($size) { @@ -684,7 +684,7 @@ abstract class Engine implements \Serializable * Bit length is equal to $size * * @param int $size - * @return \phpseclib\Math\BigInteger\Engines\Engine + * @return \phpseclib3\Math\BigInteger\Engines\Engine */ public static function randomPrime($size) { @@ -930,7 +930,7 @@ abstract class Engine implements \Serializable * Performs a few preliminary checks on root * * @param int $n - * @return \phpseclib\Math\BigInteger\Engines\Engine + * @return \phpseclib3\Math\BigInteger\Engines\Engine */ protected function rootHelper($n) { @@ -953,7 +953,7 @@ abstract class Engine implements \Serializable * Returns the nth root of a positive biginteger, where n defaults to 2 * * @param int $n - * @return \phpseclib\Math\BigInteger\Engines\Engine + * @return \phpseclib3\Math\BigInteger\Engines\Engine * @internal This function is based off of {@link http://mathforum.org/library/drmath/view/52605.html this page} and {@link http://stackoverflow.com/questions/11242920/calculating-nth-root-with-bcmath-in-php this stackoverflow question}. */ protected function rootInner($n) @@ -1068,7 +1068,7 @@ abstract class Engine implements \Serializable $class = static::class; $fqengine = !method_exists(static::$modexpEngine, 'reduce') ? - '\\phpseclib\\Math\\BigInteger\\Engines\\' . static::ENGINE_DIR . '\\DefaultEngine' : + '\\phpseclib3\\Math\\BigInteger\\Engines\\' . static::ENGINE_DIR . '\\DefaultEngine' : static::$modexpEngine; if (method_exists($fqengine, 'generateCustomReduction')) { $func = $fqengine::generateCustomReduction($this, static::class); @@ -1136,7 +1136,7 @@ abstract class Engine implements \Serializable * Splits BigInteger's into chunks of $split bits * * @param int $split - * @return \phpseclib\Math\BigInteger\Engine[] + * @return \phpseclib3\Math\BigInteger\Engine[] */ public function bitwise_split($split) { diff --git a/phpseclib/Math/BigInteger/Engines/GMP.php b/phpseclib/Math/BigInteger/Engines/GMP.php index 8dbb85a2..4691c887 100644 --- a/phpseclib/Math/BigInteger/Engines/GMP.php +++ b/phpseclib/Math/BigInteger/Engines/GMP.php @@ -13,10 +13,10 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Math\BigInteger\Engines; +namespace phpseclib3\Math\BigInteger\Engines; use ParagonIE\ConstantTime\Hex; -use phpseclib\Exception\BadConfigurationException; +use phpseclib3\Exception\BadConfigurationException; /** * GMP Engine. @@ -61,21 +61,21 @@ class GMP extends Engine /** * BigInteger(0) * - * @var \phpseclib\Math\BigInteger\Engines\GMP + * @var \phpseclib3\Math\BigInteger\Engines\GMP */ protected static $zero; /** * BigInteger(1) * - * @var \phpseclib\Math\BigInteger\Engines\GMP + * @var \phpseclib3\Math\BigInteger\Engines\GMP */ protected static $one; /** * BigInteger(2) * - * @var \phpseclib\Math\BigInteger\Engines\GMP + * @var \phpseclib3\Math\BigInteger\Engines\GMP */ protected static $two; @@ -105,7 +105,7 @@ class GMP extends Engine * @param mixed $x integer Base-10 number or base-$base number if $base set. * @param int $base * @see parent::__construct() - * @return \phpseclib\Math\BigInteger\Engines\GMP + * @return \phpseclib3\Math\BigInteger\Engines\GMP */ public function __construct($x = 0, $base = 10) { @@ -343,8 +343,8 @@ class GMP extends Engine * combination is returned is dependent upon which mode is in use. See * {@link http://en.wikipedia.org/wiki/B%C3%A9zout%27s_identity Bezout's identity - Wikipedia} for more information. * - * @param \phpseclib\Math\BigInteger\Engines\GMP $n - * @return \phpseclib\Math\BigInteger\Engines\GMP[] + * @param \phpseclib3\Math\BigInteger\Engines\GMP $n + * @return \phpseclib3\Math\BigInteger\Engines\GMP[] */ public function extendedGCD(GMP $n) { @@ -374,7 +374,7 @@ class GMP extends Engine /** * Absolute value. * - * @return \phpseclib\Math\BigInteger\Engines\GMP + * @return \phpseclib3\Math\BigInteger\Engines\GMP * @access public */ public function abs() @@ -433,7 +433,7 @@ class GMP extends Engine * Shifts BigInteger's by $shift bits, effectively dividing by 2**$shift. * * @param int $shift - * @return \phpseclib\Math\BigInteger\Engines\GMP + * @return \phpseclib3\Math\BigInteger\Engines\GMP */ public function bitwise_rightShift($shift) { @@ -452,7 +452,7 @@ class GMP extends Engine * Shifts BigInteger's by $shift bits, effectively multiplying by 2**$shift. * * @param int $shift - * @return \phpseclib\Math\BigInteger\Engines\GMP + * @return \phpseclib3\Math\BigInteger\Engines\GMP */ public function bitwise_leftShift($shift) { diff --git a/phpseclib/Math/BigInteger/Engines/GMP/DefaultEngine.php b/phpseclib/Math/BigInteger/Engines/GMP/DefaultEngine.php index 553c6e43..9889271e 100644 --- a/phpseclib/Math/BigInteger/Engines/GMP/DefaultEngine.php +++ b/phpseclib/Math/BigInteger/Engines/GMP/DefaultEngine.php @@ -13,9 +13,9 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Math\BigInteger\Engines\GMP; +namespace phpseclib3\Math\BigInteger\Engines\GMP; -use phpseclib\Math\BigInteger\Engines\GMP; +use phpseclib3\Math\BigInteger\Engines\GMP; /** * GMP Modular Exponentiation Engine diff --git a/phpseclib/Math/BigInteger/Engines/OpenSSL.php b/phpseclib/Math/BigInteger/Engines/OpenSSL.php index a9b5785c..ce4d18a3 100644 --- a/phpseclib/Math/BigInteger/Engines/OpenSSL.php +++ b/phpseclib/Math/BigInteger/Engines/OpenSSL.php @@ -13,11 +13,11 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Math\BigInteger\Engines; +namespace phpseclib3\Math\BigInteger\Engines; -use phpseclib\Crypt\RSA; -use phpseclib\Crypt\RSA\Formats\Keys\PKCS8; -use phpseclib\Math\BigInteger; +use phpseclib3\Crypt\RSA; +use phpseclib3\Crypt\RSA\Formats\Keys\PKCS8; +use phpseclib3\Math\BigInteger; /** * OpenSSL Modular Exponentiation Engine diff --git a/phpseclib/Math/BigInteger/Engines/PHP.php b/phpseclib/Math/BigInteger/Engines/PHP.php index 24226952..5f94e68b 100644 --- a/phpseclib/Math/BigInteger/Engines/PHP.php +++ b/phpseclib/Math/BigInteger/Engines/PHP.php @@ -13,10 +13,10 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Math\BigInteger\Engines; +namespace phpseclib3\Math\BigInteger\Engines; use ParagonIE\ConstantTime\Hex; -use phpseclib\Exception\BadConfigurationException; +use phpseclib3\Exception\BadConfigurationException; /** * Pure-PHP Engine. @@ -77,7 +77,7 @@ abstract class PHP extends Engine * @param mixed $x integer Base-10 number or base-$base number if $base set. * @param int $base * @see parent::__construct() - * @return \phpseclib\Math\BigInteger\Engines\PHP + * @return \phpseclib3\Math\BigInteger\Engines\PHP */ public function __construct($x = 0, $base = 10) { @@ -515,7 +515,7 @@ abstract class PHP extends Engine * same. If the remainder would be negative, the "common residue" is equal to the sum of the remainder * and the divisor (basically, the "common residue" is the first positive modulo). * - * @param \phpseclib\Math\BigInteger\engines\PHP $y + * @param \phpseclib3\Math\BigInteger\engines\PHP $y * @return array * @internal This function is based off of {@link http://www.cacr.math.uwaterloo.ca/hac/about/chap14.pdf#page=9 HAC 14.20}. */ @@ -710,7 +710,7 @@ abstract class PHP extends Engine * Convert an array / boolean to a PHP BigInteger object * * @param array $arr - * @return \phpseclib\Math\BigInteger\Engines\PHP + * @return \phpseclib3\Math\BigInteger\Engines\PHP */ protected function convertToObj(array $arr) { @@ -795,7 +795,7 @@ abstract class PHP extends Engine /** * Absolute value. * - * @return \phpseclib\Math\BigInteger\Engines\PHP + * @return \phpseclib3\Math\BigInteger\Engines\PHP */ public function abs() { @@ -831,7 +831,7 @@ abstract class PHP extends Engine * Shifts BigInteger's by $shift bits, effectively dividing by 2**$shift. * * @param int $shift - * @return \phpseclib\Math\BigInteger\Engines\PHP + * @return \phpseclib3\Math\BigInteger\Engines\PHP */ public function bitwise_rightShift($shift) { @@ -851,7 +851,7 @@ abstract class PHP extends Engine * Shifts BigInteger's by $shift bits, effectively multiplying by 2**$shift. * * @param int $shift - * @return \phpseclib\Math\BigInteger\Engines\PHP + * @return \phpseclib3\Math\BigInteger\Engines\PHP */ public function bitwise_leftShift($shift) { @@ -1204,7 +1204,7 @@ abstract class PHP extends Engine * Splits BigInteger's into chunks of $split bits * * @param int $split - * @return \phpseclib\Math\BigInteger\Engines\PHP[] + * @return \phpseclib3\Math\BigInteger\Engines\PHP[] */ public function bitwise_split($split) { @@ -1271,7 +1271,7 @@ abstract class PHP extends Engine * Bitwise Split where $split < static::BASE * * @param int $split - * @return \phpseclib\Math\BigInteger\Engines\PHP[] + * @return \phpseclib3\Math\BigInteger\Engines\PHP[] */ private function bitwise_small_split($split) { diff --git a/phpseclib/Math/BigInteger/Engines/PHP/Base.php b/phpseclib/Math/BigInteger/Engines/PHP/Base.php index 6549592d..34d80f67 100644 --- a/phpseclib/Math/BigInteger/Engines/PHP/Base.php +++ b/phpseclib/Math/BigInteger/Engines/PHP/Base.php @@ -13,9 +13,9 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Math\BigInteger\Engines\PHP; +namespace phpseclib3\Math\BigInteger\Engines\PHP; -use phpseclib\Math\BigInteger\Engines\PHP; +use phpseclib3\Math\BigInteger\Engines\PHP; /** * PHP Modular Exponentiation Engine @@ -74,11 +74,11 @@ abstract class Base extends PHP * the other, a power of two - and recombine them, later. This is the method that this modPow function uses. * {@link http://islab.oregonstate.edu/papers/j34monex.pdf Montgomery Reduction with Even Modulus} elaborates. * - * @param \phpseclib\Math\BigInteger\Engines\PHP $x - * @param \phpseclib\Math\BigInteger\Engines\PHP $e - * @param \phpseclib\Math\BigInteger\Engines\PHP $n + * @param \phpseclib3\Math\BigInteger\Engines\PHP $x + * @param \phpseclib3\Math\BigInteger\Engines\PHP $e + * @param \phpseclib3\Math\BigInteger\Engines\PHP $n * @param string $class - * @return \phpseclib\Math\BigInteger\Engines\PHP + * @return \phpseclib3\Math\BigInteger\Engines\PHP */ protected static function powModHelper(PHP $x, PHP $e, PHP $n, $class) { diff --git a/phpseclib/Math/BigInteger/Engines/PHP/DefaultEngine.php b/phpseclib/Math/BigInteger/Engines/PHP/DefaultEngine.php index ad316610..138deb1f 100644 --- a/phpseclib/Math/BigInteger/Engines/PHP/DefaultEngine.php +++ b/phpseclib/Math/BigInteger/Engines/PHP/DefaultEngine.php @@ -13,9 +13,9 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Math\BigInteger\Engines\PHP; +namespace phpseclib3\Math\BigInteger\Engines\PHP; -use phpseclib\Math\BigInteger\Engines\PHP\Reductions\EvalBarrett; +use phpseclib3\Math\BigInteger\Engines\PHP\Reductions\EvalBarrett; /** * PHP Default Modular Exponentiation Engine diff --git a/phpseclib/Math/BigInteger/Engines/PHP/Montgomery.php b/phpseclib/Math/BigInteger/Engines/PHP/Montgomery.php index e388e6b2..0ebbd71a 100644 --- a/phpseclib/Math/BigInteger/Engines/PHP/Montgomery.php +++ b/phpseclib/Math/BigInteger/Engines/PHP/Montgomery.php @@ -13,12 +13,12 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Math\BigInteger\Engines\PHP; +namespace phpseclib3\Math\BigInteger\Engines\PHP; -use phpseclib\Math\BigInteger\Engines\PHP\Reductions\PowerOfTwo; -use phpseclib\Math\BigInteger\Engines\PHP; -use phpseclib\Math\BigInteger\Engines\PHP\Base; -use phpseclib\Math\BigInteger\Engines\Engine; +use phpseclib3\Math\BigInteger\Engines\PHP\Reductions\PowerOfTwo; +use phpseclib3\Math\BigInteger\Engines\PHP; +use phpseclib3\Math\BigInteger\Engines\PHP\Base; +use phpseclib3\Math\BigInteger\Engines\Engine; /** * PHP Montgomery Modular Exponentiation Engine @@ -42,11 +42,11 @@ abstract class Montgomery extends Base /** * Performs modular exponentiation. * - * @param \phpseclib\Math\BigInteger\Engines\Engine $x - * @param \phpseclib\Math\BigInteger\Engines\Engine $e - * @param \phpseclib\Math\BigInteger\Engines\Engine $n + * @param \phpseclib3\Math\BigInteger\Engines\Engine $x + * @param \phpseclib3\Math\BigInteger\Engines\Engine $e + * @param \phpseclib3\Math\BigInteger\Engines\Engine $n * @param string $class - * @return \phpseclib\Math\BigInteger\Engines\Engine + * @return \phpseclib3\Math\BigInteger\Engines\Engine */ protected static function slidingWindow(Engine $x, Engine $e, Engine $n, $class) { diff --git a/phpseclib/Math/BigInteger/Engines/PHP/OpenSSL.php b/phpseclib/Math/BigInteger/Engines/PHP/OpenSSL.php index bb5481fe..1b7b5b40 100644 --- a/phpseclib/Math/BigInteger/Engines/PHP/OpenSSL.php +++ b/phpseclib/Math/BigInteger/Engines/PHP/OpenSSL.php @@ -13,9 +13,9 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Math\BigInteger\Engines\PHP; +namespace phpseclib3\Math\BigInteger\Engines\PHP; -use phpseclib\Math\BigInteger\Engines\OpenSSL as Progenitor; +use phpseclib3\Math\BigInteger\Engines\OpenSSL as Progenitor; /** * OpenSSL Modular Exponentiation Engine diff --git a/phpseclib/Math/BigInteger/Engines/PHP/Reductions/Barrett.php b/phpseclib/Math/BigInteger/Engines/PHP/Reductions/Barrett.php index 0ce047ec..03e0f8aa 100644 --- a/phpseclib/Math/BigInteger/Engines/PHP/Reductions/Barrett.php +++ b/phpseclib/Math/BigInteger/Engines/PHP/Reductions/Barrett.php @@ -13,9 +13,9 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Math\BigInteger\Engines\PHP\Reductions; +namespace phpseclib3\Math\BigInteger\Engines\PHP\Reductions; -use phpseclib\Math\BigInteger\Engines\PHP\Base; +use phpseclib3\Math\BigInteger\Engines\PHP\Base; /** * PHP Barrett Modular Exponentiation Engine diff --git a/phpseclib/Math/BigInteger/Engines/PHP/Reductions/Classic.php b/phpseclib/Math/BigInteger/Engines/PHP/Reductions/Classic.php index 67273f80..aef167de 100644 --- a/phpseclib/Math/BigInteger/Engines/PHP/Reductions/Classic.php +++ b/phpseclib/Math/BigInteger/Engines/PHP/Reductions/Classic.php @@ -13,9 +13,9 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Math\BigInteger\Engines\PHP\Reductions; +namespace phpseclib3\Math\BigInteger\Engines\PHP\Reductions; -use phpseclib\Math\BigInteger\Engines\PHP\Base; +use phpseclib3\Math\BigInteger\Engines\PHP\Base; /** * PHP Classic Modular Exponentiation Engine diff --git a/phpseclib/Math/BigInteger/Engines/PHP/Reductions/EvalBarrett.php b/phpseclib/Math/BigInteger/Engines/PHP/Reductions/EvalBarrett.php index 479ac385..7c81071d 100644 --- a/phpseclib/Math/BigInteger/Engines/PHP/Reductions/EvalBarrett.php +++ b/phpseclib/Math/BigInteger/Engines/PHP/Reductions/EvalBarrett.php @@ -13,10 +13,10 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Math\BigInteger\Engines\PHP\Reductions; +namespace phpseclib3\Math\BigInteger\Engines\PHP\Reductions; -use phpseclib\Math\BigInteger\Engines\PHP\Base; -use phpseclib\Math\BigInteger\Engines\PHP; +use phpseclib3\Math\BigInteger\Engines\PHP\Base; +use phpseclib3\Math\BigInteger\Engines\PHP; /** * PHP Dynamic Barrett Modular Exponentiation Engine diff --git a/phpseclib/Math/BigInteger/Engines/PHP/Reductions/Montgomery.php b/phpseclib/Math/BigInteger/Engines/PHP/Reductions/Montgomery.php index 2fe8ccca..79db314d 100644 --- a/phpseclib/Math/BigInteger/Engines/PHP/Reductions/Montgomery.php +++ b/phpseclib/Math/BigInteger/Engines/PHP/Reductions/Montgomery.php @@ -13,9 +13,9 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Math\BigInteger\Engines\PHP\Reductions; +namespace phpseclib3\Math\BigInteger\Engines\PHP\Reductions; -use phpseclib\Math\BigInteger\Engines\PHP\Montgomery as Progenitor; +use phpseclib3\Math\BigInteger\Engines\PHP\Montgomery as Progenitor; /** * PHP Montgomery Modular Exponentiation Engine diff --git a/phpseclib/Math/BigInteger/Engines/PHP/Reductions/MontgomeryMult.php b/phpseclib/Math/BigInteger/Engines/PHP/Reductions/MontgomeryMult.php index 45604c2b..31e8af21 100644 --- a/phpseclib/Math/BigInteger/Engines/PHP/Reductions/MontgomeryMult.php +++ b/phpseclib/Math/BigInteger/Engines/PHP/Reductions/MontgomeryMult.php @@ -13,9 +13,9 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Math\BigInteger\Engines\PHP\Reductions; +namespace phpseclib3\Math\BigInteger\Engines\PHP\Reductions; -use phpseclib\Math\BigInteger\Engines\PHP\Base; +use phpseclib3\Math\BigInteger\Engines\PHP\Base; /** * PHP Montgomery Modular Exponentiation Engine with interleaved multiplication diff --git a/phpseclib/Math/BigInteger/Engines/PHP/Reductions/PowerOfTwo.php b/phpseclib/Math/BigInteger/Engines/PHP/Reductions/PowerOfTwo.php index 3c5a1d1c..73f133d0 100644 --- a/phpseclib/Math/BigInteger/Engines/PHP/Reductions/PowerOfTwo.php +++ b/phpseclib/Math/BigInteger/Engines/PHP/Reductions/PowerOfTwo.php @@ -13,9 +13,9 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Math\BigInteger\Engines\PHP\Reductions; +namespace phpseclib3\Math\BigInteger\Engines\PHP\Reductions; -use phpseclib\Math\BigInteger\Engines\PHP\Base; +use phpseclib3\Math\BigInteger\Engines\PHP\Base; /** * PHP Power Of Two Modular Exponentiation Engine diff --git a/phpseclib/Math/BigInteger/Engines/PHP32.php b/phpseclib/Math/BigInteger/Engines/PHP32.php index 6f0a1ec7..671e500d 100644 --- a/phpseclib/Math/BigInteger/Engines/PHP32.php +++ b/phpseclib/Math/BigInteger/Engines/PHP32.php @@ -13,7 +13,7 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Math\BigInteger\Engines; +namespace phpseclib3\Math\BigInteger\Engines; use ParagonIE\ConstantTime\Hex; @@ -74,21 +74,21 @@ class PHP32 extends PHP /** * BigInteger(0) * - * @var \phpseclib\Math\BigInteger\Engines\PHP32 + * @var \phpseclib3\Math\BigInteger\Engines\PHP32 */ protected static $zero; /** * BigInteger(1) * - * @var \phpseclib\Math\BigInteger\Engines\PHP32 + * @var \phpseclib3\Math\BigInteger\Engines\PHP32 */ protected static $one; /** * BigInteger(2) * - * @var \phpseclib\Math\BigInteger\Engines\PHP32 + * @var \phpseclib3\Math\BigInteger\Engines\PHP32 */ protected static $two; diff --git a/phpseclib/Math/BigInteger/Engines/PHP64.php b/phpseclib/Math/BigInteger/Engines/PHP64.php index 5966782a..ea97c1f5 100644 --- a/phpseclib/Math/BigInteger/Engines/PHP64.php +++ b/phpseclib/Math/BigInteger/Engines/PHP64.php @@ -13,7 +13,7 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Math\BigInteger\Engines; +namespace phpseclib3\Math\BigInteger\Engines; use ParagonIE\ConstantTime\Hex; @@ -74,21 +74,21 @@ class PHP64 extends PHP /** * BigInteger(0) * - * @var \phpseclib\Math\BigInteger\Engines\PHP64 + * @var \phpseclib3\Math\BigInteger\Engines\PHP64 */ protected static $zero; /** * BigInteger(1) * - * @var \phpseclib\Math\BigInteger\Engines\PHP64 + * @var \phpseclib3\Math\BigInteger\Engines\PHP64 */ protected static $one; /** * BigInteger(2) * - * @var \phpseclib\Math\BigInteger\Engines\PHP64 + * @var \phpseclib3\Math\BigInteger\Engines\PHP64 */ protected static $two; diff --git a/phpseclib/Math/BinaryField.php b/phpseclib/Math/BinaryField.php index ae920406..7457b720 100644 --- a/phpseclib/Math/BinaryField.php +++ b/phpseclib/Math/BinaryField.php @@ -14,12 +14,12 @@ * @license http://www.opensource.org/licenses/mit-license.html MIT License */ -namespace phpseclib\Math; +namespace phpseclib3\Math; use ParagonIE\ConstantTime\Hex; -use phpseclib\Math\Common\FiniteField; -use phpseclib\Math\BinaryField\Integer; -use phpseclib\Common\Functions\Strings; +use phpseclib3\Math\Common\FiniteField; +use phpseclib3\Math\BinaryField\Integer; +use phpseclib3\Common\Functions\Strings; /** * Binary Finite Fields diff --git a/phpseclib/Math/BinaryField/Integer.php b/phpseclib/Math/BinaryField/Integer.php index 9de2786b..fc7a11ad 100644 --- a/phpseclib/Math/BinaryField/Integer.php +++ b/phpseclib/Math/BinaryField/Integer.php @@ -20,11 +20,11 @@ * @license http://www.opensource.org/licenses/mit-license.html MIT License */ -namespace phpseclib\Math\BinaryField; +namespace phpseclib3\Math\BinaryField; -use phpseclib\Math\Common\FiniteField\Integer as Base; -use phpseclib\Math\BigInteger; -use phpseclib\Math\BinaryField; +use phpseclib3\Math\Common\FiniteField\Integer as Base; +use phpseclib3\Math\BigInteger; +use phpseclib3\Math\BinaryField; use ParagonIE\ConstantTime\Hex; /** diff --git a/phpseclib/Math/Common/FiniteField.php b/phpseclib/Math/Common/FiniteField.php index 7777d88b..c2294a04 100644 --- a/phpseclib/Math/Common/FiniteField.php +++ b/phpseclib/Math/Common/FiniteField.php @@ -12,7 +12,7 @@ * @license http://www.opensource.org/licenses/mit-license.html MIT License */ -namespace phpseclib\Math\Common; +namespace phpseclib3\Math\Common; /** * Finite Fields diff --git a/phpseclib/Math/Common/FiniteField/Integer.php b/phpseclib/Math/Common/FiniteField/Integer.php index a4caafd8..d163f552 100644 --- a/phpseclib/Math/Common/FiniteField/Integer.php +++ b/phpseclib/Math/Common/FiniteField/Integer.php @@ -12,7 +12,7 @@ * @license http://www.opensource.org/licenses/mit-license.html MIT License */ -namespace phpseclib\Math\Common\FiniteField; +namespace phpseclib3\Math\Common\FiniteField; /** * Finite Field Integer diff --git a/phpseclib/Math/PrimeField.php b/phpseclib/Math/PrimeField.php index 9279fe7e..6b85c724 100644 --- a/phpseclib/Math/PrimeField.php +++ b/phpseclib/Math/PrimeField.php @@ -15,10 +15,10 @@ * @link http://pear.php.net/package/Math_BigInteger */ -namespace phpseclib\Math; +namespace phpseclib3\Math; -use phpseclib\Math\Common\FiniteField; -use phpseclib\Math\PrimeField\Integer; +use phpseclib3\Math\Common\FiniteField; +use phpseclib3\Math\PrimeField\Integer; /** * Prime Finite Fields diff --git a/phpseclib/Math/PrimeField/Integer.php b/phpseclib/Math/PrimeField/Integer.php index 160ca92b..c274ff64 100644 --- a/phpseclib/Math/PrimeField/Integer.php +++ b/phpseclib/Math/PrimeField/Integer.php @@ -12,10 +12,10 @@ * @license http://www.opensource.org/licenses/mit-license.html MIT License */ -namespace phpseclib\Math\PrimeField; +namespace phpseclib3\Math\PrimeField; -use phpseclib\Math\Common\FiniteField\Integer as Base; -use phpseclib\Math\BigInteger; +use phpseclib3\Math\Common\FiniteField\Integer as Base; +use phpseclib3\Math\BigInteger; use ParagonIE\ConstantTime\Hex; /** @@ -30,7 +30,7 @@ class Integer extends Base /** * Holds the PrimeField's value * - * @var \phpseclib\Math\BigInteger + * @var \phpseclib3\Math\BigInteger */ protected $value; @@ -44,7 +44,7 @@ class Integer extends Base /** * Holds the PrimeField's modulo * - * @var \phpseclib\Math\BigInteger + * @var \phpseclib3\Math\BigInteger */ protected static $modulo; @@ -58,7 +58,7 @@ class Integer extends Base /** * Zero * - * @var \phpseclib\Math\BigInteger + * @var \phpseclib3\Math\BigInteger */ protected static $zero; diff --git a/phpseclib/Net/SFTP.php b/phpseclib/Net/SFTP.php index 8a22aae0..01af6811 100644 --- a/phpseclib/Net/SFTP.php +++ b/phpseclib/Net/SFTP.php @@ -16,7 +16,7 @@ * login('username', 'password')) { * exit('Login Failed'); * } @@ -35,11 +35,11 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Net; +namespace phpseclib3\Net; use ParagonIE\ConstantTime\Hex; -use phpseclib\Exception\FileNotFoundException; -use phpseclib\Common\Functions\Strings; +use phpseclib3\Exception\FileNotFoundException; +use phpseclib3\Common\Functions\Strings; /** * Pure-PHP implementations of SFTP. @@ -53,17 +53,17 @@ class SFTP extends SSH2 /** * SFTP channel constant * - * \phpseclib\Net\SSH2::exec() uses 0 and \phpseclib\Net\SSH2::read() / \phpseclib\Net\SSH2::write() use 1. + * \phpseclib3\Net\SSH2::exec() uses 0 and \phpseclib3\Net\SSH2::read() / \phpseclib3\Net\SSH2::write() use 1. * - * @see \phpseclib\Net\SSH2::send_channel_packet() - * @see \phpseclib\Net\SSH2::get_channel_packet() + * @see \phpseclib3\Net\SSH2::send_channel_packet() + * @see \phpseclib3\Net\SSH2::get_channel_packet() * @access private */ const CHANNEL = 0x100; /**#@+ * @access public - * @see \phpseclib\Net\SFTP::put() + * @see \phpseclib3\Net\SFTP::put() */ /** * Reads data from a local file. @@ -271,7 +271,7 @@ class SFTP extends SSH2 * @param string $host * @param int $port * @param int $timeout - * @return \phpseclib\Net\SFTP + * @return \phpseclib3\Net\SFTP * @access public */ public function __construct($host, $port = 22, $timeout = 10) @@ -352,7 +352,7 @@ class SFTP extends SSH2 31 => 'NET_SFTP_STATUS_NO_MATCHING_BYTE_RANGE_LOCK' ]; // http://tools.ietf.org/html/draft-ietf-secsh-filexfer-13#section-7.1 - // the order, in this case, matters quite a lot - see \phpseclib\Net\SFTP::_parseAttributes() to understand why + // the order, in this case, matters quite a lot - see \phpseclib3\Net\SFTP::_parseAttributes() to understand why $this->attributes = [ 0x00000001 => 'NET_SFTP_ATTR_SIZE', 0x00000002 => 'NET_SFTP_ATTR_UIDGID', // defined in SFTPv3, removed in SFTPv4+ @@ -376,7 +376,7 @@ class SFTP extends SSH2 0x00000020 => 'NET_SFTP_OPEN_EXCL' ]; // http://tools.ietf.org/html/draft-ietf-secsh-filexfer-04#section-5.2 - // see \phpseclib\Net\SFTP::_parseLongname() for an explanation + // see \phpseclib3\Net\SFTP::_parseLongname() for an explanation $this->file_types = [ 1 => 'NET_SFTP_TYPE_REGULAR', 2 => 'NET_SFTP_TYPE_DIRECTORY', @@ -531,7 +531,7 @@ class SFTP extends SSH2 So what do you do if you have a client whose initial SSH_FXP_INIT packet says it implements v3 and a server whose initial SSH_FXP_VERSION reply says it implements v4 and only v4? If it only implements v4, the "versions" extension is likely not going to have been sent so version re-negotiation as discussed - in draft-ietf-secsh-filexfer-13 would be quite impossible. As such, what \phpseclib\Net\SFTP would do is close the + in draft-ietf-secsh-filexfer-13 would be quite impossible. As such, what \phpseclib3\Net\SFTP would do is close the channel and reopen it with a new and updated SSH_FXP_INIT packet. */ switch ($this->version) { @@ -739,7 +739,7 @@ class SFTP extends SSH2 return false; } - // see \phpseclib\Net\SFTP::nlist() for a more thorough explanation of the following + // see \phpseclib3\Net\SFTP::nlist() for a more thorough explanation of the following $response = $this->get_sftp_packet(); switch ($this->packet_type) { case NET_SFTP_HANDLE: @@ -1300,7 +1300,7 @@ class SFTP extends SSH2 /** * Returns general information about a file or symbolic link * - * Determines information without calling \phpseclib\Net\SFTP::realpath(). + * Determines information without calling \phpseclib3\Net\SFTP::realpath(). * The second parameter can be either NET_SFTP_STAT or NET_SFTP_LSTAT. * * @param string $filename @@ -1814,8 +1814,8 @@ class SFTP extends SSH2 /** * Uploads a file to the SFTP server. * - * By default, \phpseclib\Net\SFTP::put() does not read from the local filesystem. $data is dumped directly into $remote_file. - * So, for example, if you set $data to 'filename.ext' and then do \phpseclib\Net\SFTP::get(), you will get a file, twelve bytes + * By default, \phpseclib3\Net\SFTP::put() does not read from the local filesystem. $data is dumped directly into $remote_file. + * So, for example, if you set $data to 'filename.ext' and then do \phpseclib3\Net\SFTP::get(), you will get a file, twelve bytes * long, containing 'filename.ext' as its contents. * * Setting $mode to self::SOURCE_LOCAL_FILE will change the above behavior. With self::SOURCE_LOCAL_FILE, $remote_file will @@ -1854,10 +1854,10 @@ class SFTP extends SSH2 * @param callable|null $progressCallback * @throws \UnexpectedValueException on receipt of unexpected packets * @throws \BadFunctionCallException if you're uploading via a callback and the callback function is invalid - * @throws \phpseclib\Exception\FileNotFoundException if you're uploading via a file and the file doesn't exist + * @throws \phpseclib3\Exception\FileNotFoundException if you're uploading via a file and the file doesn't exist * @return bool * @access public - * @internal ASCII mode for SFTPv4/5/6 can be supported by adding a new function - \phpseclib\Net\SFTP::setMode(). + * @internal ASCII mode for SFTPv4/5/6 can be supported by adding a new function - \phpseclib3\Net\SFTP::setMode(). */ public function put($remote_file, $data, $mode = self::SOURCE_STRING, $start = -1, $local_start = -1, $progressCallback = null) { diff --git a/phpseclib/Net/SFTP/Stream.php b/phpseclib/Net/SFTP/Stream.php index 30a94dd3..4e20a1f9 100644 --- a/phpseclib/Net/SFTP/Stream.php +++ b/phpseclib/Net/SFTP/Stream.php @@ -15,11 +15,11 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Net\SFTP; +namespace phpseclib3\Net\SFTP; -use phpseclib\Crypt\RSA; -use phpseclib\Net\SFTP; -use phpseclib\Net\SSH2; +use phpseclib3\Crypt\RSA; +use phpseclib3\Net\SFTP; +use phpseclib3\Net\SSH2; /** * SFTP Stream Wrapper @@ -212,7 +212,7 @@ class Stream return false; } - // casting $pass to a string is necessary in the event that it's a \phpseclib\Crypt\RSA object + // casting $pass to a string is necessary in the event that it's a \phpseclib3\Crypt\RSA object if (isset(self::$instances[$host][$port][$user][(string) $pass])) { $this->sftp = self::$instances[$host][$port][$user][(string) $pass]; } else { @@ -488,7 +488,7 @@ class Stream * Renames a file or directory * * Attempts to rename oldname to newname, moving it between directories if necessary. - * If newname exists, it will be overwritten. This is a departure from what \phpseclib\Net\SFTP + * If newname exists, it will be overwritten. This is a departure from what \phpseclib3\Net\SFTP * does. * * @param string $path_from @@ -643,7 +643,7 @@ class Stream /** * Flushes the output * - * See . Always returns true because \phpseclib\Net\SFTP doesn't cache stuff before writing + * See . Always returns true because \phpseclib3\Net\SFTP doesn't cache stuff before writing * * @return bool * @access public @@ -688,7 +688,7 @@ class Stream /** * Retrieve information about a file * - * Ignores the STREAM_URL_STAT_QUIET flag because the entirety of \phpseclib\Net\SFTP\Stream is quiet by default + * Ignores the STREAM_URL_STAT_QUIET flag because the entirety of \phpseclib3\Net\SFTP\Stream is quiet by default * might be worthwhile to reconstruct bits 12-16 (ie. the file type) if mode doesn't have them but we'll * cross that bridge when and if it's reached * @@ -735,7 +735,7 @@ class Stream * Change stream options * * STREAM_OPTION_WRITE_BUFFER isn't supported for the same reason stream_flush isn't. - * The other two aren't supported because of limitations in \phpseclib\Net\SFTP. + * The other two aren't supported because of limitations in \phpseclib3\Net\SFTP. * * @param int $option * @param int $arg1 diff --git a/phpseclib/Net/SSH2.php b/phpseclib/Net/SSH2.php index 04a6267f..0e58b643 100644 --- a/phpseclib/Net/SSH2.php +++ b/phpseclib/Net/SSH2.php @@ -10,7 +10,7 @@ * login('username', 'password')) { * exit('Login Failed'); * } @@ -24,9 +24,9 @@ * login('username', $key)) { * exit('Login Failed'); * } @@ -45,31 +45,31 @@ * @link http://phpseclib.sourceforge.net */ -namespace phpseclib\Net; +namespace phpseclib3\Net; -use phpseclib\Crypt\Blowfish; -use phpseclib\Crypt\Hash; -use phpseclib\Crypt\Random; -use phpseclib\Crypt\RC4; -use phpseclib\Crypt\Rijndael; -use phpseclib\Crypt\Common\PrivateKey; -use phpseclib\Crypt\RSA; -use phpseclib\Crypt\DSA; -use phpseclib\Crypt\EC; -use phpseclib\Crypt\DH; -use phpseclib\Crypt\TripleDES; -use phpseclib\Crypt\Twofish; -use phpseclib\Crypt\ChaCha20; -use phpseclib\Math\BigInteger; // Used to do Diffie-Hellman key exchange and DSA/RSA signature verification. -use phpseclib\System\SSH\Agent; -use phpseclib\System\SSH\Agent\Identity as AgentIdentity; -use phpseclib\Exception\NoSupportedAlgorithmsException; -use phpseclib\Exception\UnsupportedAlgorithmException; -use phpseclib\Exception\UnsupportedCurveException; -use phpseclib\Exception\ConnectionClosedException; -use phpseclib\Exception\UnableToConnectException; -use phpseclib\Exception\InsufficientSetupException; -use phpseclib\Common\Functions\Strings; +use phpseclib3\Crypt\Blowfish; +use phpseclib3\Crypt\Hash; +use phpseclib3\Crypt\Random; +use phpseclib3\Crypt\RC4; +use phpseclib3\Crypt\Rijndael; +use phpseclib3\Crypt\Common\PrivateKey; +use phpseclib3\Crypt\RSA; +use phpseclib3\Crypt\DSA; +use phpseclib3\Crypt\EC; +use phpseclib3\Crypt\DH; +use phpseclib3\Crypt\TripleDES; +use phpseclib3\Crypt\Twofish; +use phpseclib3\Crypt\ChaCha20; +use phpseclib3\Math\BigInteger; // Used to do Diffie-Hellman key exchange and DSA/RSA signature verification. +use phpseclib3\System\SSH\Agent; +use phpseclib3\System\SSH\Agent\Identity as AgentIdentity; +use phpseclib3\Exception\NoSupportedAlgorithmsException; +use phpseclib3\Exception\UnsupportedAlgorithmException; +use phpseclib3\Exception\UnsupportedCurveException; +use phpseclib3\Exception\ConnectionClosedException; +use phpseclib3\Exception\UnableToConnectException; +use phpseclib3\Exception\InsufficientSetupException; +use phpseclib3\Common\Functions\Strings; /** * Pure-PHP implementation of SSHv2. @@ -83,7 +83,7 @@ class SSH2 /**#@+ * Execution Bitmap Masks * - * @see \phpseclib\Net\SSH2::bitmap + * @see \phpseclib3\Net\SSH2::bitmap * @access private */ const MASK_CONSTRUCTOR = 0x00000001; @@ -106,8 +106,8 @@ class SSH2 * open request, and 'sender channel' is the channel number allocated by * the other side. * - * @see \phpseclib\Net\SSH2::send_channel_packet() - * @see \phpseclib\Net\SSH2::get_channel_packet() + * @see \phpseclib3\Net\SSH2::send_channel_packet() + * @see \phpseclib3\Net\SSH2::get_channel_packet() * @access private */ const CHANNEL_EXEC = 1; // PuTTy uses 0x100 @@ -119,7 +119,7 @@ class SSH2 /**#@+ * @access public - * @see \phpseclib\Net\SSH2::getLog() + * @see \phpseclib3\Net\SSH2::getLog() */ /** * Returns the message numbers @@ -145,7 +145,7 @@ class SSH2 /**#@+ * @access public - * @see \phpseclib\Net\SSH2::read() + * @see \phpseclib3\Net\SSH2::read() */ /** * Returns when a string matching $expect exactly is found @@ -929,7 +929,7 @@ class SSH2 /** * A System_SSH_Agent for use in the SSH2 Agent Forwarding scenario * - * @var \phpseclib\System\Ssh\Agent + * @var \phpseclib3\System\Ssh\Agent * @access private */ private $agent; @@ -1369,7 +1369,7 @@ class SSH2 * @param string|bool $kexinit_payload_server optional * @throws \UnexpectedValueException on receipt of unexpected packets * @throws \RuntimeException on other errors - * @throws \phpseclib\Exception\NoSupportedAlgorithmsException when none of the algorithms phpseclib has loaded are compatible + * @throws \phpseclib3\Exception\NoSupportedAlgorithmsException when none of the algorithms phpseclib has loaded are compatible * @access private */ private function key_exchange($kexinit_payload_server = false) @@ -1903,10 +1903,10 @@ class SSH2 /** * Maps an encryption algorithm name to an instance of a subclass of - * \phpseclib\Crypt\Common\SymmetricKey. + * \phpseclib3\Crypt\Common\SymmetricKey. * * @param string $algorithm Name of the encryption algorithm - * @return mixed Instance of \phpseclib\Crypt\Common\SymmetricKey or null for unknown + * @return mixed Instance of \phpseclib3\Crypt\Common\SymmetricKey or null for unknown * @access private */ private static function encryption_algorithm_to_crypt_instance($algorithm) @@ -1952,10 +1952,10 @@ class SSH2 /** * Maps an encryption algorithm name to an instance of a subclass of - * \phpseclib\Crypt\Hash. + * \phpseclib3\Crypt\Hash. * * @param string $algorithm Name of the encryption algorithm - * @return mixed Instance of \phpseclib\Crypt\Hash or null for unknown + * @return mixed Instance of \phpseclib3\Crypt\Hash or null for unknown * @access private */ private static function mac_algorithm_to_hash_instance($algorithm) @@ -2009,7 +2009,7 @@ class SSH2 /** * Login * - * The $password parameter can be a plaintext password, a \phpseclib\Crypt\RSA object or an array + * The $password parameter can be a plaintext password, a \phpseclib3\Crypt\RSA object or an array * * @param string $username * @param $args[] param mixed $password @@ -2143,7 +2143,7 @@ class SSH2 } if (!is_string($password)) { - throw new \UnexpectedValueException('$password needs to either be an instance of \phpseclib\Crypt\Common\PrivateKey, \System\SSH\Agent, an array or a string'); + throw new \UnexpectedValueException('$password needs to either be an instance of \phpseclib3\Crypt\Common\PrivateKey, \System\SSH\Agent, an array or a string'); } $packet = Strings::packSSH2( @@ -2349,7 +2349,7 @@ class SSH2 * Login with an ssh-agent provided key * * @param string $username - * @param \phpseclib\System\SSH\Agent $agent + * @param \phpseclib3\System\SSH\Agent $agent * @return bool * @access private */ @@ -2370,7 +2370,7 @@ class SSH2 * Login with an RSA private key * * @param string $username - * @param \phpseclib\Crypt\Common\PrivateKey $privatekey + * @param \phpseclib3\Crypt\Common\PrivateKey $privatekey * @return bool * @throws \RuntimeException on connection error * @access private @@ -2421,7 +2421,7 @@ class SSH2 if (is_array($curveName)) { throw new UnsupportedCurveException('Specified Curves are not supported by SSH2'); } - throw new UnsupportedCurveException('Named Curve of ' . $curveName . ' is not supported by phpseclib\'s SSH2 implementation'); + throw new UnsupportedCurveException('Named Curve of ' . $curveName . ' is not supported by phpseclib3\'s SSH2 implementation'); } } else if ($publickey instanceof DSA) { $privatekey = $privatekey->withSignatureFormat('SSH2'); @@ -2525,7 +2525,7 @@ class SSH2 /** * Execute Command * - * If $callback is set to false then \phpseclib\Net\SSH2::get_channel_packet(self::CHANNEL_EXEC) will need to be called manually. + * If $callback is set to false then \phpseclib3\Net\SSH2::get_channel_packet(self::CHANNEL_EXEC) will need to be called manually. * In all likelihood, this is not a feature you want to be taking advantage of. * * @param string $command @@ -2611,7 +2611,7 @@ class SSH2 } // sending a pty-req SSH_MSG_CHANNEL_REQUEST message is unnecessary and, in fact, in most cases, slows things - // down. the one place where it might be desirable is if you're doing something like \phpseclib\Net\SSH2::exec('ping localhost &'). + // down. the one place where it might be desirable is if you're doing something like \phpseclib3\Net\SSH2::exec('ping localhost &'). // with a pty-req SSH_MSG_CHANNEL_REQUEST, exec() will return immediately and the ping process will then // then immediately terminate. without such a request exec() will loop indefinitely. the ping process won't end but // neither will your script. @@ -4039,7 +4039,7 @@ class SSH2 /** * Closes and flushes a channel * - * \phpseclib\Net\SSH2 doesn't properly close most channels. For exec() channels are normally closed by the server + * \phpseclib3\Net\SSH2 doesn't properly close most channels. For exec() channels are normally closed by the server * and for SFTP channels are presumably closed when the client disconnects. This functions is intended * for SCP more than anything. * @@ -4631,7 +4631,7 @@ class SSH2 * * @return mixed * @throws \RuntimeException on badly formatted keys - * @throws \phpseclib\Exception\NoSupportedAlgorithmsException when the key isn't in a supported format + * @throws \phpseclib3\Exception\NoSupportedAlgorithmsException when the key isn't in a supported format * @access public */ public function getServerPublicHostKey() diff --git a/phpseclib/System/SSH/Agent.php b/phpseclib/System/SSH/Agent.php index c544ac5b..124b464f 100644 --- a/phpseclib/System/SSH/Agent.php +++ b/phpseclib/System/SSH/Agent.php @@ -10,9 +10,9 @@ * login('username', $agent)) { * exit('Login Failed'); * } @@ -31,18 +31,18 @@ * @internal See http://api.libssh.org/rfc/PROTOCOL.agent */ -namespace phpseclib\System\SSH; +namespace phpseclib3\System\SSH; -use phpseclib\Crypt\RSA; -use phpseclib\Exception\BadConfigurationException; -use phpseclib\System\SSH\Agent\Identity; -use phpseclib\Common\Functions\Strings; -use phpseclib\Crypt\PublicKeyLoader; +use phpseclib3\Crypt\RSA; +use phpseclib3\Exception\BadConfigurationException; +use phpseclib3\System\SSH\Agent\Identity; +use phpseclib3\Common\Functions\Strings; +use phpseclib3\Crypt\PublicKeyLoader; /** * Pure-PHP ssh-agent client identity factory * - * requestIdentities() method pumps out \phpseclib\System\SSH\Agent\Identity objects + * requestIdentities() method pumps out \phpseclib3\System\SSH\Agent\Identity objects * * @package SSH\Agent * @author Jim Wigginton @@ -130,8 +130,8 @@ class Agent /** * Default Constructor * - * @return \phpseclib\System\SSH\Agent - * @throws \phpseclib\Exception\BadConfigurationException if SSH_AUTH_SOCK cannot be found + * @return \phpseclib3\System\SSH\Agent + * @throws \phpseclib3\Exception\BadConfigurationException if SSH_AUTH_SOCK cannot be found * @throws \RuntimeException on connection errors * @access public */ @@ -160,7 +160,7 @@ class Agent * Request Identities * * See "2.5.2 Requesting a list of protocol 2 keys" - * Returns an array containing zero or more \phpseclib\System\SSH\Agent\Identity objects + * Returns an array containing zero or more \phpseclib3\System\SSH\Agent\Identity objects * * @return array * @throws \RuntimeException on receipt of unexpected packets @@ -219,7 +219,7 @@ class Agent * Signal that agent forwarding should * be requested when a channel is opened * - * @param \phpseclib\Net\SSH2 $ssh + * @param \phpseclib3\Net\SSH2 $ssh * @return bool * @access public */ @@ -233,7 +233,7 @@ class Agent /** * Request agent forwarding of remote server * - * @param \phpseclib\Net\SSH2 $ssh + * @param \phpseclib3\Net\SSH2 $ssh * @return bool * @access private */ @@ -255,7 +255,7 @@ class Agent * open to give the SSH Agent an opportunity * to take further action. i.e. request agent forwarding * - * @param \phpseclib\Net\SSH2 $ssh + * @param \phpseclib3\Net\SSH2 $ssh * @access private */ public function registerChannelOpen($ssh) diff --git a/phpseclib/System/SSH/Agent/Identity.php b/phpseclib/System/SSH/Agent/Identity.php index 96ddcb56..424c9474 100644 --- a/phpseclib/System/SSH/Agent/Identity.php +++ b/phpseclib/System/SSH/Agent/Identity.php @@ -14,22 +14,22 @@ * @internal See http://api.libssh.org/rfc/PROTOCOL.agent */ -namespace phpseclib\System\SSH\Agent; +namespace phpseclib3\System\SSH\Agent; -use phpseclib\Crypt\RSA; -use phpseclib\Crypt\DSA; -use phpseclib\Crypt\ECDSA; -use phpseclib\Exception\UnsupportedAlgorithmException; -use phpseclib\System\SSH\Agent; -use phpseclib\Common\Functions\Strings; -use phpseclib\Crypt\Common\PrivateKey; +use phpseclib3\Crypt\RSA; +use phpseclib3\Crypt\DSA; +use phpseclib3\Crypt\ECDSA; +use phpseclib3\Exception\UnsupportedAlgorithmException; +use phpseclib3\System\SSH\Agent; +use phpseclib3\Common\Functions\Strings; +use phpseclib3\Crypt\Common\PrivateKey; /** * Pure-PHP ssh-agent client identity object * - * Instantiation should only be performed by \phpseclib\System\SSH\Agent class. - * This could be thought of as implementing an interface that phpseclib\Crypt\RSA + * Instantiation should only be performed by \phpseclib3\System\SSH\Agent class. + * This could be thought of as implementing an interface that phpseclib3\Crypt\RSA * implements. ie. maybe a Net_SSH_Auth_PublicKey interface or something. * The methods in this interface would be getPublicKey and sign since those are the * methods phpseclib looks for to perform public key authentication. @@ -54,7 +54,7 @@ class Identity implements PrivateKey /** * Key Object * - * @var \phpseclib\Crypt\RSA + * @var \phpseclib3\Crypt\RSA * @access private * @see self::getPublicKey() */ @@ -105,7 +105,7 @@ class Identity implements PrivateKey * Default Constructor. * * @param resource $fsock - * @return \phpseclib\System\SSH\Agent\Identity + * @return \phpseclib3\System\SSH\Agent\Identity * @access private */ public function __construct($fsock) @@ -116,9 +116,9 @@ class Identity implements PrivateKey /** * Set Public Key * - * Called by \phpseclib\System\SSH\Agent::requestIdentities() + * Called by \phpseclib3\System\SSH\Agent::requestIdentities() * - * @param \phpseclib\Crypt\Common\PublicKey $key + * @param \phpseclib3\Crypt\Common\PublicKey $key * @access private */ public function withPublicKey($key) @@ -137,7 +137,7 @@ class Identity implements PrivateKey /** * Set Public Key * - * Called by \phpseclib\System\SSH\Agent::requestIdentities(). The key blob could be extracted from $this->key + * Called by \phpseclib3\System\SSH\Agent::requestIdentities(). The key blob could be extracted from $this->key * but this saves a small amount of computation. * * @param string $key_blob @@ -281,7 +281,7 @@ class Identity implements PrivateKey * @param int $padding optional * @return string * @throws \RuntimeException on connection errors - * @throws \phpseclib\Exception\UnsupportedAlgorithmException if the algorithm is unsupported + * @throws \phpseclib3\Exception\UnsupportedAlgorithmException if the algorithm is unsupported * @access public */ public function sign($message) diff --git a/tests/Functional/Net/SFTPLargeFileTest.php b/tests/Functional/Net/SFTPLargeFileTest.php index cc170e8a..d661f76a 100644 --- a/tests/Functional/Net/SFTPLargeFileTest.php +++ b/tests/Functional/Net/SFTPLargeFileTest.php @@ -6,8 +6,8 @@ * @license http://www.opensource.org/licenses/mit-license.html MIT License */ -use phpseclib\Crypt\Base; -use phpseclib\Net\SFTP; +use phpseclib3\Crypt\Base; +use phpseclib3\Net\SFTP; class Functional_Net_SFTPLargeFileTest extends Functional_Net_SFTPTestCase { diff --git a/tests/Functional/Net/SFTPStreamTest.php b/tests/Functional/Net/SFTPStreamTest.php index 3a0cfabf..aad4189e 100644 --- a/tests/Functional/Net/SFTPStreamTest.php +++ b/tests/Functional/Net/SFTPStreamTest.php @@ -6,7 +6,7 @@ * @license http://www.opensource.org/licenses/mit-license.html MIT License */ -use phpseclib\Net\SFTP\Stream; +use phpseclib3\Net\SFTP\Stream; class Functional_Net_SFTPStreamTest extends Functional_Net_SFTPTestCase { @@ -48,10 +48,10 @@ class Functional_Net_SFTPStreamTest extends Functional_Net_SFTPTestCase */ public function testConnectionReuse() { - $originalConnectionsCount = count(\phpseclib\Net\SSH2::getConnections()); + $originalConnectionsCount = count(\phpseclib3\Net\SSH2::getConnections()); $session = $this->sftp; $dirs = scandir("sftp://$session/"); - $this->assertCount($originalConnectionsCount, \phpseclib\Net\SSH2::getConnections()); + $this->assertCount($originalConnectionsCount, \phpseclib3\Net\SSH2::getConnections()); $this->assertEquals(['.', '..'], array_slice($dirs, 0, 2)); } diff --git a/tests/Functional/Net/SFTPTestCase.php b/tests/Functional/Net/SFTPTestCase.php index aec75e71..9805fc6f 100644 --- a/tests/Functional/Net/SFTPTestCase.php +++ b/tests/Functional/Net/SFTPTestCase.php @@ -6,7 +6,7 @@ * @license http://www.opensource.org/licenses/mit-license.html MIT License */ -use phpseclib\Net\SFTP; +use phpseclib3\Net\SFTP; /** * This class provides each test method with a new and empty $this->scratchDir. diff --git a/tests/Functional/Net/SFTPUserStoryTest.php b/tests/Functional/Net/SFTPUserStoryTest.php index f01cf155..530e8a25 100644 --- a/tests/Functional/Net/SFTPUserStoryTest.php +++ b/tests/Functional/Net/SFTPUserStoryTest.php @@ -6,7 +6,7 @@ * @license http://www.opensource.org/licenses/mit-license.html MIT License */ -use phpseclib\Net\SFTP; +use phpseclib3\Net\SFTP; class Functional_Net_SFTPUserStoryTest extends PhpseclibFunctionalTestCase { diff --git a/tests/Functional/Net/SFTPWrongServerTest.php b/tests/Functional/Net/SFTPWrongServerTest.php index 0a715f1e..634759ac 100644 --- a/tests/Functional/Net/SFTPWrongServerTest.php +++ b/tests/Functional/Net/SFTPWrongServerTest.php @@ -1,7 +1,7 @@ isFinal()) { continue; @@ -80,7 +80,7 @@ class Unit_Crypt_EC_CurveTest extends PhpseclibTestCase public function curvesWithOIDs() { - $class = new ReflectionClass('phpseclib\Crypt\EC\Formats\Keys\PKCS8'); + $class = new ReflectionClass('phpseclib3\Crypt\EC\Formats\Keys\PKCS8'); $initialize = $class->getMethod('initialize_static_variables'); $initialize->setAccessible(true); @@ -105,7 +105,7 @@ class Unit_Crypt_EC_CurveTest extends PhpseclibTestCase */ public function testBasePoint($name) { - $class = 'phpseclib\Crypt\EC\Curves\\' . $name; + $class = 'phpseclib3\Crypt\EC\Curves\\' . $name; $curve = new $class; $this->assertTrue($curve->verifyPoint($curve->getBasePoint()), "Failed to verify basepoint of curve $name"); } @@ -118,7 +118,7 @@ class Unit_Crypt_EC_CurveTest extends PhpseclibTestCase */ public function testKeyGeneration($name) { - $class = 'phpseclib\Crypt\EC\Curves\\' . $name; + $class = 'phpseclib3\Crypt\EC\Curves\\' . $name; $curve = new $class; $dA = $curve->createRandomMultiplier(); $QA = $curve->multiplyPoint($curve->getBasePoint(), $dA); diff --git a/tests/Unit/Crypt/EC/KeyTest.php b/tests/Unit/Crypt/EC/KeyTest.php index a327c40e..1d6a17a3 100644 --- a/tests/Unit/Crypt/EC/KeyTest.php +++ b/tests/Unit/Crypt/EC/KeyTest.php @@ -5,14 +5,14 @@ * @license http://www.opensource.org/licenses/mit-license.html MIT License */ -use phpseclib\Crypt\EC; -use phpseclib\Crypt\EC\Formats\Keys\PKCS1; -use phpseclib\Crypt\EC\Formats\Keys\PKCS8; -use phpseclib\Crypt\EC\Formats\Keys\PuTTY; -use phpseclib\Crypt\EC\Formats\Keys\OpenSSH; -use phpseclib\Crypt\EC\Formats\Keys\XML; -use phpseclib\Crypt\PublicKeyLoader; -use phpseclib\Crypt\EC\PrivateKey; +use phpseclib3\Crypt\EC; +use phpseclib3\Crypt\EC\Formats\Keys\PKCS1; +use phpseclib3\Crypt\EC\Formats\Keys\PKCS8; +use phpseclib3\Crypt\EC\Formats\Keys\PuTTY; +use phpseclib3\Crypt\EC\Formats\Keys\OpenSSH; +use phpseclib3\Crypt\EC\Formats\Keys\XML; +use phpseclib3\Crypt\PublicKeyLoader; +use phpseclib3\Crypt\EC\PrivateKey; class Unit_Crypt_EC_LoadKeyTest extends PhpseclibTestCase { diff --git a/tests/Unit/Crypt/GCMTest.php b/tests/Unit/Crypt/GCMTest.php index 6e2026d0..090f2152 100644 --- a/tests/Unit/Crypt/GCMTest.php +++ b/tests/Unit/Crypt/GCMTest.php @@ -1,237 +1,237 @@ - - * @copyright 2013 Andreas Fischer - * @license http://www.opensource.org/licenses/mit-license.html MIT License - */ - -use phpseclib\Crypt\AES; - -class Unit_Crypt_GCMTest extends PhpseclibTestCase -{ - /** - * Produces all combinations of test values. - * - * @return array - */ - public function engine128Vectors() - { - $engines = [ - 'PHP', - 'Eval', - 'mcrypt', - 'OpenSSL', - 'OpenSSL (GCM)' - ]; - - // test vectors come from the following URL: - // http://csrc.nist.gov/groups/ST/toolkit/BCM/documents/proposedmodes/gcm/gcm-spec.pdf - - $p1 = '00000000000000000000000000000000'; - $p2 = 'd9313225f88406e5a55909c5aff5269a' . - '86a7a9531534f7da2e4c303d8a318a72' . - '1c3c0c95956809532fcf0e2449a6b525' . - 'b16aedf5aa0de657ba637b391aafd255'; - $p3 = 'd9313225f88406e5a55909c5aff5269a' . - '86a7a9531534f7da2e4c303d8a318a72' . - '1c3c0c95956809532fcf0e2449a6b525' . - 'b16aedf5aa0de657ba637b39'; - - $n1 = '000000000000000000000000'; - $n2 = 'cafebabefacedbaddecaf888'; - $n3 = 'cafebabefacedbad'; - $n4 = '9313225df88406e555909c5aff5269aa' . - '6a7a9538534f7da1e4c303d2a318a728' . - 'c3c0c95156809539fcf0e2429a6b5254' . - '16aedbf5a0de6a57a637b39b'; - - $k1 = '00000000000000000000000000000000'; - $k2 = 'feffe9928665731c6d6a8f9467308308'; - - $c1 = '0388dace60b6a392f328c2b971b2fe78'; - $c2 = '42831ec2217774244b7221b784d0d49c' . - 'e3aa212f2c02a4e035c17e2329aca12e' . - '21d514b25466931c7d8f6a5aac84aa05' . - '1ba30b396a0aac973d58e091473f5985'; - $c3 = '42831ec2217774244b7221b784d0d49c' . - 'e3aa212f2c02a4e035c17e2329aca12e' . - '21d514b25466931c7d8f6a5aac84aa05' . - '1ba30b396a0aac973d58e091'; - $c4 = '61353b4c2806934a777ff51fa22a4755' . - '699b2a714fcdc6f83766e5f97b6c7423' . - '73806900e49f24b22b097544d4896b42' . - '4989b5e1ebac0f07c23f4598'; - $c5 = '8ce24998625615b603a033aca13fb894' . - 'be9112a5c3a211a8ba262a3cca7e2ca7' . - '01e4a9a4fba43c90ccdcb281d48c7c6f' . - 'd62875d2aca417034c34aee5'; - - $a1 = 'feedfacedeadbeeffeedfacedeadbeef' . - 'abaddad2'; - - $subvectors = [ - // key, plaintext, nonce, aad, ciphertext, tag - // Test Case 1 - [$k1, '', $n1, '', '', '58e2fccefa7e3061367f1d57a4e7455a'], - // Test Case 2 - [$k1, $p1, $n1, '', $c1, 'ab6e47d42cec13bdf53a67b21257bddf'], - // Test Case 3 - [$k2, $p2, $n2, '', $c2, '4d5c2af327cd64a62cf35abd2ba6fab4'], - // Test Case 4 - [$k2, $p3, $n2, $a1, $c3, '5bc94fbc3221a5db94fae95ae7121a47'], - // Test Case 5 - [$k2, $p3, $n3, $a1, $c4, '3612d2e79e3b0785561be14aaca2fccb'], - // Test Case 6 - [$k2, $p3, $n4, $a1, $c5, '619cc5aefffe0bfa462af43c1699d050'] - ]; - - $vectors = []; - for ($i = 0; $i < count($subvectors); $i++) { - for ($j = 0; $j < count($subvectors[$i]); $j++) { - $subvectors[$i][$j] = pack('H*', $subvectors[$i][$j]); - } - foreach ($engines as $engine) { - $temp = $subvectors[$i]; - array_unshift($temp, $engine); - $vectors[] = $temp; - } - } - - return $vectors; - } - - /** - * @dataProvider engine128Vectors - */ - public function test128Vectors($engine, $key, $plaintext, $nonce, $aad, $ciphertext, $tag) - { - $aes = new AES('gcm'); - $aes->setKey($key); - $aes->setNonce($nonce); - $aes->setAAD($aad); - - if (!$aes->isValidEngine($engine)) { - self::markTestSkipped("Unable to initialize $engine engine"); - } - $aes->setPreferredEngine($engine); - - $ciphertext2 = $aes->encrypt($plaintext); - $this->assertEquals($ciphertext, $ciphertext2); - $this->assertEquals($tag, $aes->getTag()); - $aes->setTag($tag); - $this->assertEquals($plaintext, $aes->decrypt($ciphertext)); - } - - /** - * Produces all combinations of test values. - * - * @return array - */ - public function engine256Vectors() - { - $engines = [ - 'PHP', - 'Eval', - 'mcrypt', - 'OpenSSL', - 'OpenSSL (GCM)', - 'libsodium' - ]; - - $p1 = '00000000000000000000000000000000'; - $p2 = 'd9313225f88406e5a55909c5aff5269a' . - '86a7a9531534f7da2e4c303d8a318a72' . - '1c3c0c95956809532fcf0e2449a6b525' . - 'b16aedf5aa0de657ba637b391aafd255'; - $p3 = 'd9313225f88406e5a55909c5aff5269a' . - '86a7a9531534f7da2e4c303d8a318a72' . - '1c3c0c95956809532fcf0e2449a6b525' . - 'b16aedf5aa0de657ba637b39'; - - $n1 = '000000000000000000000000'; - $n2 = 'cafebabefacedbaddecaf888'; - $n3 = 'cafebabefacedbad'; - $n4 = '9313225df88406e555909c5aff5269aa' . - '6a7a9538534f7da1e4c303d2a318a728' . - 'c3c0c95156809539fcf0e2429a6b5254' . - '16aedbf5a0de6a57a637b39b'; - - $k1 = '00000000000000000000000000000000' . - '00000000000000000000000000000000'; - $k2 = 'feffe9928665731c6d6a8f9467308308' . - 'feffe9928665731c6d6a8f9467308308'; - - $c1 = 'cea7403d4d606b6e074ec5d3baf39d18'; - $c2 = '522dc1f099567d07f47f37a32a84427d' . - '643a8cdcbfe5c0c97598a2bd2555d1aa' . - '8cb08e48590dbb3da7b08b1056828838' . - 'c5f61e6393ba7a0abcc9f662898015ad'; - $c3 = '522dc1f099567d07f47f37a32a84427d' . - '643a8cdcbfe5c0c97598a2bd2555d1aa' . - '8cb08e48590dbb3da7b08b1056828838' . - 'c5f61e6393ba7a0abcc9f662'; - $c4 = 'c3762df1ca787d32ae47c13bf19844cb' . - 'af1ae14d0b976afac52ff7d79bba9de0' . - 'feb582d33934a4f0954cc2363bc73f78' . - '62ac430e64abe499f47c9b1f'; - $c5 = '5a8def2f0c9e53f1f75d7853659e2a20' . - 'eeb2b22aafde6419a058ab4f6f746bf4' . - '0fc0c3b780f244452da3ebf1c5d82cde' . - 'a2418997200ef82e44ae7e3f'; - - $a1 = 'feedfacedeadbeeffeedfacedeadbeef' . - 'abaddad2'; - - $subvectors = [ - // key, plaintext, nonce, aad, ciphertext, tag - // Test Case 13 - [$k1, '', $n1, '', '', '530f8afbc74536b9a963b4f1c4cb738b'], - // Test Case 14 - [$k1, $p1, $n1, '', $c1, 'd0d1c8a799996bf0265b98b5d48ab919'], - // Test Case 15 - [$k2, $p2, $n2, '', $c2, 'b094dac5d93471bdec1a502270e3cc6c'], - // Test Case 16 - [$k2, $p3, $n2, $a1, $c3, '76fc6ece0f4e1768cddf8853bb2d551b'], - // Test Case 17 - [$k2, $p3, $n3, $a1, $c4, '3a337dbf46a792c45e454913fe2ea8f2'], - // Test Case 18 - [$k2, $p3, $n4, $a1, $c5, 'a44a8266ee1c8eb0c8b5d4cf5ae9f19a'] - ]; - - $vectors = []; - for ($i = 0; $i < count($subvectors); $i++) { - for ($j = 0; $j < count($subvectors[$i]); $j++) { - $subvectors[$i][$j] = pack('H*', $subvectors[$i][$j]); - } - foreach ($engines as $engine) { - $temp = $subvectors[$i]; - array_unshift($temp, $engine); - $vectors[] = $temp; - } - } - - return $vectors; - } - - /** - * @dataProvider engine256Vectors - */ - public function test256Vectors($engine, $key, $plaintext, $nonce, $aad, $ciphertext, $tag) - { - $aes = new AES('gcm'); - $aes->setKey($key); - $aes->setNonce($nonce); - $aes->setAAD($aad); - - if (!$aes->isValidEngine($engine)) { - self::markTestSkipped("Unable to initialize $engine engine"); - } - $aes->setPreferredEngine($engine); - - $ciphertext2 = $aes->encrypt($plaintext); - $this->assertEquals($ciphertext, $ciphertext2); - $this->assertEquals($tag, $aes->getTag()); - $aes->setTag($tag); - $this->assertEquals($plaintext, $aes->decrypt($ciphertext)); - } -} + + * @copyright 2013 Andreas Fischer + * @license http://www.opensource.org/licenses/mit-license.html MIT License + */ + +use phpseclib3\Crypt\AES; + +class Unit_Crypt_GCMTest extends PhpseclibTestCase +{ + /** + * Produces all combinations of test values. + * + * @return array + */ + public function engine128Vectors() + { + $engines = [ + 'PHP', + 'Eval', + 'mcrypt', + 'OpenSSL', + 'OpenSSL (GCM)' + ]; + + // test vectors come from the following URL: + // http://csrc.nist.gov/groups/ST/toolkit/BCM/documents/proposedmodes/gcm/gcm-spec.pdf + + $p1 = '00000000000000000000000000000000'; + $p2 = 'd9313225f88406e5a55909c5aff5269a' . + '86a7a9531534f7da2e4c303d8a318a72' . + '1c3c0c95956809532fcf0e2449a6b525' . + 'b16aedf5aa0de657ba637b391aafd255'; + $p3 = 'd9313225f88406e5a55909c5aff5269a' . + '86a7a9531534f7da2e4c303d8a318a72' . + '1c3c0c95956809532fcf0e2449a6b525' . + 'b16aedf5aa0de657ba637b39'; + + $n1 = '000000000000000000000000'; + $n2 = 'cafebabefacedbaddecaf888'; + $n3 = 'cafebabefacedbad'; + $n4 = '9313225df88406e555909c5aff5269aa' . + '6a7a9538534f7da1e4c303d2a318a728' . + 'c3c0c95156809539fcf0e2429a6b5254' . + '16aedbf5a0de6a57a637b39b'; + + $k1 = '00000000000000000000000000000000'; + $k2 = 'feffe9928665731c6d6a8f9467308308'; + + $c1 = '0388dace60b6a392f328c2b971b2fe78'; + $c2 = '42831ec2217774244b7221b784d0d49c' . + 'e3aa212f2c02a4e035c17e2329aca12e' . + '21d514b25466931c7d8f6a5aac84aa05' . + '1ba30b396a0aac973d58e091473f5985'; + $c3 = '42831ec2217774244b7221b784d0d49c' . + 'e3aa212f2c02a4e035c17e2329aca12e' . + '21d514b25466931c7d8f6a5aac84aa05' . + '1ba30b396a0aac973d58e091'; + $c4 = '61353b4c2806934a777ff51fa22a4755' . + '699b2a714fcdc6f83766e5f97b6c7423' . + '73806900e49f24b22b097544d4896b42' . + '4989b5e1ebac0f07c23f4598'; + $c5 = '8ce24998625615b603a033aca13fb894' . + 'be9112a5c3a211a8ba262a3cca7e2ca7' . + '01e4a9a4fba43c90ccdcb281d48c7c6f' . + 'd62875d2aca417034c34aee5'; + + $a1 = 'feedfacedeadbeeffeedfacedeadbeef' . + 'abaddad2'; + + $subvectors = [ + // key, plaintext, nonce, aad, ciphertext, tag + // Test Case 1 + [$k1, '', $n1, '', '', '58e2fccefa7e3061367f1d57a4e7455a'], + // Test Case 2 + [$k1, $p1, $n1, '', $c1, 'ab6e47d42cec13bdf53a67b21257bddf'], + // Test Case 3 + [$k2, $p2, $n2, '', $c2, '4d5c2af327cd64a62cf35abd2ba6fab4'], + // Test Case 4 + [$k2, $p3, $n2, $a1, $c3, '5bc94fbc3221a5db94fae95ae7121a47'], + // Test Case 5 + [$k2, $p3, $n3, $a1, $c4, '3612d2e79e3b0785561be14aaca2fccb'], + // Test Case 6 + [$k2, $p3, $n4, $a1, $c5, '619cc5aefffe0bfa462af43c1699d050'] + ]; + + $vectors = []; + for ($i = 0; $i < count($subvectors); $i++) { + for ($j = 0; $j < count($subvectors[$i]); $j++) { + $subvectors[$i][$j] = pack('H*', $subvectors[$i][$j]); + } + foreach ($engines as $engine) { + $temp = $subvectors[$i]; + array_unshift($temp, $engine); + $vectors[] = $temp; + } + } + + return $vectors; + } + + /** + * @dataProvider engine128Vectors + */ + public function test128Vectors($engine, $key, $plaintext, $nonce, $aad, $ciphertext, $tag) + { + $aes = new AES('gcm'); + $aes->setKey($key); + $aes->setNonce($nonce); + $aes->setAAD($aad); + + if (!$aes->isValidEngine($engine)) { + self::markTestSkipped("Unable to initialize $engine engine"); + } + $aes->setPreferredEngine($engine); + + $ciphertext2 = $aes->encrypt($plaintext); + $this->assertEquals($ciphertext, $ciphertext2); + $this->assertEquals($tag, $aes->getTag()); + $aes->setTag($tag); + $this->assertEquals($plaintext, $aes->decrypt($ciphertext)); + } + + /** + * Produces all combinations of test values. + * + * @return array + */ + public function engine256Vectors() + { + $engines = [ + 'PHP', + 'Eval', + 'mcrypt', + 'OpenSSL', + 'OpenSSL (GCM)', + 'libsodium' + ]; + + $p1 = '00000000000000000000000000000000'; + $p2 = 'd9313225f88406e5a55909c5aff5269a' . + '86a7a9531534f7da2e4c303d8a318a72' . + '1c3c0c95956809532fcf0e2449a6b525' . + 'b16aedf5aa0de657ba637b391aafd255'; + $p3 = 'd9313225f88406e5a55909c5aff5269a' . + '86a7a9531534f7da2e4c303d8a318a72' . + '1c3c0c95956809532fcf0e2449a6b525' . + 'b16aedf5aa0de657ba637b39'; + + $n1 = '000000000000000000000000'; + $n2 = 'cafebabefacedbaddecaf888'; + $n3 = 'cafebabefacedbad'; + $n4 = '9313225df88406e555909c5aff5269aa' . + '6a7a9538534f7da1e4c303d2a318a728' . + 'c3c0c95156809539fcf0e2429a6b5254' . + '16aedbf5a0de6a57a637b39b'; + + $k1 = '00000000000000000000000000000000' . + '00000000000000000000000000000000'; + $k2 = 'feffe9928665731c6d6a8f9467308308' . + 'feffe9928665731c6d6a8f9467308308'; + + $c1 = 'cea7403d4d606b6e074ec5d3baf39d18'; + $c2 = '522dc1f099567d07f47f37a32a84427d' . + '643a8cdcbfe5c0c97598a2bd2555d1aa' . + '8cb08e48590dbb3da7b08b1056828838' . + 'c5f61e6393ba7a0abcc9f662898015ad'; + $c3 = '522dc1f099567d07f47f37a32a84427d' . + '643a8cdcbfe5c0c97598a2bd2555d1aa' . + '8cb08e48590dbb3da7b08b1056828838' . + 'c5f61e6393ba7a0abcc9f662'; + $c4 = 'c3762df1ca787d32ae47c13bf19844cb' . + 'af1ae14d0b976afac52ff7d79bba9de0' . + 'feb582d33934a4f0954cc2363bc73f78' . + '62ac430e64abe499f47c9b1f'; + $c5 = '5a8def2f0c9e53f1f75d7853659e2a20' . + 'eeb2b22aafde6419a058ab4f6f746bf4' . + '0fc0c3b780f244452da3ebf1c5d82cde' . + 'a2418997200ef82e44ae7e3f'; + + $a1 = 'feedfacedeadbeeffeedfacedeadbeef' . + 'abaddad2'; + + $subvectors = [ + // key, plaintext, nonce, aad, ciphertext, tag + // Test Case 13 + [$k1, '', $n1, '', '', '530f8afbc74536b9a963b4f1c4cb738b'], + // Test Case 14 + [$k1, $p1, $n1, '', $c1, 'd0d1c8a799996bf0265b98b5d48ab919'], + // Test Case 15 + [$k2, $p2, $n2, '', $c2, 'b094dac5d93471bdec1a502270e3cc6c'], + // Test Case 16 + [$k2, $p3, $n2, $a1, $c3, '76fc6ece0f4e1768cddf8853bb2d551b'], + // Test Case 17 + [$k2, $p3, $n3, $a1, $c4, '3a337dbf46a792c45e454913fe2ea8f2'], + // Test Case 18 + [$k2, $p3, $n4, $a1, $c5, 'a44a8266ee1c8eb0c8b5d4cf5ae9f19a'] + ]; + + $vectors = []; + for ($i = 0; $i < count($subvectors); $i++) { + for ($j = 0; $j < count($subvectors[$i]); $j++) { + $subvectors[$i][$j] = pack('H*', $subvectors[$i][$j]); + } + foreach ($engines as $engine) { + $temp = $subvectors[$i]; + array_unshift($temp, $engine); + $vectors[] = $temp; + } + } + + return $vectors; + } + + /** + * @dataProvider engine256Vectors + */ + public function test256Vectors($engine, $key, $plaintext, $nonce, $aad, $ciphertext, $tag) + { + $aes = new AES('gcm'); + $aes->setKey($key); + $aes->setNonce($nonce); + $aes->setAAD($aad); + + if (!$aes->isValidEngine($engine)) { + self::markTestSkipped("Unable to initialize $engine engine"); + } + $aes->setPreferredEngine($engine); + + $ciphertext2 = $aes->encrypt($plaintext); + $this->assertEquals($ciphertext, $ciphertext2); + $this->assertEquals($tag, $aes->getTag()); + $aes->setTag($tag); + $this->assertEquals($plaintext, $aes->decrypt($ciphertext)); + } +} diff --git a/tests/Unit/Crypt/HashTest.php b/tests/Unit/Crypt/HashTest.php index 9ab52f3b..9c8a1e3d 100644 --- a/tests/Unit/Crypt/HashTest.php +++ b/tests/Unit/Crypt/HashTest.php @@ -5,7 +5,7 @@ * @license http://www.opensource.org/licenses/mit-license.html MIT License */ -use phpseclib\Crypt\Hash; +use phpseclib3\Crypt\Hash; class Unit_Crypt_HashTest extends PhpseclibTestCase { @@ -374,7 +374,7 @@ class Unit_Crypt_HashTest extends PhpseclibTestCase } /** - * @expectedException \phpseclib\Exception\UnsupportedAlgorithmException + * @expectedException \phpseclib3\Exception\UnsupportedAlgorithmException */ public function testConstructorArgumentInvalid() { @@ -382,7 +382,7 @@ class Unit_Crypt_HashTest extends PhpseclibTestCase } /** - * @expectedException \phpseclib\Exception\UnsupportedAlgorithmException + * @expectedException \phpseclib3\Exception\UnsupportedAlgorithmException */ public function testSetHashInvalid() { diff --git a/tests/Unit/Crypt/RC2Test.php b/tests/Unit/Crypt/RC2Test.php index 799d7201..bd1ed161 100644 --- a/tests/Unit/Crypt/RC2Test.php +++ b/tests/Unit/Crypt/RC2Test.php @@ -5,7 +5,7 @@ * @license http://www.opensource.org/licenses/mit-license.html MIT License */ -use phpseclib\Crypt\RC2; +use phpseclib3\Crypt\RC2; class Unit_Crypt_RC2Test extends PhpseclibTestCase { diff --git a/tests/Unit/Crypt/RC4Test.php b/tests/Unit/Crypt/RC4Test.php index 762ac91b..92df2c42 100644 --- a/tests/Unit/Crypt/RC4Test.php +++ b/tests/Unit/Crypt/RC4Test.php @@ -5,8 +5,8 @@ * @license http://www.opensource.org/licenses/mit-license.html MIT License */ -use phpseclib\Crypt\RC4; -use phpseclib\Crypt\Random; +use phpseclib3\Crypt\RC4; +use phpseclib3\Crypt\Random; class Unit_Crypt_RC4Test extends PhpseclibTestCase { diff --git a/tests/Unit/Crypt/RSA/CreateKeyTest.php b/tests/Unit/Crypt/RSA/CreateKeyTest.php index 433d23a7..6506d862 100644 --- a/tests/Unit/Crypt/RSA/CreateKeyTest.php +++ b/tests/Unit/Crypt/RSA/CreateKeyTest.php @@ -6,10 +6,10 @@ * @license http://www.opensource.org/licenses/mit-license.html MIT License */ -use phpseclib\Crypt\RSA; -use phpseclib\Crypt\RSA\Formats\Keys\PKCS1; -use phpseclib\Crypt\RSA\PrivateKey; -use phpseclib\Crypt\RSA\PublicKey; +use phpseclib3\Crypt\RSA; +use phpseclib3\Crypt\RSA\Formats\Keys\PKCS1; +use phpseclib3\Crypt\RSA\PrivateKey; +use phpseclib3\Crypt\RSA\PublicKey; class Unit_Crypt_RSA_CreateKeyTest extends PhpseclibTestCase { diff --git a/tests/Unit/Crypt/RSA/LoadKeyTest.php b/tests/Unit/Crypt/RSA/LoadKeyTest.php index 48ddab5c..ac3efd78 100644 --- a/tests/Unit/Crypt/RSA/LoadKeyTest.php +++ b/tests/Unit/Crypt/RSA/LoadKeyTest.php @@ -5,16 +5,16 @@ * @license http://www.opensource.org/licenses/mit-license.html MIT License */ -use phpseclib\Crypt\RSA; -use phpseclib\Crypt\PublicKeyLoader; -use phpseclib\Crypt\RSA\PrivateKey; -use phpseclib\Crypt\RSA\PublicKey; -use phpseclib\Crypt\RSA\Formats\Keys\PKCS1; -use phpseclib\Crypt\RSA\Formats\Keys\PKCS8; -use phpseclib\Crypt\RSA\Formats\Keys\PuTTY; -use phpseclib\Crypt\RSA\Formats\Keys\OpenSSH; -use phpseclib\Crypt\RSA\Formats\Keys\PSS; -use phpseclib\Math\BigInteger; +use phpseclib3\Crypt\RSA; +use phpseclib3\Crypt\PublicKeyLoader; +use phpseclib3\Crypt\RSA\PrivateKey; +use phpseclib3\Crypt\RSA\PublicKey; +use phpseclib3\Crypt\RSA\Formats\Keys\PKCS1; +use phpseclib3\Crypt\RSA\Formats\Keys\PKCS8; +use phpseclib3\Crypt\RSA\Formats\Keys\PuTTY; +use phpseclib3\Crypt\RSA\Formats\Keys\OpenSSH; +use phpseclib3\Crypt\RSA\Formats\Keys\PSS; +use phpseclib3\Math\BigInteger; class Unit_Crypt_RSA_LoadKeyTest extends PhpseclibTestCase { @@ -25,7 +25,7 @@ class Unit_Crypt_RSA_LoadKeyTest extends PhpseclibTestCase } /** - * @expectedException \phpseclib\Exception\NoKeyLoadedException + * @expectedException \phpseclib3\Exception\NoKeyLoadedException */ public function testBadKey() { diff --git a/tests/Unit/Crypt/RSA/ModeTest.php b/tests/Unit/Crypt/RSA/ModeTest.php index f2cb4e5a..df965dc9 100644 --- a/tests/Unit/Crypt/RSA/ModeTest.php +++ b/tests/Unit/Crypt/RSA/ModeTest.php @@ -5,10 +5,10 @@ * @license http://www.opensource.org/licenses/mit-license.html MIT License */ -use phpseclib\Crypt\RSA; -use phpseclib\Math\BigInteger; -use phpseclib\Crypt\PublicKeyLoader; -use phpseclib\Crypt\RSA\Formats\Keys\PKCS8; +use phpseclib3\Crypt\RSA; +use phpseclib3\Math\BigInteger; +use phpseclib3\Crypt\PublicKeyLoader; +use phpseclib3\Crypt\RSA\Formats\Keys\PKCS8; class Unit_Crypt_RSA_ModeTest extends PhpseclibTestCase { diff --git a/tests/Unit/Crypt/RandomTest.php b/tests/Unit/Crypt/RandomTest.php index e2cffe5f..5385826c 100644 --- a/tests/Unit/Crypt/RandomTest.php +++ b/tests/Unit/Crypt/RandomTest.php @@ -5,7 +5,7 @@ * @license http://www.opensource.org/licenses/mit-license.html MIT License */ -use phpseclib\Crypt\Random; +use phpseclib3\Crypt\Random; class Unit_Crypt_RandomTest extends PhpseclibTestCase { diff --git a/tests/Unit/Crypt/Salsa20.php b/tests/Unit/Crypt/Salsa20.php index b4e74526..974feba7 100644 --- a/tests/Unit/Crypt/Salsa20.php +++ b/tests/Unit/Crypt/Salsa20.php @@ -5,7 +5,7 @@ * @license http://www.opensource.org/licenses/mit-license.html MIT License */ -use phpseclib\Crypt\Salsa20; +use phpseclib3\Crypt\Salsa20; class Unit_Crypt_Salsa20Test extends PhpseclibTestCase { diff --git a/tests/Unit/Crypt/TripleDESTest.php b/tests/Unit/Crypt/TripleDESTest.php index 6dc5398b..700bb211 100644 --- a/tests/Unit/Crypt/TripleDESTest.php +++ b/tests/Unit/Crypt/TripleDESTest.php @@ -5,7 +5,7 @@ * @license http://www.opensource.org/licenses/mit-license.html MIT License */ -use phpseclib\Crypt\TripleDES; +use phpseclib3\Crypt\TripleDES; class Unit_Crypt_TripleDESTest extends PhpseclibTestCase { diff --git a/tests/Unit/Crypt/TwofishTest.php b/tests/Unit/Crypt/TwofishTest.php index 11650f41..e9f3f78d 100644 --- a/tests/Unit/Crypt/TwofishTest.php +++ b/tests/Unit/Crypt/TwofishTest.php @@ -5,7 +5,7 @@ * @license http://www.opensource.org/licenses/mit-license.html MIT License */ -use phpseclib\Crypt\Twofish; +use phpseclib3\Crypt\Twofish; class Unit_Crypt_TwofishTest extends PhpseclibTestCase { diff --git a/tests/Unit/File/ANSITest.php b/tests/Unit/File/ANSITest.php index 6c785a5b..0cc4a029 100644 --- a/tests/Unit/File/ANSITest.php +++ b/tests/Unit/File/ANSITest.php @@ -5,7 +5,7 @@ * @license http://www.opensource.org/licenses/mit-license.html MIT License */ -use phpseclib\File\ANSI; +use phpseclib3\File\ANSI; class Unit_File_ANSITest extends PhpseclibTestCase { diff --git a/tests/Unit/File/ASN1Test.php b/tests/Unit/File/ASN1Test.php index b498deff..810111e0 100644 --- a/tests/Unit/File/ASN1Test.php +++ b/tests/Unit/File/ASN1Test.php @@ -5,12 +5,12 @@ * @license http://www.opensource.org/licenses/mit-license.html MIT License */ -use phpseclib\File\ASN1; +use phpseclib3\File\ASN1; class Unit_File_ASN1Test extends PhpseclibTestCase { /** - * on older versions of \phpseclib\File\ASN1 this would yield a PHP Warning + * on older versions of \phpseclib3\File\ASN1 this would yield a PHP Warning * @group github275 */ public function testAnyString() @@ -82,7 +82,7 @@ class Unit_File_ASN1Test extends PhpseclibTestCase } /** - * on older versions of \phpseclib\File\ASN1 this would produce a null instead of an array + * on older versions of \phpseclib3\File\ASN1 this would produce a null instead of an array * @group github275 */ public function testIncorrectString() @@ -121,7 +121,7 @@ class Unit_File_ASN1Test extends PhpseclibTestCase 'min' => 0, 'max' => -1, 'type' => ASN1::TYPE_SEQUENCE, - 'children' => ['type' => ASN1::TYPE_IA5_STRING] // should be \phpseclib\File\ASN1::TYPE_GENERAL_STRING + 'children' => ['type' => ASN1::TYPE_IA5_STRING] // should be \phpseclib3\File\ASN1::TYPE_GENERAL_STRING ] ] ]; @@ -301,7 +301,7 @@ class Unit_File_ASN1Test extends PhpseclibTestCase continue; } - constant('phpseclib\\File\\ASN1\\Maps\\' . basename($file, '.php') . '::MAP'); + constant('phpseclib3\\File\\ASN1\\Maps\\' . basename($file, '.php') . '::MAP'); } } diff --git a/tests/Unit/File/X509/CRLTest.php b/tests/Unit/File/X509/CRLTest.php index 78ad5d7d..12ff839f 100644 --- a/tests/Unit/File/X509/CRLTest.php +++ b/tests/Unit/File/X509/CRLTest.php @@ -5,7 +5,7 @@ * @license http://www.opensource.org/licenses/mit-license.html MIT License */ -use phpseclib\File\X509; +use phpseclib3\File\X509; class Unit_File_X509_CRLTest extends PhpseclibTestCase { diff --git a/tests/Unit/File/X509/CSRTest.php b/tests/Unit/File/X509/CSRTest.php index 593a40a4..4e5e666f 100644 --- a/tests/Unit/File/X509/CSRTest.php +++ b/tests/Unit/File/X509/CSRTest.php @@ -5,9 +5,9 @@ * @license http://www.opensource.org/licenses/mit-license.html MIT License */ -use phpseclib\File\X509; -use phpseclib\Crypt\RSA; -use phpseclib\Crypt\PublicKeyLoader; +use phpseclib3\File\X509; +use phpseclib3\Crypt\RSA; +use phpseclib3\Crypt\PublicKeyLoader; class Unit_File_X509_CSRTest extends PhpseclibTestCase { diff --git a/tests/Unit/File/X509/SPKACTest.php b/tests/Unit/File/X509/SPKACTest.php index 8e270cf9..d71d2813 100644 --- a/tests/Unit/File/X509/SPKACTest.php +++ b/tests/Unit/File/X509/SPKACTest.php @@ -5,8 +5,8 @@ * @license http://www.opensource.org/licenses/mit-license.html MIT License */ -use phpseclib\File\X509; -use phpseclib\Crypt\RSA; +use phpseclib3\File\X509; +use phpseclib3\Crypt\RSA; class Unit_File_X509_SPKACTest extends PhpseclibTestCase { diff --git a/tests/Unit/File/X509/X509Test.php b/tests/Unit/File/X509/X509Test.php index f2dba235..5caa7e8f 100644 --- a/tests/Unit/File/X509/X509Test.php +++ b/tests/Unit/File/X509/X509Test.php @@ -5,11 +5,11 @@ * @license http://www.opensource.org/licenses/mit-license.html MIT License */ -use phpseclib\File\ASN1; -use phpseclib\File\ASN1\Element; -use phpseclib\File\X509; -use phpseclib\Crypt\RSA; -use phpseclib\Crypt\PublicKeyLoader; +use phpseclib3\File\ASN1; +use phpseclib3\File\ASN1\Element; +use phpseclib3\File\X509; +use phpseclib3\Crypt\RSA; +use phpseclib3\Crypt\PublicKeyLoader; class Unit_File_X509_X509Test extends PhpseclibTestCase { diff --git a/tests/Unit/Math/BigInteger/BCMathTest.php b/tests/Unit/Math/BigInteger/BCMathTest.php index 4e5edba3..1aab9ebd 100644 --- a/tests/Unit/Math/BigInteger/BCMathTest.php +++ b/tests/Unit/Math/BigInteger/BCMathTest.php @@ -5,7 +5,7 @@ * @license http://www.opensource.org/licenses/mit-license.html MIT License */ -use \phpseclib\Math\BigInteger\Engines\BCMath; +use \phpseclib3\Math\BigInteger\Engines\BCMath; class Unit_Math_BigInteger_BCMathTest extends Unit_Math_BigInteger_TestCase { @@ -24,6 +24,6 @@ class Unit_Math_BigInteger_BCMathTest extends Unit_Math_BigInteger_TestCase public static function getStaticClass() { - return 'phpseclib\Math\BigInteger\Engines\BCMath'; + return 'phpseclib3\Math\BigInteger\Engines\BCMath'; } } diff --git a/tests/Unit/Math/BigInteger/DefaultTest.php b/tests/Unit/Math/BigInteger/DefaultTest.php index 63e2c06f..640d06d4 100644 --- a/tests/Unit/Math/BigInteger/DefaultTest.php +++ b/tests/Unit/Math/BigInteger/DefaultTest.php @@ -5,7 +5,7 @@ * @license http://www.opensource.org/licenses/mit-license.html MIT License */ -use \phpseclib\Math\BigInteger; +use \phpseclib3\Math\BigInteger; class Unit_Math_BigInteger_DefaultTest extends Unit_Math_BigInteger_TestCase { @@ -16,6 +16,6 @@ class Unit_Math_BigInteger_DefaultTest extends Unit_Math_BigInteger_TestCase public static function getStaticClass() { - return 'phpseclib\Math\BigInteger'; + return 'phpseclib3\Math\BigInteger'; } } diff --git a/tests/Unit/Math/BigInteger/GMPTest.php b/tests/Unit/Math/BigInteger/GMPTest.php index f4b902af..bcbecdc3 100644 --- a/tests/Unit/Math/BigInteger/GMPTest.php +++ b/tests/Unit/Math/BigInteger/GMPTest.php @@ -5,7 +5,7 @@ * @license http://www.opensource.org/licenses/mit-license.html MIT License */ -use \phpseclib\Math\BigInteger\Engines\GMP; +use \phpseclib3\Math\BigInteger\Engines\GMP; class Unit_Math_BigInteger_GMPTest extends Unit_Math_BigInteger_TestCase { @@ -24,6 +24,6 @@ class Unit_Math_BigInteger_GMPTest extends Unit_Math_BigInteger_TestCase public static function getStaticClass() { - return 'phpseclib\Math\BigInteger\Engines\GMP'; + return 'phpseclib3\Math\BigInteger\Engines\GMP'; } } diff --git a/tests/Unit/Math/BigInteger/PHP32Test.php b/tests/Unit/Math/BigInteger/PHP32Test.php index ecb29faa..c9b3cfdd 100644 --- a/tests/Unit/Math/BigInteger/PHP32Test.php +++ b/tests/Unit/Math/BigInteger/PHP32Test.php @@ -5,7 +5,7 @@ * @license http://www.opensource.org/licenses/mit-license.html MIT License */ -use \phpseclib\Math\BigInteger\Engines\PHP32; +use \phpseclib3\Math\BigInteger\Engines\PHP32; class Unit_Math_BigInteger_PHP32Test extends Unit_Math_BigInteger_TestCase { @@ -33,6 +33,6 @@ class Unit_Math_BigInteger_PHP32Test extends Unit_Math_BigInteger_TestCase public static function getStaticClass() { - return 'phpseclib\Math\BigInteger\Engines\PHP32'; + return 'phpseclib3\Math\BigInteger\Engines\PHP32'; } } diff --git a/tests/Unit/Math/BigInteger/PHP64OpenSSLTest.php b/tests/Unit/Math/BigInteger/PHP64OpenSSLTest.php index 8c87bd49..c4a28bcf 100644 --- a/tests/Unit/Math/BigInteger/PHP64OpenSSLTest.php +++ b/tests/Unit/Math/BigInteger/PHP64OpenSSLTest.php @@ -5,7 +5,7 @@ * @license http://www.opensource.org/licenses/mit-license.html MIT License */ -use \phpseclib\Math\BigInteger\Engines\PHP64; +use \phpseclib3\Math\BigInteger\Engines\PHP64; class Unit_Math_BigInteger_PHP64OpenSSLTest extends Unit_Math_BigInteger_PHP64Test { diff --git a/tests/Unit/Math/BigInteger/PHP64Test.php b/tests/Unit/Math/BigInteger/PHP64Test.php index 007111db..f1c89093 100644 --- a/tests/Unit/Math/BigInteger/PHP64Test.php +++ b/tests/Unit/Math/BigInteger/PHP64Test.php @@ -5,7 +5,7 @@ * @license http://www.opensource.org/licenses/mit-license.html MIT License */ -use \phpseclib\Math\BigInteger\Engines\PHP64; +use \phpseclib3\Math\BigInteger\Engines\PHP64; class Unit_Math_BigInteger_PHP64Test extends Unit_Math_BigInteger_TestCase { @@ -32,6 +32,6 @@ class Unit_Math_BigInteger_PHP64Test extends Unit_Math_BigInteger_TestCase public static function getStaticClass() { - return 'phpseclib\Math\BigInteger\Engines\PHP64'; + return 'phpseclib3\Math\BigInteger\Engines\PHP64'; } } diff --git a/tests/Unit/Math/BigIntegerTest.php b/tests/Unit/Math/BigIntegerTest.php index faea93f0..ee84d3a0 100644 --- a/tests/Unit/Math/BigIntegerTest.php +++ b/tests/Unit/Math/BigIntegerTest.php @@ -1,10 +1,10 @@ assertSame($ssh, \phpseclib\Net\SSH2::getConnectionByResourceId($ssh->getResourceId())); + $ssh = new \phpseclib3\Net\SSH2('localhost'); + $this->assertSame($ssh, \phpseclib3\Net\SSH2::getConnectionByResourceId($ssh->getResourceId())); } public function testGetResourceId() { - $ssh = new \phpseclib\Net\SSH2('localhost'); + $ssh = new \phpseclib3\Net\SSH2('localhost'); $this->assertSame('{' . spl_object_hash($ssh) . '}', $ssh->getResourceId()); } /** - * @return \phpseclib\Net\SSH2 + * @return \phpseclib3\Net\SSH2 */ protected function createSSHMock() { - return $this->getMockBuilder('phpseclib\Net\SSH2') + return $this->getMockBuilder('phpseclib3\Net\SSH2') ->disableOriginalConstructor() ->setMethods(['__destruct']) ->getMock();