rename phpseclib/phpseclib to phpseclib/phpseclib3 for 3.0 branch

This commit is contained in:
terrafrost 2019-11-06 23:41:40 -06:00
parent 8ad4743364
commit 653dbd7f94
376 changed files with 3000 additions and 3000 deletions

View File

@ -72,7 +72,7 @@
"phpseclib/bootstrap.php"
],
"psr-4": {
"phpseclib\\": "phpseclib/"
"phpseclib3\\": "phpseclib/"
}
}
}

View File

@ -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);

View File

@ -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 @@
* <?php
* include 'vendor/autoload.php';
*
* $aes = new \phpseclib\Crypt\AES();
* $aes = new \phpseclib3\Crypt\AES();
*
* $aes->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

View File

@ -16,7 +16,7 @@
* <?php
* include 'vendor/autoload.php';
*
* $blowfish = new \phpseclib\Crypt\Blowfish();
* $blowfish = new \phpseclib3\Crypt\Blowfish();
*
* $blowfish->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()

View File

@ -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

View File

@ -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)
{

View File

@ -14,7 +14,7 @@
* @link http://phpseclib.sourceforge.net
*/
namespace phpseclib\Crypt\Common;
namespace phpseclib3\Crypt\Common;
/**
* Base Class for all block cipher classes

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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
*/

View File

@ -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

View File

@ -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)

View File

@ -11,7 +11,7 @@
* @link http://phpseclib.sourceforge.net
*/
namespace phpseclib\Crypt\Common;
namespace phpseclib3\Crypt\Common;
/**
* PrivateKey interface

View File

@ -11,7 +11,7 @@
* @link http://phpseclib.sourceforge.net
*/
namespace phpseclib\Crypt\Common;
namespace phpseclib3\Crypt\Common;
/**
* PublicKey interface

View File

@ -14,7 +14,7 @@
* @link http://phpseclib.sourceforge.net
*/
namespace phpseclib\Crypt\Common;
namespace phpseclib3\Crypt\Common;
/**
* Base Class for all stream cipher classes

View File

@ -1,14 +1,14 @@
<?php
/**
* Base Class for all \phpseclib\Crypt\* cipher classes
* Base Class for all \phpseclib3\Crypt\* cipher classes
*
* PHP version 5
*
* Internally for phpseclib developers:
* If you plan to add a new cipher class, please note following rules:
*
* - The new \phpseclib\Crypt\* cipher class should extend \phpseclib\Crypt\Common\SymmetricKey
* - The new \phpseclib3\Crypt\* cipher class should extend \phpseclib3\Crypt\Common\SymmetricKey
*
* - Following methods are then required to be overridden/overloaded:
*
@ -20,7 +20,7 @@
*
* - All other methods are optional to be overridden/overloaded
*
* - Look at the source code of the current ciphers how they extend \phpseclib\Crypt\Common\SymmetricKey
* - Look at the source code of the current ciphers how they extend \phpseclib3\Crypt\Common\SymmetricKey
* and take one of them as a start up for the new cipher class.
*
* - Please read all the other comments/notes/hints here also for each class var/method
@ -34,21 +34,21 @@
* @link http://phpseclib.sourceforge.net
*/
namespace phpseclib\Crypt\Common;
namespace phpseclib3\Crypt\Common;
use phpseclib\Crypt\Hash;
use phpseclib\Common\Functions\Strings;
use phpseclib\Math\BigInteger;
use phpseclib\Math\BinaryField;
use phpseclib\Math\PrimeField;
use phpseclib\Exception\BadDecryptionException;
use phpseclib\Exception\BadModeException;
use phpseclib\Exception\InconsistentSetupException;
use phpseclib\Exception\InsufficientSetupException;
use phpseclib\Exception\UnsupportedAlgorithmException;
use phpseclib3\Crypt\Hash;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Math\BigInteger;
use phpseclib3\Math\BinaryField;
use phpseclib3\Math\PrimeField;
use phpseclib3\Exception\BadDecryptionException;
use phpseclib3\Exception\BadModeException;
use phpseclib3\Exception\InconsistentSetupException;
use phpseclib3\Exception\InsufficientSetupException;
use phpseclib3\Exception\UnsupportedAlgorithmException;
/**
* Base Class for all \phpseclib\Crypt\* cipher classes
* Base Class for all \phpseclib3\Crypt\* cipher classes
*
* @package Base
* @author Jim Wigginton <terrafrost@php.net>
@ -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
* +----------------------------------------------------------------------------------------------+
* </code>
*
* 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 {

View File

@ -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

View File

@ -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

View File

@ -18,7 +18,7 @@
* <?php
* include 'vendor/autoload.php';
*
* $des = new \phpseclib\Crypt\DES();
* $des = new \phpseclib3\Crypt\DES();
*
* $des->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()

View File

@ -10,7 +10,7 @@
* <?php
* include 'vendor/autoload.php';
*
* $ourPrivate = \phpseclib\Crypt\DH::createKey();
* $ourPrivate = \phpseclib3\Crypt\DH::createKey();
* $secret = DH::computeSecret($ourPrivate, $theirPublic);
*
* ?>
@ -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)
{

View File

@ -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

View File

@ -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
*/

View File

@ -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

View File

@ -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;

View File

@ -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()
{

View File

@ -10,7 +10,7 @@
* <?php
* include 'vendor/autoload.php';
*
* $private = \phpseclib\Crypt\DSA::createKey();
* $private = \phpseclib3\Crypt\DSA::createKey();
* $public = $private->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)
{

View File

@ -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

View File

@ -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)

View File

@ -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
*/

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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;

View File

@ -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

View File

@ -10,7 +10,7 @@
* <?php
* include 'vendor/autoload.php';
*
* $private = \phpseclib\Crypt\EC::createKey('secp256k1');
* $private = \phpseclib3\Crypt\EC::createKey('secp256k1');
* $public = $private->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');
}

View File

@ -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()
{

View File

@ -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)
{

View File

@ -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

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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()
{

View File

@ -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
{

View File

@ -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
{

View File

@ -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)
{

View File

@ -1,267 +1,267 @@
<?php
/**
* Ed448
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @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];
}
<?php
/**
* Ed448
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @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];
}
}

View File

@ -1,36 +1,36 @@
<?php
/**
* brainpoolP160r1
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @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));
}
<?php
/**
* brainpoolP160r1
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @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));
}
}

View File

@ -1,49 +1,49 @@
<?php
/**
* brainpoolP160t1
*
* This curve is a twisted version of brainpoolP160r1 with A = -3. With brainpool,
* the curves ending in r1 are the "regular" curves and the curves ending in "t1"
* are the twisted version of the r1 curves. Per https://tools.ietf.org/html/rfc5639#page-7
* you can convert a point on an r1 curve to a point on a t1 curve thusly:
*
* F(x,y) := (x*Z^2, y*Z^3)
*
* The advantage of A = -3 is that some of the point doubling and point addition can be
* slightly optimized. See http://hyperelliptic.org/EFD/g1p/auto-shortw-projective-3.html
* vs http://hyperelliptic.org/EFD/g1p/auto-shortw-projective.html for example.
*
* phpseclib does not currently take advantage of this optimization opportunity
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @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));
}
<?php
/**
* brainpoolP160t1
*
* This curve is a twisted version of brainpoolP160r1 with A = -3. With brainpool,
* the curves ending in r1 are the "regular" curves and the curves ending in "t1"
* are the twisted version of the r1 curves. Per https://tools.ietf.org/html/rfc5639#page-7
* you can convert a point on an r1 curve to a point on a t1 curve thusly:
*
* F(x,y) := (x*Z^2, y*Z^3)
*
* The advantage of A = -3 is that some of the point doubling and point addition can be
* slightly optimized. See http://hyperelliptic.org/EFD/g1p/auto-shortw-projective-3.html
* vs http://hyperelliptic.org/EFD/g1p/auto-shortw-projective.html for example.
*
* phpseclib does not currently take advantage of this optimization opportunity
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @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));
}
}

View File

@ -1,36 +1,36 @@
<?php
/**
* brainpoolP192r1
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @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));
}
<?php
/**
* brainpoolP192r1
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @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));
}
}

View File

@ -1,36 +1,36 @@
<?php
/**
* brainpoolP192t1
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @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));
}
<?php
/**
* brainpoolP192t1
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @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));
}
}

View File

@ -1,36 +1,36 @@
<?php
/**
* brainpoolP224r1
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @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));
}
<?php
/**
* brainpoolP224r1
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @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));
}
}

View File

@ -1,36 +1,36 @@
<?php
/**
* brainpoolP224t1
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @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));
}
<?php
/**
* brainpoolP224t1
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @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));
}
}

View File

@ -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
{

View File

@ -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
{

View File

@ -1,42 +1,42 @@
<?php
/**
* brainpoolP320r1
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @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));
}
<?php
/**
* brainpoolP320r1
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @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));
}
}

View File

@ -1,42 +1,42 @@
<?php
/**
* brainpoolP320t1
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @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));
}
<?php
/**
* brainpoolP320t1
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @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));
}
}

View File

@ -1,48 +1,48 @@
<?php
/**
* brainpoolP384r1
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @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));
}
<?php
/**
* brainpoolP384r1
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @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));
}
}

View File

@ -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
{

View File

@ -1,48 +1,48 @@
<?php
/**
* brainpoolP512r1
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @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));
}
<?php
/**
* brainpoolP512r1
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @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));
}
}

View File

@ -1,48 +1,48 @@
<?php
/**
* brainpoolP512t1
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @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));
}
<?php
/**
* brainpoolP512t1
*
* PHP version 5 and 7
*
* @category Crypt
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @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));
}
}

View File

@ -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
{

View File

@ -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
{

View File

@ -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
{

View File

@ -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
{

View File

@ -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
{

View File

@ -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
{

View File

@ -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
{

View File

@ -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
{

View File

@ -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
{

View File

@ -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
{

View File

@ -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
{

View File

@ -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
{

View File

@ -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
{

View File

@ -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
{

View File

@ -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
{

View File

@ -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
{

View File

@ -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
{

View File

@ -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
{

View File

@ -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
{

View File

@ -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
{

View File

@ -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
{

View File

@ -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
{

View File

@ -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
{

View File

@ -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
{

View File

@ -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
{

View File

@ -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
{

View File

@ -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
{

View File

@ -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
{

View File

@ -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
{

View File

@ -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
{

View File

@ -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

View File

@ -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
{

View File

@ -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
{

View File

@ -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
{

View File

@ -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
{

View File

@ -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
{

Some files were not shown because too many files have changed in this diff Show More