1
0
mirror of https://github.com/danog/phpseclib.git synced 2024-11-30 04:39:21 +01:00

rename ECDSA -> EC

This commit is contained in:
terrafrost 2019-06-27 19:10:40 -05:00
parent 0abce39e39
commit 289ae55f9f
96 changed files with 393 additions and 393 deletions

View File

@ -63,6 +63,6 @@ abstract class ASN1
*/
public static function save(BigInteger $r, BigInteger $s)
{
return ASN1::encodeDER(compact('r', 's'), Maps\DssSigValue::MAP);
return Encoder::encodeDER(compact('r', 's'), Maps\DssSigValue::MAP);
}
}

View File

@ -14,7 +14,7 @@
namespace phpseclib\Crypt\DSA;
use phpseclib\Crypt\DSA;
use phpseclib\Crypt\ECDSA\Formats\Signature\ASN1 as ASN1Signature;
use phpseclib\Crypt\DSA\Formats\Signature\ASN1 as ASN1Signature;
use phpseclib\Math\BigInteger;
use phpseclib\Crypt\Common;

View File

@ -14,7 +14,7 @@
namespace phpseclib\Crypt\DSA;
use phpseclib\Crypt\DSA;
use phpseclib\Crypt\ECDSA\Formats\Signature\ASN1 as ASN1Signature;
use phpseclib\Crypt\DSA\Formats\Signature\ASN1 as ASN1Signature;
use phpseclib\Crypt\Common;
/**

View File

@ -1,7 +1,7 @@
<?php
/**
* Pure-PHP implementation of ECDSA.
* Pure-PHP implementation of EC.
*
* PHP version 5
*
@ -10,7 +10,7 @@
* <?php
* include 'vendor/autoload.php';
*
* $private = \phpseclib\Crypt\ECDSA::createKey('secp256k1');
* $private = \phpseclib\Crypt\EC::createKey('secp256k1');
* $public = $private->getPublicKey();
*
* $plaintext = 'terrafrost';
@ -22,7 +22,7 @@
* </code>
*
* @category Crypt
* @package ECDSA
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2016 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
@ -32,26 +32,26 @@
namespace phpseclib\Crypt;
use phpseclib\Crypt\Common\AsymmetricKey;
use phpseclib\Crypt\ECDSA\PrivateKey;
use phpseclib\Crypt\ECDSA\PublicKey;
use phpseclib\Crypt\ECDSA\Parameters;
use phpseclib\Crypt\ECDSA\BaseCurves\TwistedEdwards as TwistedEdwardsCurve;
use phpseclib\Crypt\ECDSA\Curves\Ed25519;
use phpseclib\Crypt\ECDSA\Curves\Ed448;
use phpseclib\Crypt\ECDSA\Formats\Keys\PKCS1;
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\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\Exception\UnsupportedCurveException;
use phpseclib\Exception\UnsupportedAlgorithmException;
/**
* Pure-PHP implementation of ECDSA.
* Pure-PHP implementation of EC.
*
* @package ECDSA
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
abstract class ECDSA extends AsymmetricKey
abstract class EC extends AsymmetricKey
{
/**
* Algorithm Name
@ -59,7 +59,7 @@ abstract class ECDSA extends AsymmetricKey
* @var string
* @access private
*/
const ALGORITHM = 'ECDSA';
const ALGORITHM = 'EC';
/**
* Public Key QA
@ -71,7 +71,7 @@ abstract class ECDSA extends AsymmetricKey
/**
* Curve
*
* @var \phpseclib\Crypt\ECDSA\BaseCurves\Base
* @var \phpseclib\Crypt\EC\BaseCurves\Base
*/
protected $curve;
@ -131,7 +131,7 @@ abstract class ECDSA extends AsymmetricKey
*
* @access public
* @param string $curve
* @return \phpseclib\Crypt\ECDSA\PrivateKey
* @return \phpseclib\Crypt\EC\PrivateKey
*/
public static function createKey($curve)
{
@ -145,8 +145,8 @@ abstract class ECDSA extends AsymmetricKey
if (self::$engines['libsodium'] && $curve == 'ed25519' && function_exists('sodium_crypto_sign_keypair')) {
$kp = sodium_crypto_sign_keypair();
$privatekey = ECDSA::load(sodium_crypto_sign_secretkey($kp), 'libsodium');
//$publickey = ECDSA::load(sodium_crypto_sign_publickey($kp), 'libsodium');
$privatekey = EC::load(sodium_crypto_sign_secretkey($kp), 'libsodium');
//$publickey = EC::load(sodium_crypto_sign_publickey($kp), 'libsodium');
$privatekey->curveName = 'Ed25519';
//$publickey->curveName = $curve;
@ -157,7 +157,7 @@ abstract class ECDSA extends AsymmetricKey
$privatekey = new PrivateKey;
$curveName = $curve;
$curve = '\phpseclib\Crypt\ECDSA\Curves\\' . $curve;
$curve = '\phpseclib\Crypt\EC\Curves\\' . $curve;
if (!class_exists($curve)) {
throw new UnsupportedCurveException('Named Curve of ' . $curveName . ' is not supported');
}
@ -331,7 +331,7 @@ abstract class ECDSA extends AsymmetricKey
$key = $type::saveParameters($this->curve);
return ECDSA::load($key, 'PKCS1')
return EC::load($key, 'PKCS1')
->withHash($this->hash->getHash())
->withSignatureFormat($this->shortFormat);
}

View File

@ -6,14 +6,14 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\BaseCurves;
namespace phpseclib\Crypt\EC\BaseCurves;
use phpseclib\Math\Common\FiniteField;
use phpseclib\Math\BigInteger;

View File

@ -14,14 +14,14 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\BaseCurves;
namespace phpseclib\Crypt\EC\BaseCurves;
use phpseclib\Common\Functions\Strings;
use phpseclib\Math\BinaryField;

View File

@ -21,14 +21,14 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\BaseCurves;
namespace phpseclib\Crypt\EC\BaseCurves;
use phpseclib\Common\Functions\Strings;
use phpseclib\Math\PrimeField;

View File

@ -14,14 +14,14 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\BaseCurves;
namespace phpseclib\Crypt\EC\BaseCurves;
use phpseclib\Math\Common\FiniteField\Integer;
use phpseclib\Common\Functions\Strings;

View File

@ -19,14 +19,14 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\BaseCurves;
namespace phpseclib\Crypt\EC\BaseCurves;
use phpseclib\Math\PrimeField;
use phpseclib\Math\BigInteger;

View File

@ -6,15 +6,15 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
use phpseclib\Crypt\ECDSA\BaseCurves\TwistedEdwards;
use phpseclib\Crypt\EC\BaseCurves\TwistedEdwards;
use phpseclib\Math\BigInteger;
use phpseclib\Crypt\Hash;
use phpseclib\Crypt\Random;
@ -100,7 +100,7 @@ class Ed25519 extends TwistedEdwards
*
* Implements steps 2-4 at https://tools.ietf.org/html/rfc8032#section-5.1.3
*
* Used by ECDSA\Keys\Common.php
* Used by EC\Keys\Common.php
*
* @param BigInteger $x
* @param boolean $sign

View File

@ -6,15 +6,15 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
use phpseclib\Crypt\ECDSA\BaseCurves\TwistedEdwards;
use phpseclib\Crypt\EC\BaseCurves\TwistedEdwards;
use phpseclib\Math\BigInteger;
use phpseclib\Crypt\Hash;
use phpseclib\Crypt\Random;
@ -52,7 +52,7 @@ class Ed448 extends TwistedEdwards
*
* Implements steps 2-4 at https://tools.ietf.org/html/rfc8032#section-5.2.3
*
* Used by ECDSA\Keys\Common.php
* Used by EC\Keys\Common.php
*
* @param BigInteger $x
* @param boolean $sign

View File

@ -6,16 +6,16 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
use phpseclib\Crypt\ECDSA\BaseCurves\Prime;
use phpseclib\Crypt\EC\BaseCurves\Prime;
use phpseclib\Math\BigInteger;
class brainpoolP160r1 extends Prime

View File

@ -19,16 +19,16 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
use phpseclib\Crypt\ECDSA\BaseCurves\Prime;
use phpseclib\Crypt\EC\BaseCurves\Prime;
use phpseclib\Math\BigInteger;
class brainpoolP160t1 extends Prime

View File

@ -6,16 +6,16 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
use phpseclib\Crypt\ECDSA\BaseCurves\Prime;
use phpseclib\Crypt\EC\BaseCurves\Prime;
use phpseclib\Math\BigInteger;
class brainpoolP192r1 extends Prime

View File

@ -6,16 +6,16 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
use phpseclib\Crypt\ECDSA\BaseCurves\Prime;
use phpseclib\Crypt\EC\BaseCurves\Prime;
use phpseclib\Math\BigInteger;
class brainpoolP192t1 extends Prime

View File

@ -6,16 +6,16 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
use phpseclib\Crypt\ECDSA\BaseCurves\Prime;
use phpseclib\Crypt\EC\BaseCurves\Prime;
use phpseclib\Math\BigInteger;
class brainpoolP224r1 extends Prime

View File

@ -6,16 +6,16 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
use phpseclib\Crypt\ECDSA\BaseCurves\Prime;
use phpseclib\Crypt\EC\BaseCurves\Prime;
use phpseclib\Math\BigInteger;
class brainpoolP224t1 extends Prime

View File

@ -6,16 +6,16 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
use phpseclib\Crypt\ECDSA\BaseCurves\Prime;
use phpseclib\Crypt\EC\BaseCurves\Prime;
use phpseclib\Math\BigInteger;
class brainpoolP256r1 extends Prime

View File

@ -6,16 +6,16 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
use phpseclib\Crypt\ECDSA\BaseCurves\Prime;
use phpseclib\Crypt\EC\BaseCurves\Prime;
use phpseclib\Math\BigInteger;
class brainpoolP256t1 extends Prime

View File

@ -6,16 +6,16 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
use phpseclib\Crypt\ECDSA\BaseCurves\Prime;
use phpseclib\Crypt\EC\BaseCurves\Prime;
use phpseclib\Math\BigInteger;
class brainpoolP320r1 extends Prime

View File

@ -6,16 +6,16 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
use phpseclib\Crypt\ECDSA\BaseCurves\Prime;
use phpseclib\Crypt\EC\BaseCurves\Prime;
use phpseclib\Math\BigInteger;
class brainpoolP320t1 extends Prime

View File

@ -6,16 +6,16 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
use phpseclib\Crypt\ECDSA\BaseCurves\Prime;
use phpseclib\Crypt\EC\BaseCurves\Prime;
use phpseclib\Math\BigInteger;
class brainpoolP384r1 extends Prime

View File

@ -6,16 +6,16 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
use phpseclib\Crypt\ECDSA\BaseCurves\Prime;
use phpseclib\Crypt\EC\BaseCurves\Prime;
use phpseclib\Math\BigInteger;
class brainpoolP384t1 extends Prime

View File

@ -6,16 +6,16 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
use phpseclib\Crypt\ECDSA\BaseCurves\Prime;
use phpseclib\Crypt\EC\BaseCurves\Prime;
use phpseclib\Math\BigInteger;
class brainpoolP512r1 extends Prime

View File

@ -6,16 +6,16 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
use phpseclib\Crypt\ECDSA\BaseCurves\Prime;
use phpseclib\Crypt\EC\BaseCurves\Prime;
use phpseclib\Math\BigInteger;
class brainpoolP512t1 extends Prime

View File

@ -6,14 +6,14 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
final class nistb233 extends sect233r1
{

View File

@ -6,14 +6,14 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
final class nistb409 extends sect409r1
{

View File

@ -6,14 +6,14 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
final class nistk163 extends sect163k1
{

View File

@ -6,14 +6,14 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
final class nistk233 extends sect233k1
{

View File

@ -6,14 +6,14 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
final class nistk283 extends sect283k1
{

View File

@ -6,14 +6,14 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
final class nistk409 extends sect409k1
{

View File

@ -6,14 +6,14 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
final class nistp192 extends secp192r1
{

View File

@ -6,14 +6,14 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
final class nistp224 extends secp224r1
{

View File

@ -6,14 +6,14 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
final class nistp256 extends secp256r1
{

View File

@ -6,14 +6,14 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
final class nistp384 extends secp384r1
{

View File

@ -6,14 +6,14 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
final class nistp521 extends secp521r1
{

View File

@ -6,14 +6,14 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
final class nistt571 extends sect571k1
{

View File

@ -6,14 +6,14 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
final class prime192v1 extends secp192r1
{

View File

@ -6,16 +6,16 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
use phpseclib\Crypt\ECDSA\BaseCurves\Prime;
use phpseclib\Crypt\EC\BaseCurves\Prime;
use phpseclib\Math\BigInteger;
class prime192v2 extends Prime

View File

@ -6,16 +6,16 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
use phpseclib\Crypt\ECDSA\BaseCurves\Prime;
use phpseclib\Crypt\EC\BaseCurves\Prime;
use phpseclib\Math\BigInteger;
class prime192v3 extends Prime

View File

@ -6,16 +6,16 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
use phpseclib\Crypt\ECDSA\BaseCurves\Prime;
use phpseclib\Crypt\EC\BaseCurves\Prime;
use phpseclib\Math\BigInteger;
class prime239v1 extends Prime

View File

@ -6,16 +6,16 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
use phpseclib\Crypt\ECDSA\BaseCurves\Prime;
use phpseclib\Crypt\EC\BaseCurves\Prime;
use phpseclib\Math\BigInteger;
class prime239v2 extends Prime

View File

@ -6,16 +6,16 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
use phpseclib\Crypt\ECDSA\BaseCurves\Prime;
use phpseclib\Crypt\EC\BaseCurves\Prime;
use phpseclib\Math\BigInteger;
class prime239v3 extends Prime

View File

@ -6,14 +6,14 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
final class prime256v1 extends secp256r1
{

View File

@ -6,16 +6,16 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
use phpseclib\Crypt\ECDSA\BaseCurves\Prime;
use phpseclib\Crypt\EC\BaseCurves\Prime;
use phpseclib\Math\BigInteger;
class secp112r1 extends Prime

View File

@ -6,16 +6,16 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
use phpseclib\Crypt\ECDSA\BaseCurves\Prime;
use phpseclib\Crypt\EC\BaseCurves\Prime;
use phpseclib\Math\BigInteger;
class secp112r2 extends Prime

View File

@ -6,16 +6,16 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
use phpseclib\Crypt\ECDSA\BaseCurves\Prime;
use phpseclib\Crypt\EC\BaseCurves\Prime;
use phpseclib\Math\BigInteger;
class secp128r1 extends Prime

View File

@ -6,16 +6,16 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
use phpseclib\Crypt\ECDSA\BaseCurves\Prime;
use phpseclib\Crypt\EC\BaseCurves\Prime;
use phpseclib\Math\BigInteger;
class secp128r2 extends Prime

View File

@ -6,16 +6,16 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
use phpseclib\Crypt\ECDSA\BaseCurves\KoblitzPrime;
use phpseclib\Crypt\EC\BaseCurves\KoblitzPrime;
use phpseclib\Math\BigInteger;
class secp160k1 extends KoblitzPrime

View File

@ -6,16 +6,16 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
use phpseclib\Crypt\ECDSA\BaseCurves\Prime;
use phpseclib\Crypt\EC\BaseCurves\Prime;
use phpseclib\Math\BigInteger;
class secp160r1 extends Prime

View File

@ -6,16 +6,16 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
use phpseclib\Crypt\ECDSA\BaseCurves\Prime;
use phpseclib\Crypt\EC\BaseCurves\Prime;
use phpseclib\Math\BigInteger;
class secp160r2 extends Prime

View File

@ -6,16 +6,16 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
use phpseclib\Crypt\ECDSA\BaseCurves\KoblitzPrime;
use phpseclib\Crypt\EC\BaseCurves\KoblitzPrime;
use phpseclib\Math\BigInteger;
class secp192k1 extends KoblitzPrime

View File

@ -8,16 +8,16 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
use phpseclib\Crypt\ECDSA\BaseCurves\Prime;
use phpseclib\Crypt\EC\BaseCurves\Prime;
use phpseclib\Math\BigInteger;
class secp192r1 extends Prime

View File

@ -6,16 +6,16 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
use phpseclib\Crypt\ECDSA\BaseCurves\KoblitzPrime;
use phpseclib\Crypt\EC\BaseCurves\KoblitzPrime;
use phpseclib\Math\BigInteger;
class secp224k1 extends KoblitzPrime

View File

@ -6,16 +6,16 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
use phpseclib\Crypt\ECDSA\BaseCurves\Prime;
use phpseclib\Crypt\EC\BaseCurves\Prime;
use phpseclib\Math\BigInteger;
class secp224r1 extends Prime

View File

@ -8,17 +8,17 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
//use phpseclib\Crypt\ECDSA\BaseCurves\Prime;
use phpseclib\Crypt\ECDSA\BaseCurves\KoblitzPrime;
//use phpseclib\Crypt\EC\BaseCurves\Prime;
use phpseclib\Crypt\EC\BaseCurves\KoblitzPrime;
use phpseclib\Math\BigInteger;
//class secp256k1 extends Prime

View File

@ -6,16 +6,16 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
use phpseclib\Crypt\ECDSA\BaseCurves\Prime;
use phpseclib\Crypt\EC\BaseCurves\Prime;
use phpseclib\Math\BigInteger;
class secp256r1 extends Prime

View File

@ -6,16 +6,16 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
use phpseclib\Crypt\ECDSA\BaseCurves\Prime;
use phpseclib\Crypt\EC\BaseCurves\Prime;
use phpseclib\Math\BigInteger;
class secp384r1 extends Prime

View File

@ -6,16 +6,16 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
use phpseclib\Crypt\ECDSA\BaseCurves\Prime;
use phpseclib\Crypt\EC\BaseCurves\Prime;
use phpseclib\Math\BigInteger;
class secp521r1 extends Prime

View File

@ -6,16 +6,16 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
use phpseclib\Crypt\ECDSA\BaseCurves\Binary;
use phpseclib\Crypt\EC\BaseCurves\Binary;
use phpseclib\Math\BigInteger;
class sect113r1 extends Binary

View File

@ -6,16 +6,16 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
use phpseclib\Crypt\ECDSA\BaseCurves\Binary;
use phpseclib\Crypt\EC\BaseCurves\Binary;
use phpseclib\Math\BigInteger;
class sect113r2 extends Binary

View File

@ -6,16 +6,16 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
use phpseclib\Crypt\ECDSA\BaseCurves\Binary;
use phpseclib\Crypt\EC\BaseCurves\Binary;
use phpseclib\Math\BigInteger;
class sect131r1 extends Binary

View File

@ -6,16 +6,16 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
use phpseclib\Crypt\ECDSA\BaseCurves\Binary;
use phpseclib\Crypt\EC\BaseCurves\Binary;
use phpseclib\Math\BigInteger;
class sect131r2 extends Binary

View File

@ -6,16 +6,16 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
use phpseclib\Crypt\ECDSA\BaseCurves\Binary;
use phpseclib\Crypt\EC\BaseCurves\Binary;
use phpseclib\Math\BigInteger;
class sect163k1 extends Binary

View File

@ -6,16 +6,16 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
use phpseclib\Crypt\ECDSA\BaseCurves\Binary;
use phpseclib\Crypt\EC\BaseCurves\Binary;
use phpseclib\Math\BigInteger;
class sect163r1 extends Binary

View File

@ -6,16 +6,16 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
use phpseclib\Crypt\ECDSA\BaseCurves\Binary;
use phpseclib\Crypt\EC\BaseCurves\Binary;
use phpseclib\Math\BigInteger;
class sect163r2 extends Binary

View File

@ -6,16 +6,16 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
use phpseclib\Crypt\ECDSA\BaseCurves\Binary;
use phpseclib\Crypt\EC\BaseCurves\Binary;
use phpseclib\Math\BigInteger;
class sect193r1 extends Binary

View File

@ -6,16 +6,16 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
use phpseclib\Crypt\ECDSA\BaseCurves\Binary;
use phpseclib\Crypt\EC\BaseCurves\Binary;
use phpseclib\Math\BigInteger;
class sect193r2 extends Binary

View File

@ -6,16 +6,16 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
use phpseclib\Crypt\ECDSA\BaseCurves\Binary;
use phpseclib\Crypt\EC\BaseCurves\Binary;
use phpseclib\Math\BigInteger;
class sect233k1 extends Binary

View File

@ -6,16 +6,16 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
use phpseclib\Crypt\ECDSA\BaseCurves\Binary;
use phpseclib\Crypt\EC\BaseCurves\Binary;
use phpseclib\Math\BigInteger;
class sect233r1 extends Binary

View File

@ -6,16 +6,16 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @package EC
* @author Jim Wiggint on <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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
use phpseclib\Crypt\ECDSA\BaseCurves\Binary;
use phpseclib\Crypt\EC\BaseCurves\Binary;
use phpseclib\Math\BigInteger;
class sect239k1 extends Binary

View File

@ -6,16 +6,16 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @package EC
* @author Jim Wiggint on <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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
use phpseclib\Crypt\ECDSA\BaseCurves\Binary;
use phpseclib\Crypt\EC\BaseCurves\Binary;
use phpseclib\Math\BigInteger;
class sect283k1 extends Binary

View File

@ -6,16 +6,16 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @package EC
* @author Jim Wiggint on <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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
use phpseclib\Crypt\ECDSA\BaseCurves\Binary;
use phpseclib\Crypt\EC\BaseCurves\Binary;
use phpseclib\Math\BigInteger;
class sect283r1 extends Binary

View File

@ -6,16 +6,16 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @package EC
* @author Jim Wiggint on <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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
use phpseclib\Crypt\ECDSA\BaseCurves\Binary;
use phpseclib\Crypt\EC\BaseCurves\Binary;
use phpseclib\Math\BigInteger;
class sect409k1 extends Binary

View File

@ -6,16 +6,16 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @package EC
* @author Jim Wiggint on <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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
use phpseclib\Crypt\ECDSA\BaseCurves\Binary;
use phpseclib\Crypt\EC\BaseCurves\Binary;
use phpseclib\Math\BigInteger;
class sect409r1 extends Binary

View File

@ -6,16 +6,16 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @package EC
* @author Jim Wiggint on <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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
use phpseclib\Crypt\ECDSA\BaseCurves\Binary;
use phpseclib\Crypt\EC\BaseCurves\Binary;
use phpseclib\Math\BigInteger;
class sect571k1 extends Binary

View File

@ -6,16 +6,16 @@
* PHP version 5 and 7
*
* @category Crypt
* @package ECDSA
* @package EC
* @author Jim Wiggint on <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\ECDSA\Curves;
namespace phpseclib\Crypt\EC\Curves;
use phpseclib\Crypt\ECDSA\BaseCurves\Binary;
use phpseclib\Crypt\EC\BaseCurves\Binary;
use phpseclib\Math\BigInteger;
class sect571r1 extends Binary

View File

@ -1,25 +1,25 @@
<?php
/**
* Generic ECDSA Key Parsing Helper functions
* Generic EC Key Parsing Helper functions
*
* PHP version 5
*
* @category Crypt
* @package ECDSA
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
namespace phpseclib\Crypt\ECDSA\Formats\Keys;
namespace phpseclib\Crypt\EC\Formats\Keys;
use ParagonIE\ConstantTime\Hex;
use phpseclib\Crypt\ECDSA\BaseCurves\Base as BaseCurve;
use phpseclib\Crypt\ECDSA\BaseCurves\Prime as PrimeCurve;
use phpseclib\Crypt\ECDSA\BaseCurves\Binary as BinaryCurve;
use phpseclib\Crypt\ECDSA\BaseCurves\TwistedEdwards as TwistedEdwardsCurve;
use phpseclib\Crypt\EC\BaseCurves\Base as BaseCurve;
use phpseclib\Crypt\EC\BaseCurves\Prime as PrimeCurve;
use phpseclib\Crypt\EC\BaseCurves\Binary as BinaryCurve;
use phpseclib\Crypt\EC\BaseCurves\TwistedEdwards as TwistedEdwardsCurve;
use phpseclib\Common\Functions\Strings;
use phpseclib\Math\BigInteger;
use phpseclib\Math\PrimeField;
@ -28,9 +28,9 @@ use phpseclib\File\ASN1\Maps;
use phpseclib\Exception\UnsupportedCurveException;
/**
* Generic ECDSA Key Parsing Helper functions
* Generic EC Key Parsing Helper functions
*
* @package ECDSA
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
@ -189,7 +189,7 @@ trait Common
* If the key contains an implicit curve phpseclib needs the curve
* to be explicitly provided
*
* @param \phpseclib\Crypt\ECDSA\BaseCurves\Base $curve
* @param \phpseclib\Crypt\EC\BaseCurves\Base $curve
*/
public static function setImplicitCurve(BaseCurve $curve)
{
@ -197,11 +197,11 @@ trait Common
}
/**
* Returns an instance of \phpseclib\Crypt\ECDSA\BaseCurves\Base based
* Returns an instance of \phpseclib\Crypt\EC\BaseCurves\Base based
* on the curve parameters
*
* @param array $params
* @return \phpseclib\Crypt\ECDSA\BaseCurves\Base|false
* @return \phpseclib\Crypt\EC\BaseCurves\Base|false
*/
protected static function loadCurveByParam(array $params)
{
@ -209,7 +209,7 @@ trait Common
throw new \RuntimeException('No parameters are present');
}
if (isset($params['namedCurve'])) {
$curve = '\phpseclib\Crypt\ECDSA\Curves\\' . $params['namedCurve'];
$curve = '\phpseclib\Crypt\EC\Curves\\' . $params['namedCurve'];
if (!class_exists($curve)) {
throw new UnsupportedCurveException('Named Curve of ' . $params['namedCurve'] . ' is not supported');
}
@ -275,7 +275,7 @@ trait Common
* Supports both compressed and uncompressed points
*
* @param string $str
* @param \phpseclib\Crypt\ECDSA\BaseCurves\Base $curve
* @param \phpseclib\Crypt\EC\BaseCurves\Base $curve
* @return object[]
*/
public static function extractPoint($str, BaseCurve $curve)
@ -341,7 +341,7 @@ trait Common
* Encode Parameters
*
* @todo Maybe at some point this could be moved to __toString() for each of the curves?
* @param \phpseclib\Crypt\ECDSA\BaseCurves\Base $curve
* @param \phpseclib\Crypt\EC\BaseCurves\Base $curve
* @param bool $returnArray optional
* @param array $options optional
* @return string|false
@ -367,7 +367,7 @@ trait Common
continue;
}
$testName = $file->getBasename('.php');
$class = 'phpseclib\Crypt\ECDSA\Curves\\' . $testName;
$class = 'phpseclib\Crypt\EC\Curves\\' . $testName;
$reflect = new \ReflectionClass($class);
if ($reflect->isFinal()) {
continue;
@ -544,7 +544,7 @@ trait Common
/**
* Use Named Curve
*
* A named curve does not include any parameters. It is up to the ECDSA parameters to
* A named curve does not include any parameters. It is up to the EC parameters to
* know what the coefficients, the base points, etc, are from the name of the curve.
* A named curve is a more concise way of representing a curve
*/

View File

@ -1,35 +1,35 @@
<?php
/**
* OpenSSH Formatted ECDSA Key Handler
* OpenSSH Formatted EC Key Handler
*
* PHP version 5
*
* Place in $HOME/.ssh/authorized_keys
*
* @category Crypt
* @package ECDSA
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
namespace phpseclib\Crypt\ECDSA\Formats\Keys;
namespace phpseclib\Crypt\EC\Formats\Keys;
use ParagonIE\ConstantTime\Base64;
use phpseclib\Math\BigInteger;
use phpseclib\Common\Functions\Strings;
use phpseclib\Crypt\Common\Formats\Keys\OpenSSH as Progenitor;
use phpseclib\Crypt\ECDSA\BaseCurves\Base as BaseCurve;
use phpseclib\Crypt\EC\BaseCurves\Base as BaseCurve;
use phpseclib\Exception\UnsupportedCurveException;
use phpseclib\Crypt\ECDSA\Curves\Ed25519;
use phpseclib\Crypt\EC\Curves\Ed25519;
use phpseclib\Math\Common\FiniteField\Integer;
/**
* OpenSSH Formatted ECDSA Key Handler
* OpenSSH Formatted EC Key Handler
*
* @package ECDSA
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
@ -92,7 +92,7 @@ abstract class OpenSSH extends Progenitor
$qa = self::extractPoint($parsed['publicKey'], $curve);
} else {
list($curveName, $publicKey) = Strings::unpackSSH2('ss', $parsed['publicKey']);
$curveName = '\phpseclib\Crypt\ECDSA\Curves\\' . $curveName;
$curveName = '\phpseclib\Crypt\EC\Curves\\' . $curveName;
$curve = new $curveName();
$qa = self::extractPoint("\0" . $publicKey, $curve);
@ -138,10 +138,10 @@ abstract class OpenSSH extends Progenitor
}
/**
* Convert an ECDSA public key to the appropriate format
* Convert an EC public key to the appropriate format
*
* @access public
* @param \phpseclib\Crypt\ECDSA\BaseCurves\Base $curve
* @param \phpseclib\Crypt\EC\BaseCurves\Base $curve
* @param \phpseclib\Math\Common\FiniteField\Integer[] $publicKey
* @param array $options optional
* @return string
@ -180,7 +180,7 @@ abstract class OpenSSH extends Progenitor
*
* @access public
* @param \phpseclib\Math\Common\FiniteField\Integer $privateKey
* @param \phpseclib\Crypt\ECDSA\Curves\Ed25519 $curve
* @param \phpseclib\Crypt\EC\Curves\Ed25519 $curve
* @param \phpseclib\Math\Common\FiniteField\Integer[] $publicKey
* @param string $password optional
* @param array $options optional

View File

@ -1,7 +1,7 @@
<?php
/**
* "PKCS1" (RFC5915) Formatted ECDSA Key Handler
* "PKCS1" (RFC5915) Formatted EC Key Handler
*
* PHP version 5
*
@ -18,29 +18,29 @@
* all. I suppose this could also be named IETF but idk
*
* @category Crypt
* @package ECDSA
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
namespace phpseclib\Crypt\ECDSA\Formats\Keys;
namespace phpseclib\Crypt\EC\Formats\Keys;
use phpseclib\Math\Common\FiniteField\Integer;
use phpseclib\Crypt\Common\Formats\Keys\PKCS1 as Progenitor;
use phpseclib\File\ASN1;
use phpseclib\File\ASN1\Maps;
use phpseclib\Crypt\ECDSA\BaseCurves\Base as BaseCurve;
use phpseclib\Crypt\EC\BaseCurves\Base as BaseCurve;
use phpseclib\Math\BigInteger;
use ParagonIE\ConstantTime\Base64;
use phpseclib\Crypt\ECDSA\BaseCurves\TwistedEdwards as TwistedEdwardsCurve;
use phpseclib\Crypt\EC\BaseCurves\TwistedEdwards as TwistedEdwardsCurve;
use phpseclib\Exception\UnsupportedCurveException;
/**
* "PKCS1" (RFC5915) Formatted ECDSA Key Handler
* "PKCS1" (RFC5915) Formatted EC Key Handler
*
* @package ECDSA
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
@ -87,7 +87,7 @@ abstract class PKCS1 extends Progenitor
}
/**
* Convert ECDSA parameters to the appropriate format
* Convert EC parameters to the appropriate format
*
* @access public
* @return string
@ -112,7 +112,7 @@ abstract class PKCS1 extends Progenitor
*
* @access public
* @param \phpseclib\Math\Common\FiniteField\Integer $privateKey
* @param \phpseclib\Crypt\ECDSA\BaseCurves\Base $curve
* @param \phpseclib\Crypt\EC\BaseCurves\Base $curve
* @param \phpseclib\Math\Common\FiniteField\Integer[] $publicKey
* @param string $password optional
* @param array $options optional

View File

@ -1,7 +1,7 @@
<?php
/**
* PKCS#8 Formatted ECDSA Key Handler
* PKCS#8 Formatted EC Key Handler
*
* PHP version 5
*
@ -16,29 +16,29 @@
* for keys. This just extends that same concept to public keys (much like ssh-keygen)
*
* @category Crypt
* @package ECDSA
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
namespace phpseclib\Crypt\ECDSA\Formats\Keys;
namespace phpseclib\Crypt\EC\Formats\Keys;
use phpseclib\Math\BigInteger;
use phpseclib\Crypt\Common\Formats\Keys\PKCS8 as Progenitor;
use phpseclib\File\ASN1;
use phpseclib\File\ASN1\Maps;
use phpseclib\Crypt\ECDSA\BaseCurves\Base as BaseCurve;
use phpseclib\Crypt\ECDSA\BaseCurves\TwistedEdwards as TwistedEdwardsCurve;
use phpseclib\Crypt\EC\BaseCurves\Base as BaseCurve;
use phpseclib\Crypt\EC\BaseCurves\TwistedEdwards as TwistedEdwardsCurve;
use phpseclib\Math\Common\FiniteField\Integer;
use phpseclib\Crypt\ECDSA\Curves\Ed25519;
use phpseclib\Crypt\ECDSA\Curves\Ed448;
use phpseclib\Crypt\EC\Curves\Ed25519;
use phpseclib\Crypt\EC\Curves\Ed448;
/**
* PKCS#8 Formatted ECDSA Key Handler
* PKCS#8 Formatted EC Key Handler
*
* @package ECDSA
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
@ -164,10 +164,10 @@ abstract class PKCS8 extends Progenitor
}
/**
* Convert an ECDSA public key to the appropriate format
* Convert an EC public key to the appropriate format
*
* @access public
* @param \phpseclib\Crypt\ECDSA\BaseCurves\Base $curve
* @param \phpseclib\Crypt\EC\BaseCurves\Base $curve
* @param \phpseclib\Math\Common\FiniteField\Integer[] $publicKey
* @param array $optiona optional
* @return string
@ -196,7 +196,7 @@ abstract class PKCS8 extends Progenitor
*
* @access public
* @param \phpseclib\Math\Common\FiniteField\Integer $privateKey
* @param \phpseclib\Crypt\ECDSA\BaseCurves\Base $curve
* @param \phpseclib\Crypt\EC\BaseCurves\Base $curve
* @param \phpseclib\Math\Common\FiniteField\Integer[] $publicKey
* @param string $password optional
* @param array $options optional

View File

@ -1,32 +1,32 @@
<?php
/**
* PuTTY Formatted ECDSA Key Handler
* PuTTY Formatted EC Key Handler
*
* PHP version 5
*
* @category Crypt
* @package ECDSA
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
namespace phpseclib\Crypt\ECDSA\Formats\Keys;
namespace phpseclib\Crypt\EC\Formats\Keys;
use ParagonIE\ConstantTime\Base64;
use phpseclib\Math\BigInteger;
use phpseclib\Common\Functions\Strings;
use phpseclib\Crypt\Common\Formats\Keys\PuTTY as Progenitor;
use phpseclib\Crypt\ECDSA\BaseCurves\Base as BaseCurve;
use phpseclib\Crypt\EC\BaseCurves\Base as BaseCurve;
use phpseclib\Math\Common\FiniteField\Integer;
use phpseclib\Crypt\ECDSA\BaseCurves\TwistedEdwards as TwistedEdwardsCurve;
use phpseclib\Crypt\EC\BaseCurves\TwistedEdwards as TwistedEdwardsCurve;
/**
* PuTTY Formatted ECDSA Key Handler
* PuTTY Formatted EC Key Handler
*
* @package ECDSA
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
@ -40,7 +40,7 @@ abstract class PuTTY extends Progenitor
* @var string
* @access private
*/
const PUBLIC_HANDLER = 'phpseclib\Crypt\ECDSA\Formats\Keys\OpenSSH';
const PUBLIC_HANDLER = 'phpseclib\Crypt\EC\Formats\Keys\OpenSSH';
/**
* Supported Key Types
@ -93,7 +93,7 @@ abstract class PuTTY extends Progenitor
*
* @access public
* @param \phpseclib\Math\Common\FiniteField\Integer $privateKey
* @param \phpseclib\Crypt\ECDSA\BaseCurves\Base $curve
* @param \phpseclib\Crypt\EC\BaseCurves\Base $curve
* @param \phpseclib\Math\Common\FiniteField\Integer[] $publicKey
* @param string $password optional
* @param array $options optional
@ -126,10 +126,10 @@ abstract class PuTTY extends Progenitor
}
/**
* Convert an ECDSA public key to the appropriate format
* Convert an EC public key to the appropriate format
*
* @access public
* @param \phpseclib\Crypt\ECDSA\BaseCurves\Base $curve
* @param \phpseclib\Crypt\EC\BaseCurves\Base $curve
* @param \phpseclib\Math\Common\FiniteField[] $publicKey
* @return string
*/

View File

@ -1,7 +1,7 @@
<?php
/**
* XML Formatted ECDSA Key Handler
* XML Formatted EC Key Handler
*
* More info:
*
@ -11,26 +11,26 @@
* PHP version 5
*
* @category Crypt
* @package ECDSA
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
namespace phpseclib\Crypt\ECDSA\Formats\Keys;
namespace phpseclib\Crypt\EC\Formats\Keys;
use ParagonIE\ConstantTime\Base64;
use phpseclib\Math\BigInteger;
use phpseclib\Crypt\ECDSA\BaseCurves\Base as BaseCurve;
use phpseclib\Crypt\ECDSA\BaseCurves\Prime as PrimeCurve;
use phpseclib\Crypt\ECDSA\BaseCurves\TwistedEdwards as TwistedEdwardsCurve;
use phpseclib\Crypt\EC\BaseCurves\Base as BaseCurve;
use phpseclib\Crypt\EC\BaseCurves\Prime as PrimeCurve;
use phpseclib\Crypt\EC\BaseCurves\TwistedEdwards as TwistedEdwardsCurve;
use phpseclib\Exception\UnsupportedCurveException;
/**
* XML Formatted ECDSA Key Handler
* XML Formatted EC Key Handler
*
* @package ECDSA
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
@ -168,7 +168,7 @@ abstract class XML
* Extract points from an XML document
*
* @param \DOMXPath $xpath
* @param \phpseclib\Crypt\ECDSA\BaseCurves\Base $curve
* @param \phpseclib\Crypt\EC\BaseCurves\Base $curve
* @return object[]
*/
private static function extractPointRFC4050(\DOMXPath $xpath, BaseCurve $curve)
@ -192,11 +192,11 @@ abstract class XML
}
/**
* Returns an instance of \phpseclib\Crypt\ECDSA\BaseCurves\Base based
* Returns an instance of \phpseclib\Crypt\EC\BaseCurves\Base based
* on the curve parameters
*
* @param \DomXPath $xpath
* @return \phpseclib\Crypt\ECDSA\BaseCurves\Base|false
* @return \phpseclib\Crypt\EC\BaseCurves\Base|false
*/
private static function loadCurveByParam(\DOMXPath $xpath)
{
@ -209,7 +209,7 @@ abstract class XML
throw new UnsupportedCurveException('Curve with OID of ' . $oid . ' is not supported');
}
$curve = '\phpseclib\Crypt\ECDSA\Curves\\' . $name;
$curve = '\phpseclib\Crypt\EC\Curves\\' . $name;
if (!class_exists($curve)) {
throw new UnsupportedCurveException('Named Curve of ' . $name . ' is not supported');
}
@ -272,11 +272,11 @@ abstract class XML
}
/**
* Returns an instance of \phpseclib\Crypt\ECDSA\BaseCurves\Base based
* Returns an instance of \phpseclib\Crypt\EC\BaseCurves\Base based
* on the curve parameters
*
* @param \DomXPath $xpath
* @return \phpseclib\Crypt\ECDSA\BaseCurves\Base|false
* @return \phpseclib\Crypt\EC\BaseCurves\Base|false
*/
private static function loadCurveByParamRFC4050(\DOMXPath $xpath)
{
@ -363,7 +363,7 @@ abstract class XML
/**
* Convert a public key to the appropriate format
*
* @param \phpseclib\Crypt\ECDSA\BaseCurves\Base $curve
* @param \phpseclib\Crypt\EC\BaseCurves\Base $curve
* @param \phpseclib\Math\Common\FiniteField\Integer[] $publicKey
* @param array $options optional
* @return string
@ -395,16 +395,16 @@ abstract class XML
$publicKey = "\4" . $publicKey[0]->toBytes() . $publicKey[1]->toBytes();
return '<' . $pre . 'ECKeyValue xmlns' . $post . '="http://www.w3.org/2009/xmldsig11#">' . "\r\n" .
return '<' . $pre . 'ECDSAKeyValue xmlns' . $post . '="http://www.w3.org/2009/xmldsig11#">' . "\r\n" .
self::encodeXMLParameters($curve, $pre, $options) . "\r\n" .
'<' . $pre . 'PublicKey>' . Base64::encode($publicKey) . '</' . $pre . 'PublicKey>' . "\r\n" .
'</' . $pre . 'ECKeyValue>';
'</' . $pre . 'ECDSAKeyValue>';
}
/**
* Encode Parameters
*
* @param \phpseclib\Crypt\ECDSA\BaseCurves\Base $curve
* @param \phpseclib\Crypt\EC\BaseCurves\Base $curve
* @param string $pre
* @param array $options optional
* @return string|false

View File

@ -10,22 +10,22 @@
* PHP version 5
*
* @category Crypt
* @package ECDSA
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
namespace phpseclib\Crypt\ECDSA\Formats\Keys;
namespace phpseclib\Crypt\EC\Formats\Keys;
use phpseclib\Crypt\ECDSA\Curves\Ed25519;
use phpseclib\Crypt\EC\Curves\Ed25519;
use phpseclib\Math\Common\FiniteField\Integer;
/**
* libsodium Key Handler
*
* @package ECDSA
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
@ -76,10 +76,10 @@ abstract class libsodium
}
/**
* Convert an ECDSA public key to the appropriate format
* Convert an EC public key to the appropriate format
*
* @access public
* @param \phpseclib\Crypt\ECDSA\Curves\Ed25519 $curve
* @param \phpseclib\Crypt\EC\Curves\Ed25519 $curve
* @param \phpseclib\Math\Common\FiniteField\Integer[] $publicKey
* @return string
*/
@ -93,7 +93,7 @@ abstract class libsodium
*
* @access public
* @param \phpseclib\Math\Common\FiniteField\Integer $privateKey
* @param \phpseclib\Crypt\ECDSA\Curves\Ed25519 $curve
* @param \phpseclib\Crypt\EC\Curves\Ed25519 $curve
* @param \phpseclib\Math\Common\FiniteField\Integer[] $publicKey
* @param string $password optional
* @return string

View File

@ -16,7 +16,7 @@
* @link http://phpseclib.sourceforge.net
*/
namespace phpseclib\Crypt\ECDSA\Formats\Signature;
namespace phpseclib\Crypt\EC\Formats\Signature;
use phpseclib\Math\BigInteger;
use phpseclib\File\ASN1 as Encoder;

View File

@ -1,7 +1,7 @@
<?php
/**
* Raw ECDSA Signature Handler
* Raw EC Signature Handler
*
* PHP version 5
*
@ -13,14 +13,14 @@
* @link http://phpseclib.sourceforge.net
*/
namespace phpseclib\Crypt\ECDSA\Formats\Signature;
namespace phpseclib\Crypt\EC\Formats\Signature;
use phpseclib\Crypt\Common\Formats\Signature\Raw as Progenitor;
/**
* Raw DSA Signature Handler
*
* @package ECDSA
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/

View File

@ -15,7 +15,7 @@
* @link http://phpseclib.sourceforge.net
*/
namespace phpseclib\Crypt\ECDSA\Formats\Signature;
namespace phpseclib\Crypt\EC\Formats\Signature;
use phpseclib\Math\BigInteger;
use phpseclib\Common\Functions\Strings;

View File

@ -1,28 +1,28 @@
<?php
/**
* ECDSA Parameters
* EC Parameters
*
* @category Crypt
* @package ECDSA
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
namespace phpseclib\Crypt\ECDSA;
namespace phpseclib\Crypt\EC;
use phpseclib\Crypt\ECDSA;
use phpseclib\Crypt\EC;
/**
* ECDSA Parameters
* EC Parameters
*
* @package ECDSA
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
class Parameters extends ECDSA
class Parameters extends EC
{
/**
* Returns the parameters

View File

@ -1,35 +1,35 @@
<?php
/**
* ECDSA Private Key
* EC Private Key
*
* @category Crypt
* @package ECDSA
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
namespace phpseclib\Crypt\ECDSA;
namespace phpseclib\Crypt\EC;
use phpseclib\Crypt\ECDSA;
use phpseclib\Crypt\ECDSA\Formats\Signature\ASN1 as ASN1Signature;
use phpseclib\Crypt\EC;
use phpseclib\Crypt\EC\Formats\Signature\ASN1 as ASN1Signature;
use phpseclib\Math\BigInteger;
use phpseclib\Crypt\ECDSA\BaseCurves\TwistedEdwards as TwistedEdwardsCurve;
use phpseclib\Crypt\EC\BaseCurves\TwistedEdwards as TwistedEdwardsCurve;
use phpseclib\Crypt\Hash;
use phpseclib\Crypt\ECDSA\Curves\Ed25519;
use phpseclib\Crypt\ECDSA\Formats\Keys\PKCS8;
use phpseclib\Crypt\EC\Curves\Ed25519;
use phpseclib\Crypt\EC\Formats\Keys\PKCS8;
use phpseclib\Crypt\Common;
/**
* ECDSA Private Key
* EC Private Key
*
* @package ECDSA
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
class PrivateKey extends ECDSA implements Common\PrivateKey
class PrivateKey extends EC implements Common\PrivateKey
{
use Common\Traits\PasswordProtected;
@ -104,7 +104,7 @@ class PrivateKey extends ECDSA implements Common\PrivateKey
if (self::$engines['OpenSSL'] && in_array($this->hash->getHash(), openssl_get_md_methods())) {
$signature = '';
// altho PHP's OpenSSL bindings only supported ECDSA key creation in PHP 7.1 they've long
// altho PHP's OpenSSL bindings only supported EC key creation in PHP 7.1 they've long
// supported signing / verification
// we use specified curves to avoid issues with OpenSSL possibly not supporting a given named curve;
// doing this may mean some curve-specific optimizations can't be used but idk if OpenSSL even
@ -196,7 +196,7 @@ class PrivateKey extends ECDSA implements Common\PrivateKey
$type = self::validatePlugin('Keys', 'PKCS8', 'savePublicKey');
$key = $type::savePublicKey($this->curve, $this->QA);
$key = ECDSA::load($key, 'PKCS8')
$key = EC::load($key, 'PKCS8')
->withHash($this->hash->getHash())
->withSignatureFormat($this->shortFormat);
if ($this->curve instanceof TwistedEdwardsCurve) {

View File

@ -1,36 +1,36 @@
<?php
/**
* ECDSA Public Key
* EC Public Key
*
* @category Crypt
* @package ECDSA
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @copyright 2015 Jim Wigginton
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @link http://phpseclib.sourceforge.net
*/
namespace phpseclib\Crypt\ECDSA;
namespace phpseclib\Crypt\EC;
use phpseclib\Crypt\ECDSA;
use phpseclib\Crypt\EC;
use phpseclib\Crypt\Hash;
use phpseclib\Math\BigInteger;
use phpseclib\Crypt\ECDSA\Formats\Signature\ASN1 as ASN1Signature;
use phpseclib\Crypt\ECDSA\BaseCurves\TwistedEdwards as TwistedEdwardsCurve;
use phpseclib\Crypt\ECDSA\Curves\Ed25519;
use phpseclib\Crypt\ECDSA\Formats\Keys\PKCS1;
use phpseclib\Crypt\ECDSA\Formats\Keys\PKCS8;
use phpseclib\Crypt\EC\Formats\Signature\ASN1 as ASN1Signature;
use phpseclib\Crypt\EC\BaseCurves\TwistedEdwards as TwistedEdwardsCurve;
use phpseclib\Crypt\EC\Curves\Ed25519;
use phpseclib\Crypt\EC\Formats\Keys\PKCS1;
use phpseclib\Crypt\EC\Formats\Keys\PKCS8;
use phpseclib\Crypt\Common;
/**
* ECDSA Public Key
* EC Public Key
*
* @package ECDSA
* @package EC
* @author Jim Wigginton <terrafrost@php.net>
* @access public
*/
class PublicKey extends ECDSA implements Common\PublicKey
class PublicKey extends EC implements Common\PublicKey
{
use Common\Traits\Fingerprint;

View File

@ -39,7 +39,7 @@ abstract class PublicKeyLoader
public static function load($key, $password = false)
{
try {
$new = ECDSA::load($key, false, $password);
$new = EC::load($key, false, $password);
} catch (\Exception $e) {}
if (!isset($new)) {

View File

@ -32,7 +32,7 @@ use phpseclib\Crypt\Hash;
use phpseclib\Crypt\Random;
use phpseclib\Crypt\RSA;
use phpseclib\Crypt\DSA;
use phpseclib\Crypt\ECDSA;
use phpseclib\Crypt\EC;
use phpseclib\Crypt\Common\PublicKey;
use phpseclib\Crypt\Common\PrivateKey;
use phpseclib\Exception\UnsupportedAlgorithmException;
@ -1380,10 +1380,10 @@ class X509
break;
case 'id-Ed25519':
case 'id-Ed448':
$key = ECDSA::load($publicKey, 'PKCS8');
$key = EC::load($publicKey, 'PKCS8');
break;
case 'id-ecPublicKey':
$key = ECDSA::load($publicKey, 'PKCS8');
$key = EC::load($publicKey, 'PKCS8');
switch ($signatureAlgorithm) {
case 'ecdsa-with-SHA1':
case 'ecdsa-with-SHA224':
@ -2093,7 +2093,7 @@ class X509
case 'id-ecPublicKey':
case 'id-Ed25519':
case 'id-Ed448':
return ECDSA::load($key, 'PKCS8');
return EC::load($key, 'PKCS8');
case 'id-dsa':
return DSA::load($key, 'PKCS8');
}
@ -2952,7 +2952,7 @@ class X509
throw new UnsupportedAlgorithmException('The only supported hash algorithms for DSA are: sha1, sha224, sha256');
}
if ($key instanceof ECDSA) {
if ($key instanceof EC) {
switch ($key->getCurve()) {
case 'Ed25519':
case 'Ed448':
@ -2966,10 +2966,10 @@ class X509
case 'sha512':
return 'ecdsa-with-' . strtoupper($key->getHash());
}
throw new UnsupportedAlgorithmException('The only supported hash algorithms for ECDSA are: sha1, sha224, sha256, sha384, sha512');
throw new UnsupportedAlgorithmException('The only supported hash algorithms for EC are: sha1, sha224, sha256, sha384, sha512');
}
throw new UnsupportedAlgorithmException('The only supported public key classes are: RSA, DSA, ECDSA');
throw new UnsupportedAlgorithmException('The only supported public key classes are: RSA, DSA, EC');
}
/**

View File

@ -57,7 +57,7 @@ use phpseclib\Crypt\Rijndael;
use phpseclib\Crypt\Common\PrivateKey;
use phpseclib\Crypt\RSA;
use phpseclib\Crypt\DSA;
use phpseclib\Crypt\ECDSA;
use phpseclib\Crypt\EC;
use phpseclib\Crypt\TripleDES;
use phpseclib\Crypt\Twofish;
use phpseclib\Crypt\ChaCha20;
@ -2412,7 +2412,7 @@ class SSH2
$hash = 'sha1';
$signatureType = 'ssh-rsa';
}
} else if ($publickey instanceof ECDSA) {
} else if ($publickey instanceof EC) {
$privatekey = $privatekey->withSignatureFormat('SSH2');
$curveName = $privatekey->getCurve();
switch ($curveName) {
@ -2443,7 +2443,7 @@ class SSH2
$hash = 'sha1';
$signatureType = 'ssh-dss';
} else {
throw new UnsupportedAlgorithmException('Please use either an RSA key, an ECDSA one or a DSA key');
throw new UnsupportedAlgorithmException('Please use either an RSA key, an EC one or a DSA key');
}
$publickeyStr = $publickey->toString('OpenSSH', ['binary' => true]);
@ -4601,7 +4601,7 @@ class SSH2
case 'ecdsa-sha2-nistp256':
case 'ecdsa-sha2-nistp384':
case 'ecdsa-sha2-nistp521':
$key = ECDSA::load($server_public_host_key, 'OpenSSH')
$key = EC::load($server_public_host_key, 'OpenSSH')
->withSignatureFormat('SSH2');
switch ($this->signature_format) {
case 'ssh-ed25519':

View File

@ -6,15 +6,15 @@
* @license http://www.opensource.org/licenses/mit-license.html MIT License
*/
use phpseclib\Crypt\ECDSA;
use phpseclib\Crypt\EC;
use phpseclib\File\ASN1;
use phpseclib\Crypt\ECDSA\Curves\Ed448;
use phpseclib\Crypt\EC\Curves\Ed448;
use phpseclib\Math\BigInteger;
use phpseclib\Crypt\PublicKeyLoader;
class Ed448PublicKey
{
use phpseclib\Crypt\ECDSA\Formats\Keys\Common;
use phpseclib\Crypt\EC\Formats\Keys\Common;
public static function load($key, $password = '')
{
@ -37,17 +37,17 @@ class Ed448PrivateKey
}
}
class Unit_Crypt_ECDSA_CurveTest extends PhpseclibTestCase
class Unit_Crypt_EC_CurveTest extends PhpseclibTestCase
{
public function curves()
{
$curves = [];
foreach (new \DirectoryIterator(__DIR__ . '/../../../../phpseclib/Crypt/ECDSA/Curves/') as $file) {
foreach (new \DirectoryIterator(__DIR__ . '/../../../../phpseclib/Crypt/EC/Curves/') as $file) {
if ($file->getExtension() != 'php') {
continue;
}
$testName = $file->getBasename('.php');
$class = 'phpseclib\Crypt\ECDSA\Curves\\' . $testName;
$class = 'phpseclib\Crypt\EC\Curves\\' . $testName;
$reflect = new \ReflectionClass($class);
if ($reflect->isFinal()) {
continue;
@ -61,7 +61,7 @@ class Unit_Crypt_ECDSA_CurveTest extends PhpseclibTestCase
public function allCurves()
{
$curves = [];
foreach (new \DirectoryIterator(__DIR__ . '/../../../../phpseclib/Crypt/ECDSA/Curves/') as $file) {
foreach (new \DirectoryIterator(__DIR__ . '/../../../../phpseclib/Crypt/EC/Curves/') as $file) {
if ($file->getExtension() != 'php') {
continue;
}
@ -74,7 +74,7 @@ class Unit_Crypt_ECDSA_CurveTest extends PhpseclibTestCase
public function curvesWithOIDs()
{
$class = new ReflectionClass('phpseclib\Crypt\ECDSA\Formats\Keys\PKCS8');
$class = new ReflectionClass('phpseclib\Crypt\EC\Formats\Keys\PKCS8');
$initialize = $class->getMethod('initialize_static_variables');
$initialize->setAccessible(true);
@ -99,7 +99,7 @@ class Unit_Crypt_ECDSA_CurveTest extends PhpseclibTestCase
*/
public function testBasePoint($name)
{
$class = 'phpseclib\Crypt\ECDSA\Curves\\' . $name;
$class = 'phpseclib\Crypt\EC\Curves\\' . $name;
$curve = new $class;
$this->assertTrue($curve->verifyPoint($curve->getBasePoint()), "Failed to verify basepoint of curve $name");
}
@ -112,7 +112,7 @@ class Unit_Crypt_ECDSA_CurveTest extends PhpseclibTestCase
*/
public function testKeyGeneration($name)
{
$class = 'phpseclib\Crypt\ECDSA\Curves\\' . $name;
$class = 'phpseclib\Crypt\EC\Curves\\' . $name;
$curve = new $class;
$dA = $curve->createRandomMultiplier();
$QA = $curve->multiplyPoint($curve->getBasePoint(), $dA);
@ -126,7 +126,7 @@ class Unit_Crypt_ECDSA_CurveTest extends PhpseclibTestCase
*/
public function testCurveExistance($name)
{
$this->assertFileExists(__DIR__ . "/../../../../phpseclib/Crypt/ECDSA/Curves/$name.php");
$this->assertFileExists(__DIR__ . "/../../../../phpseclib/Crypt/EC/Curves/$name.php");
}
/**
@ -167,12 +167,12 @@ class Unit_Crypt_ECDSA_CurveTest extends PhpseclibTestCase
$plaintext = 'zzz';
ECDSA::useInternalEngine();
$privatekey = ECDSA::createKey($name);
EC::useInternalEngine();
$privatekey = EC::createKey($name);
$publickey = $privatekey->getPublicKey();
$sig = $privatekey->sign($plaintext);
ECDSA::useBestEngine();
EC::useBestEngine();
$this->assertTrue($publickey->verify($plaintext, $sig));
}
@ -190,12 +190,12 @@ class Unit_Crypt_ECDSA_CurveTest extends PhpseclibTestCase
$plaintext = 'zzz';
ECDSA::useBestEngine();
$privatekey = ECDSA::createKey($name);
EC::useBestEngine();
$privatekey = EC::createKey($name);
$publickey = $privatekey->getPublicKey();
$sig = $privatekey->sign($plaintext);
ECDSA::useInternalEngine();
EC::useInternalEngine();
$this->assertTrue($publickey->verify($plaintext, $sig));
}
@ -204,8 +204,8 @@ class Unit_Crypt_ECDSA_CurveTest extends PhpseclibTestCase
*/
public function testEd448TestVectors()
{
ECDSA::addFileFormat('Ed448PublicKey');
ECDSA::addFileFormat('Ed448PrivateKey');
EC::addFileFormat('Ed448PublicKey');
EC::addFileFormat('Ed448PrivateKey');
$private = pack('H*', '6c82a562cb808d10d632be89c8513ebf6c929f34ddfa8c9f63c9960ef6e348a3528c8a3fcc2f044e39a3fc5b94492f8f032e7549a20098f95b');
$public = pack('H*', '5fd7449b59b461fd2ce787ec616ad46a1da1342485a70e1f8a0ea75d80e96778edf124769b46c7061bd6783df1e50f6cd1fa1abeafe8256180');
@ -319,7 +319,7 @@ class Unit_Crypt_ECDSA_CurveTest extends PhpseclibTestCase
*/
public function testEd25519TestVectors()
{
ECDSA::useBestEngine();
EC::useBestEngine();
$private = pack('H*', '9d61b19deffd5a60ba844af492ec2cc44449c5697b326919703bac031cae7f60');
$public = pack('H*', 'd75a980182b10ab7d54bfed3c964073a0ee172f3daa62325af021a68f707511a');
@ -483,9 +483,9 @@ Private-MAC: b85ca0eb7c612df5d18af85128821bd53faaa3ef');
$signature1 = $private->sign($message, 'ASN1');
$signature2 = $private->sign($message, 'ASN1');
// phpseclib's ECDSA implementation uses a CSPRNG to generate the k parameter.
// phpseclib's EC implementation uses a CSPRNG to generate the k parameter.
// used correctly this should result in different signatures every time.
// RFC6979 describes a deterministic ECDSA scheme wherein two signatures for the same
// RFC6979 describes a deterministic EC scheme wherein two signatures for the same
// plaintext would yield the same value so if that were to be switched to then this
// unit test would need to be updated
$this->assertNotEquals($signature1, $signature2);

View File

@ -5,16 +5,16 @@
* @license http://www.opensource.org/licenses/mit-license.html MIT License
*/
use phpseclib\Crypt\ECDSA;
use phpseclib\Crypt\ECDSA\Formats\Keys\PKCS1;
use phpseclib\Crypt\ECDSA\Formats\Keys\PKCS8;
use phpseclib\Crypt\ECDSA\Formats\Keys\PuTTY;
use phpseclib\Crypt\ECDSA\Formats\Keys\OpenSSH;
use phpseclib\Crypt\ECDSA\Formats\Keys\XML;
use phpseclib\Crypt\EC;
use phpseclib\Crypt\EC\Formats\Keys\PKCS1;
use phpseclib\Crypt\EC\Formats\Keys\PKCS8;
use phpseclib\Crypt\EC\Formats\Keys\PuTTY;
use phpseclib\Crypt\EC\Formats\Keys\OpenSSH;
use phpseclib\Crypt\EC\Formats\Keys\XML;
use phpseclib\Crypt\PublicKeyLoader;
use phpseclib\Crypt\ECDSA\PrivateKey;
use phpseclib\Crypt\EC\PrivateKey;
class Unit_Crypt_ECDSA_LoadKeyTest extends PhpseclibTestCase
class Unit_Crypt_EC_LoadKeyTest extends PhpseclibTestCase
{
// openssl ecparam -name secp256k1 -genkey -noout -out secp256k1.pem
public function testPKCS1PrivateKey()
@ -443,7 +443,7 @@ pomV7r6gmoMYteGVABfgAAAAD3ZhZ3JhbnRAdmFncmFudAECAwQFBg==
return parent::assertSame($expected, $actual, $message);
}
public function testOpenSSHPrivateECDSA()
public function testOpenSSHPrivateEC()
{
$key = '-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAaAAAABNlY2RzYS

View File

@ -759,7 +759,7 @@ pMAUPdvLhVjjTvw4ypYrNMc4Z3z5n3bfCVzIQL5Z
$this->assertTrue($x509->validateSignature(false));
}
public function testECDSALoad()
public function testECLoad()
{
// openssl req -x509 -nodes -days 3650 -newkey ec:<(openssl ecparam -name prime256v1) -keyout ecdsakey.pem -out ecdsacert.pem
@ -873,7 +873,7 @@ uhPlgkgknwIgdDqqKIAF60ouiynsbU53ERS0TwpjeFiYGA48SwYW3Nk=
$this->assertSame('id-dsa-with-sha256', $r['signatureAlgorithm']['algorithm']);
}
public function testECDSASave()
public function testECSave()
{
$private = '-----BEGIN PRIVATE KEY-----
MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgQ0o1byJQbAcuklBt