1 | <?php |
||
16 | class PublicKey extends Key implements PublicKeyInterface |
||
17 | { |
||
18 | /** |
||
19 | * @var EcAdapter |
||
20 | */ |
||
21 | private $ecAdapter; |
||
22 | |||
23 | /** |
||
24 | * @var bool|false |
||
25 | */ |
||
26 | private $compressed; |
||
27 | |||
28 | /** |
||
29 | * @var resource |
||
30 | */ |
||
31 | private $pubkey_t; |
||
32 | |||
33 | /** |
||
34 | * @param EcAdapter $ecAdapter |
||
35 | * @param resource $secp256k1_pubkey_t |
||
36 | * @param bool|false $compressed |
||
37 | */ |
||
38 | 302 | public function __construct(EcAdapter $ecAdapter, $secp256k1_pubkey_t, $compressed = false) |
|
53 | |||
54 | /** |
||
55 | * @param BufferInterface $msg32 |
||
56 | * @param SignatureInterface $signature |
||
57 | * @return bool |
||
58 | */ |
||
59 | public function verify(BufferInterface $msg32, SignatureInterface $signature): bool |
||
63 | |||
64 | /** |
||
65 | * @param PublicKey $other |
||
66 | * @return bool |
||
67 | */ |
||
68 | 58 | private function doEquals(PublicKey $other): bool |
|
79 | |||
80 | /** |
||
81 | * @param PublicKeyInterface $other |
||
82 | * @return bool |
||
83 | */ |
||
84 | 58 | public function equals(PublicKeyInterface $other): bool |
|
89 | |||
90 | /** |
||
91 | * @return bool|false |
||
92 | */ |
||
93 | 153 | public function isCompressed(): bool |
|
97 | |||
98 | /** |
||
99 | * @return resource |
||
100 | */ |
||
101 | 284 | public function getResource() |
|
105 | |||
106 | /** |
||
107 | * @return resource |
||
108 | * @throws \Exception |
||
109 | */ |
||
110 | 5 | private function clonePubkey() |
|
126 | |||
127 | /** |
||
128 | * @param \GMP $tweak |
||
129 | * @return KeyInterface |
||
130 | * @throws \Exception |
||
131 | */ |
||
132 | 4 | public function tweakAdd(\GMP $tweak): KeyInterface |
|
144 | |||
145 | /** |
||
146 | * @param \GMP $tweak |
||
147 | * @return KeyInterface |
||
148 | * @throws \Exception |
||
149 | */ |
||
150 | 1 | public function tweakMul(\GMP $tweak): KeyInterface |
|
162 | |||
163 | /** |
||
164 | * @return BufferInterface |
||
165 | */ |
||
166 | 118 | public function getBuffer(): BufferInterface |
|
170 | } |
||
171 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: