1 | <?php |
||
13 | class PublicKey extends Key implements PublicKeyInterface |
||
14 | { |
||
15 | /** |
||
16 | * @var EcAdapter |
||
17 | */ |
||
18 | private $ecAdapter; |
||
19 | |||
20 | /** |
||
21 | * @var bool|false |
||
22 | */ |
||
23 | private $compressed; |
||
24 | |||
25 | /** |
||
26 | * @var resource |
||
27 | */ |
||
28 | private $pubkey_t; |
||
29 | |||
30 | /** |
||
31 | * @param EcAdapter $ecAdapter |
||
32 | * @param resource $secp256k1_pubkey_t |
||
33 | * @param bool|false $compressed |
||
34 | */ |
||
35 | 520 | public function __construct(EcAdapter $ecAdapter, $secp256k1_pubkey_t, $compressed = false) |
|
50 | |||
51 | /** |
||
52 | * @param BufferInterface $msg32 |
||
53 | * @param SignatureInterface $signature |
||
54 | * @return bool |
||
55 | */ |
||
56 | public function verify(BufferInterface $msg32, SignatureInterface $signature) |
||
60 | |||
61 | /** |
||
62 | * @param PublicKey $other |
||
63 | * @return bool |
||
64 | 476 | */ |
|
65 | private function doEquals(self $other) |
||
76 | |||
77 | /** |
||
78 | * @param PublicKeyInterface $other |
||
79 | * @return bool |
||
80 | */ |
||
81 | 20 | public function equals(PublicKeyInterface $other) |
|
86 | |||
87 | /** |
||
88 | * @return bool|false |
||
89 | */ |
||
90 | 20 | public function isCompressed() |
|
94 | |||
95 | 20 | /** |
|
96 | * @return resource |
||
97 | */ |
||
98 | public function getResource() |
||
102 | |||
103 | 16 | /** |
|
104 | * @return resource |
||
105 | 16 | * @throws \Exception |
|
106 | 16 | */ |
|
107 | private function clonePubkey() |
||
123 | 4 | ||
124 | 4 | /** |
|
125 | * @param \GMP $tweak |
||
126 | 4 | * @return PublicKey |
|
127 | 4 | * @throws \Exception |
|
128 | */ |
||
129 | public function tweakAdd(\GMP $tweak) |
||
141 | |||
142 | /** |
||
143 | * @param \GMP $tweak |
||
144 | * @return PublicKey |
||
145 | * @throws \Exception |
||
146 | */ |
||
147 | public function tweakMul(\GMP $tweak) |
||
159 | |||
160 | /** |
||
161 | * @return BufferInterface |
||
162 | */ |
||
163 | public function getBuffer() |
||
167 | } |
||
168 |
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: