phpseclib/tests/Unit/Crypt/EC/Ed448PublicKey.php

27 lines
625 B
PHP
Raw Normal View History

<?php
2022-06-04 15:31:21 +00:00
declare(strict_types=1);
namespace phpseclib3\Tests\Unit\Crypt\EC;
use phpseclib3\Common\Functions\Strings;
use phpseclib3\Crypt\EC\Curves\Ed448;
use phpseclib3\Crypt\EC\Formats\Keys\Common;
class Ed448PublicKey
{
use Common;
2022-06-04 15:31:21 +00:00
public static function load($key, $password = ''): array
{
if (!Strings::is_stringable($key)) {
throw new \UnexpectedValueException('Key should be a string - not a ' . gettype($key));
}
$components = ['curve' => new Ed448()];
$components['QA'] = self::extractPoint($key, $components['curve']);
return $components;
}
}