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 | 126 | 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 | * @return bool|false |
||
63 | */ |
||
64 | 119 | public function isCompressed() |
|
68 | |||
69 | /** |
||
70 | * @return resource |
||
71 | */ |
||
72 | 103 | public function getResource() |
|
76 | |||
77 | /** |
||
78 | * @return resource |
||
79 | * @throws \Exception |
||
80 | */ |
||
81 | 3 | private function clonePubkey() |
|
97 | |||
98 | /** |
||
99 | * @param \GMP $tweak |
||
100 | * @return PublicKey |
||
101 | * @throws \Exception |
||
102 | */ |
||
103 | 2 | public function tweakAdd(\GMP $tweak) |
|
115 | |||
116 | /** |
||
117 | * @param \GMP $tweak |
||
118 | * @return PublicKey |
||
119 | * @throws \Exception |
||
120 | */ |
||
121 | 1 | public function tweakMul(\GMP $tweak) |
|
133 | |||
134 | /** |
||
135 | * @return BufferInterface |
||
136 | */ |
||
137 | 100 | public function getBuffer() |
|
141 | } |
||
142 |