| 1 |
<?php |
| 2 |
|
| 3 |
declare(strict_types=1); |
| 4 |
|
| 5 |
/* |
| 6 |
* The MIT License (MIT) |
| 7 |
* |
| 8 |
* Copyright (c) 2014-2021 Spomky-Labs |
| 9 |
* |
| 10 |
* This software may be modified and distributed under the terms |
| 11 |
* of the MIT license. See the LICENSE file for details. |
| 12 |
*/ |
| 13 |
|
| 14 |
namespace WP_DEFENDER_VENDOR\Cose\Algorithm\Signature\ECDSA; |
| 15 |
|
| 16 |
use WP_DEFENDER_VENDOR\Cose\Key\Ec2Key; |
| 17 |
|
| 18 |
final class ES256K extends ECDSA |
| 19 |
{ |
| 20 |
public const ID = -46; |
| 21 |
|
| 22 |
public static function identifier(): int |
| 23 |
{ |
| 24 |
return self::ID; |
| 25 |
} |
| 26 |
|
| 27 |
protected function getHashAlgorithm(): int |
| 28 |
{ |
| 29 |
return OPENSSL_ALGO_SHA256; |
| 30 |
} |
| 31 |
|
| 32 |
protected function getCurve(): int |
| 33 |
{ |
| 34 |
return Ec2Key::CURVE_P256K; |
| 35 |
} |
| 36 |
|
| 37 |
protected function getSignaturePartLength(): int |
| 38 |
{ |
| 39 |
return 64; |
| 40 |
} |
| 41 |
} |
| 42 |
|