Home
last modified time | relevance | path

Searched refs:curve (Results 1 – 17 of 17) sorted by relevance

/dokuwiki/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Keys/
H A DJWK.php73 $curve = '\phpseclib3\Crypt\EC\Curves\\' . str_replace('P-', 'nistp', $key->crv);
74 $curve = new $curve();
76 if ($curve instanceof TwistedEdwardsCurve) {
77 $QA = self::extractPoint(Strings::base64url_decode($key->x), $curve);
81 $arr = $curve->extractSecret(Strings::base64url_decode($key->d));
86 $curve->convertInteger(new BigInteger(Strings::base64url_decode($key->x), 256)),
87 $curve->convertInteger(new BigInteger(Strings::base64url_decode($key->y), 256))
90 if (!$curve->verifyPoint($QA)) {
100 $curve->rangeCheck($dA);
110 private static function getAlias(BaseCurve $curve) argument
[all …]
H A DCommon.php186 * @param BaseCurve $curve
188 public static function setImplicitCurve(BaseCurve $curve) argument
190 self::$implicitCurve = $curve;
206 $curve = '\phpseclib3\Crypt\EC\Curves\\' . $params['namedCurve'];
207 if (!class_exists($curve)) {
210 return new $curve();
222 $curve = new PrimeCurve();
223 $curve->setModulo($data['fieldID']['parameters']);
224 $curve->setCoefficients(
228 $point = self::extractPoint("\0" . $data['base'], $curve);
[all …]
H A Dlibsodium.php67 $curve = new Ed25519();
68 $components = ['curve' => $curve];
70 $arr = $curve->extractSecret($private);
75 self::extractPoint($public, $curve) :
76 $curve->multiplyPoint($curve->getBasePoint(), $components['dA']);
84 * @param Ed25519 $curve
88 public static function savePublicKey(Ed25519 $curve, array $publicKey) argument
90 return $curve->encodePoint($publicKey);
97 * @param Ed25519 $curve
103 …public static function savePrivateKey(BigInteger $privateKey, Ed25519 $curve, array $publicKey, $s… argument
[all …]
H A DOpenSSH.php70 $curve = self::loadCurveByParam(['namedCurve' => $curveName]);
71 $curve->rangeCheck($privateKey);
73 'curve' => $curve,
75 'QA' => self::extractPoint("\0$publicKey", $curve),
85 $curve = new Ed25519();
86 $qa = self::extractPoint($parsed['publicKey'], $curve);
90 $curve = new $curveName();
92 $qa = self::extractPoint("\0" . $publicKey, $curve);
96 'curve' => $curve,
107 private static function getAlias(BaseCurve $curve) argument
[all …]
H A DMontgomeryPrivate.php53 $curve = new Curve25519();
56 $curve = new Curve448();
62 $components = ['curve' => $curve];
64 $curve->rangeCheck($components['dA']);
74 * @param MontgomeryCurve $curve
78 public static function savePublicKey(MontgomeryCurve $curve, array $publicKey) argument
87 * @param MontgomeryCurve $curve
93 …public static function savePrivateKey(BigInteger $privateKey, MontgomeryCurve $curve, array $publi… argument
H A DXML.php95 $curve = self::loadCurveByParam($xpath);
100 self::extractPointRFC4050($xpath, $curve) :
101 self::extractPoint("\0" . $pubkey, $curve);
174 * @param BaseCurve $curve
177 private static function extractPointRFC4050(\DOMXPath $xpath, BaseCurve $curve) argument
188 $curve->convertInteger(new BigInteger($x->item(0)->getAttribute('Value'))),
189 $curve->convertInteger(new BigInteger($y->item(0)->getAttribute('Value')))
191 if (!$curve->verifyPoint($point)) {
215 $curve = '\phpseclib3\Crypt\EC\Curves\\' . $name;
216 if (!class_exists($curve)) {
[all …]
H A DMontgomeryPublic.php45 $curve = new Curve25519();
48 $curve = new Curve448();
54 $components = ['curve' => $curve];
63 * @param MontgomeryCurve $curve
67 public static function savePublicKey(MontgomeryCurve $curve, array $publicKey) argument
H A DPKCS8.php164 * @param BaseCurve $curve
169 public static function savePublicKey(BaseCurve $curve, array $publicKey, array $options = []) argument
173 if ($curve instanceof MontgomeryCurve) {
177 if ($curve instanceof TwistedEdwardsCurve) {
179 $curve->encodePoint($publicKey),
181 $curve instanceof Ed25519 ? 'id-Ed25519' : 'id-Ed448',
186 $params = new ASN1\Element(self::encodeParameters($curve, false, $options));
197 * @param BaseCurve $curve
204 …public static function savePrivateKey(BigInteger $privateKey, BaseCurve $curve, array $publicKey, … argument
208 if ($curve instanceof MontgomeryCurve) {
[all …]
H A DPuTTY.php88 * @param BaseCurve $curve
95 …public static function savePrivateKey(BigInteger $privateKey, BaseCurve $curve, array $publicKey, … argument
99 $public = explode(' ', OpenSSH::savePublicKey($curve, $publicKey));
107 if (!$curve instanceof TwistedEdwardsCurve) {
114 $private = $curve instanceof TwistedEdwardsCurve ?
124 * @param BaseCurve $curve
128 public static function savePublicKey(BaseCurve $curve, array $publicKey) argument
130 $public = explode(' ', OpenSSH::savePublicKey($curve, $publicKey));
H A DPKCS1.php147 public static function saveParameters(BaseCurve $curve, array $options = []) argument
151 if ($curve instanceof TwistedEdwardsCurve || $curve instanceof MontgomeryCurve) {
155 $key = self::encodeParameters($curve, false, $options);
166 * @param BaseCurve $curve
173 …public static function savePrivateKey(BigInteger $privateKey, BaseCurve $curve, array $publicKey, … argument
177 if ($curve instanceof TwistedEdwardsCurve || $curve instanceof MontgomeryCurve) {
186 'parameters' => new ASN1\Element(self::encodeParameters($curve)),
/dokuwiki/vendor/phpseclib/phpseclib/phpseclib/Crypt/
H A DEC.php75 protected $curve; variable in phpseclib3\\Crypt\\EC
136 * @param string $curve
139 public static function createKey($curve) argument
152 $curve = strtolower($curve);
153 …if (self::$engines['libsodium'] && $curve == 'ed25519' && function_exists('sodium_crypto_sign_keyp…
167 $curveName = $curve;
173 $curve = '\phpseclib3\Crypt\EC\Curves\\' . $curveName;
175 if (!class_exists($curve)) {
179 $reflect = new \ReflectionClass($curve);
184 $curve = new $curve();
[all …]
/dokuwiki/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Signature/
H A DSSH2.php71 * @param string $curve
74 public static function save(BigInteger $r, BigInteger $s, $curve) argument
76 switch ($curve) {
78 $curve = 'nistp256';
81 $curve = 'nistp384';
84 $curve = 'nistp521';
92 return Strings::packSSH2('ss', 'ecdsa-sha2-' . $curve, $blob);
H A DIEEE.php57 * @param string $curve
61 public static function save(BigInteger $r, BigInteger $s, $curve, $length) argument
/dokuwiki/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/
H A DPublicKey.php45 if ($this->curve instanceof MontgomeryCurve) {
55 $order = $this->curve->getOrder();
57 if ($this->curve instanceof TwistedEdwardsCurve) {
62 … if ($this->curve instanceof Ed25519 && self::$engines['libsodium'] && !isset($this->context)) {
66 $curve = $this->curve;
67 if (strlen($signature) != 2 * $curve::SIZE) {
71 $R = substr($signature, 0, $curve::SIZE);
72 $S = substr($signature, $curve::SIZE);
75 $R = PKCS1::extractPoint($R, $curve);
76 $R = $this->curve->convertToInternal($R);
[all …]
H A DPrivateKey.php62 if ($this->curve instanceof MontgomeryCurve) {
63 if ($this->curve instanceof Curve25519 && self::$engines['libsodium']) {
67 $point = [$this->curve->convertInteger(new BigInteger(strrev($coordinates), 256))];
68 $point = $this->curve->multiplyPoint($point, $this->dA);
71 if (!$this->curve instanceof TwistedEdwardsCurve) {
74 $point = PKCS1::extractPoint($coordinates, $this->curve);
75 $point = $this->curve->multiplyPoint($point, $this->dA);
76 if ($this->curve instanceof TwistedEdwardsCurve) {
77 return $this->curve->encodePoint($point);
94 if ($this->curve instanceof MontgomeryCurve) {
[all …]
H A DParameters.php34 return $type::saveParameters($this->curve, $options);
/dokuwiki/vendor/phpseclib/phpseclib/phpseclib/Net/
H A DSSH2.php1809 $curve = strpos($this->kex_algorithm, 'curve25519-sha256') === 0 ?
1812 $ourPrivate = EC::createKey($curve);