CoreFiles by mySites.guru
HS512.php31 lines, 573 bytes, from Joomla_5.3.4-Stable-Full_Package.zip
Raw History Compare with 5.3.3
md5
d2c5dded2c6e81d8d0895ee1d9ec1b5b
sha1
661068baec24f9816cc563a098caf9f76343f85f
sha256
996dc17a0a49420d2c5bb8706d81948cac7b7b8e9f9a9aa4b1c8517e752d9933
<?php

declare(strict_types=1);

namespace Jose\Component\Signature\Algorithm;

use InvalidArgumentException;
use Jose\Component\Core\JWK;

final class HS512 extends HMAC
{
    public function name(): string
    {
        return 'HS512';
    }

    protected function getHashAlgorithm(): string
    {
        return 'sha512';
    }

    protected function getKey(JWK $key): string
    {
        $k = parent::getKey($key);
        if (mb_strlen($k, '8bit') < 64) {
            throw new InvalidArgumentException('Invalid key length.');
        }

        return $k;
    }
}

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