1 | <?php |
||
18 | class PrivateKey extends Key implements PrivateKeyInterface |
||
19 | { |
||
20 | /** |
||
21 | * @var int|string |
||
22 | */ |
||
23 | private $secret; |
||
24 | |||
25 | /** |
||
26 | * @var string |
||
27 | */ |
||
28 | private $secretBin; |
||
29 | |||
30 | /** |
||
31 | * @var bool |
||
32 | */ |
||
33 | private $compressed; |
||
34 | |||
35 | /** |
||
36 | * @var PublicKey |
||
37 | */ |
||
38 | private $publicKey; |
||
39 | |||
40 | /** |
||
41 | * @var EcAdapter |
||
42 | */ |
||
43 | private $ecAdapter; |
||
44 | |||
45 | /** |
||
46 | * @param EcAdapter $adapter |
||
47 | * @param $secret |
||
48 | * @param bool|false $compressed |
||
49 | * @throws \Exception |
||
50 | */ |
||
51 | 213 | public function __construct(EcAdapter $adapter, $secret, $compressed = false) |
|
67 | |||
68 | /** |
||
69 | * @param BufferInterface $msg32 |
||
70 | * @param RbgInterface|null $rbgInterface |
||
71 | * @return Signature |
||
72 | */ |
||
73 | public function sign(BufferInterface $msg32, RbgInterface $rbgInterface = null) |
||
77 | |||
78 | /** |
||
79 | * @return bool|false |
||
80 | */ |
||
81 | 102 | public function isCompressed() |
|
85 | |||
86 | /** |
||
87 | * @return int|string |
||
88 | */ |
||
89 | 87 | public function getSecretMultiplier() |
|
93 | |||
94 | /** |
||
95 | * @return string |
||
96 | */ |
||
97 | 237 | public function getSecretBinary() |
|
101 | |||
102 | /** |
||
103 | * @return PublicKey |
||
104 | */ |
||
105 | 216 | public function getPublicKey() |
|
120 | |||
121 | /** |
||
122 | * @param int $tweak |
||
123 | * @var string $tweak |
||
124 | * @return PrivateKey |
||
125 | */ |
||
126 | 18 | public function tweakAdd($tweak) |
|
146 | |||
147 | /** |
||
148 | * @param int $tweak |
||
149 | * @return PrivateKey |
||
150 | */ |
||
151 | 3 | public function tweakMul($tweak) |
|
171 | |||
172 | /** |
||
173 | * @param NetworkInterface $network |
||
174 | * @return string |
||
175 | */ |
||
176 | 12 | public function toWif(NetworkInterface $network = null) |
|
182 | |||
183 | /** |
||
184 | * @return BufferInterface |
||
185 | */ |
||
186 | 228 | public function getBuffer() |
|
190 | } |
||
191 |