1 | <?php |
||
17 | class PrivateKey extends Key implements PrivateKeyInterface |
||
18 | { |
||
19 | /** |
||
20 | * @var int|string |
||
21 | */ |
||
22 | private $secretMultiplier; |
||
23 | |||
24 | /** |
||
25 | * @var bool |
||
26 | */ |
||
27 | private $compressed; |
||
28 | |||
29 | /** |
||
30 | * @var PublicKey |
||
31 | */ |
||
32 | private $publicKey; |
||
33 | |||
34 | /** |
||
35 | * @var EcAdapter |
||
36 | */ |
||
37 | private $ecAdapter; |
||
38 | |||
39 | /** |
||
40 | * @param EcAdapter $ecAdapter |
||
41 | * @param $int |
||
42 | * @param bool $compressed |
||
43 | * @throws InvalidPrivateKey |
||
44 | */ |
||
45 | 125 | public function __construct(EcAdapter $ecAdapter, $int, $compressed = false) |
|
59 | |||
60 | /** |
||
61 | * @return int|string |
||
62 | */ |
||
63 | 112 | public function getSecretMultiplier() |
|
67 | |||
68 | /** |
||
69 | * @param BufferInterface $msg32 |
||
70 | * @param RbgInterface|null $rbg |
||
71 | * @return \BitWasp\Bitcoin\Crypto\EcAdapter\Signature\SignatureInterface |
||
72 | */ |
||
73 | public function sign(BufferInterface $msg32, RbgInterface $rbg = null) |
||
77 | |||
78 | /** |
||
79 | * @param int|string $tweak |
||
80 | * @return PrivateKeyInterface |
||
81 | */ |
||
82 | 14 | public function tweakAdd($tweak) |
|
100 | |||
101 | /** |
||
102 | * @param int|string $tweak |
||
103 | * @return PrivateKeyInterface |
||
104 | */ |
||
105 | 2 | public function tweakMul($tweak) |
|
123 | |||
124 | /** |
||
125 | * {@inheritDoc} |
||
126 | */ |
||
127 | 66 | public function isCompressed() |
|
131 | |||
132 | /** |
||
133 | * Return the public key |
||
134 | * |
||
135 | * @return PublicKey |
||
136 | */ |
||
137 | 129 | public function getPublicKey() |
|
151 | |||
152 | /** |
||
153 | * @param NetworkInterface $network |
||
154 | * @return string |
||
155 | */ |
||
156 | 6 | public function toWif(NetworkInterface $network = null) |
|
166 | |||
167 | /** |
||
168 | * @return \BitWasp\Buffertools\BufferInterface |
||
169 | */ |
||
170 | 66 | public function getBuffer() |
|
174 | } |
||
175 |