CurveParameters   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 72
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 13
c 1
b 0
f 0
dl 0
loc 72
rs 10
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getSize() 0 3 1
A getB() 0 3 1
A getA() 0 3 1
A __construct() 0 6 1
A getPrime() 0 3 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Mdanter\Ecc\Primitives;
5
6
class CurveParameters
7
{
8
    /**
9
     * Elliptic curve over the field of integers modulo a prime.
10
     *
11
     * @var \GMP
12
     */
13
    protected $a;
14
15
    /**
16
     *
17
     * @var \GMP
18
     */
19
    protected $b;
20
21
    /**
22
     *
23
     * @var \GMP
24
     */
25
    protected $prime;
26
27
    /**
28
     * Binary length of keys associated with these curve parameters
29
     *
30
     * @var int
31
     */
32
    protected $size;
33
34
    /**
35
     * @param int $size
36
     * @param \GMP $prime
37
     * @param \GMP $a
38
     * @param \GMP $b
39
     */
40
    public function __construct(int $size, \GMP $prime, \GMP $a, \GMP $b)
41
    {
42
        $this->size = $size;
43
        $this->prime = $prime;
44
        $this->a = $a;
45
        $this->b = $b;
46
    }
47
48
    /**
49
     * @return \GMP
50
     */
51
    public function getA(): \GMP
52
    {
53
        return $this->a;
54
    }
55
56
    /**
57
     * @return \GMP
58
     */
59
    public function getB(): \GMP
60
    {
61
        return $this->b;
62
    }
63
64
    /**
65
     * @return \GMP
66
     */
67
    public function getPrime(): \GMP
68
    {
69
        return $this->prime;
70
    }
71
72
    /**
73
     * @return int
74
     */
75
    public function getSize(): int
76
    {
77
        return $this->size;
78
    }
79
}
80