CurveParameters::getPrime()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
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