1 | <?php |
||
17 | class PublicKey extends Key implements PublicKeyInterface |
||
18 | { |
||
19 | /** |
||
20 | * @var EcAdapter |
||
21 | */ |
||
22 | private $ecAdapter; |
||
23 | |||
24 | /** |
||
25 | * @var bool|false |
||
26 | */ |
||
27 | private $compressed; |
||
28 | |||
29 | /** |
||
30 | * @var resource |
||
31 | */ |
||
32 | private $pubkey_t; |
||
33 | |||
34 | /** |
||
35 | * @param EcAdapter $ecAdapter |
||
36 | * @param resource $secp256k1_pubkey_t |
||
37 | * @param bool|false $compressed |
||
38 | */ |
||
39 | 301 | public function __construct(EcAdapter $ecAdapter, $secp256k1_pubkey_t, bool $compressed = false) |
|
54 | |||
55 | /** |
||
56 | * @param BufferInterface $msg32 |
||
57 | * @param SignatureInterface $signature |
||
58 | * @return bool |
||
59 | */ |
||
60 | 181 | public function verify(BufferInterface $msg32, SignatureInterface $signature): bool |
|
65 | |||
66 | /** |
||
67 | * @param PublicKey $other |
||
68 | * @return bool |
||
69 | */ |
||
70 | 58 | private function doEquals(PublicKey $other): bool |
|
81 | |||
82 | /** |
||
83 | * @param PublicKeyInterface $other |
||
84 | * @return bool |
||
85 | */ |
||
86 | 58 | public function equals(PublicKeyInterface $other): bool |
|
91 | |||
92 | /** |
||
93 | * @return bool|false |
||
94 | */ |
||
95 | 153 | public function isCompressed(): bool |
|
99 | |||
100 | /** |
||
101 | * @return resource |
||
102 | */ |
||
103 | 140 | public function getResource() |
|
107 | |||
108 | /** |
||
109 | * @return resource |
||
110 | * @throws \Exception |
||
111 | */ |
||
112 | 5 | private function clonePubkey() |
|
128 | |||
129 | /** |
||
130 | * @param \GMP $tweak |
||
131 | * @return KeyInterface |
||
132 | * @throws \Exception |
||
133 | */ |
||
134 | 4 | public function tweakAdd(\GMP $tweak): KeyInterface |
|
146 | |||
147 | /** |
||
148 | * @param \GMP $tweak |
||
149 | * @return KeyInterface |
||
150 | * @throws \Exception |
||
151 | */ |
||
152 | 1 | public function tweakMul(\GMP $tweak): KeyInterface |
|
164 | |||
165 | /** |
||
166 | * @return BufferInterface |
||
167 | */ |
||
168 | 118 | public function getBuffer(): BufferInterface |
|
172 | } |
||
173 |
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: