CoreFiles by mySites.guru
Ed256.php36 lines, 697 bytes, from Joomla_5.2.0-Stable-Full_Package.zip
Raw History Compare with 5.1.4
md5
c0a521e882426f49bcfaec341b79511b
sha1
f72728fa1646ddc0d4ce44f836d0ddd80608df2f
sha256
6c742b86d378bd94c8b612bfd2d88280d75ea9a86bd368b97a8c4d36f6349d7e
<?php

declare(strict_types=1);

namespace Cose\Algorithm\Signature\EdDSA;

use Cose\Key\Key;

final class Ed256 extends EdDSA
{
    public const ID = -260;

    public static function create(): self
    {
        return new self();
    }

    public static function identifier(): int
    {
        return self::ID;
    }

    public function sign(string $data, Key $key): string
    {
        $hashedData = hash('sha256', $data, true);

        return parent::sign($hashedData, $key);
    }

    public function verify(string $data, Key $key, string $signature): bool
    {
        $hashedData = hash('sha256', $data, true);

        return parent::verify($hashedData, $key, $signature);
    }
}

The same content is in 158 releases, Joomla 5.0.0-alpha1 to 6.3.0-alpha1. See them all, or every version of this file.