| Total Complexity | 5 |
| Total Lines | 72 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 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 |
||
| 78 | } |
||
| 79 | } |
||
| 80 |