Completed
Push — master ( 022625...2b82d4 )
by Florent
05:58
created

ES512   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 2
Bugs 2 Features 0
Metric Value
wmc 4
c 2
b 2
f 0
lcom 0
cbo 3
dl 0
loc 34
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getGenerator() 0 4 1
A getHashAlgorithm() 0 4 1
A getSignaturePartLength() 0 4 1
A getAlgorithmName() 0 4 1
1
<?php
2
3
/*
4
 * The MIT License (MIT)
5
 *
6
 * Copyright (c) 2014-2016 Spomky-Labs
7
 *
8
 * This software may be modified and distributed under the terms
9
 * of the MIT license.  See the LICENSE file for details.
10
 */
11
12
namespace Jose\Algorithm\Signature;
13
14
use Mdanter\Ecc\EccFactory;
15
16
final class ES512 extends ECDSA
17
{
18
    /**
19
     * @return \Mdanter\Ecc\Primitives\GeneratorPoint
20
     */
21
    protected function getGenerator()
22
    {
23
        return EccFactory::getNistCurves()->generator521();
24
    }
25
26
    /**
27
     * @return string
28
     */
29
    protected function getHashAlgorithm()
30
    {
31
        return 'sha512';
32
    }
33
34
    /**
35
     * @return int
36
     */
37
    protected function getSignaturePartLength()
38
    {
39
        return 132;
40
    }
41
42
    /**
43
     * @return string
44
     */
45
    public function getAlgorithmName()
46
    {
47
        return 'ES512';
48
    }
49
}
50