| 1 | <?php |
||
| 9 | class CompactSignature extends Signature implements CompactSignatureInterface |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @var EcAdapter |
||
| 13 | */ |
||
| 14 | private $ecAdapter; |
||
|
|
|||
| 15 | |||
| 16 | /** |
||
| 17 | * @var int|string |
||
| 18 | */ |
||
| 19 | private $recid; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @var bool |
||
| 23 | */ |
||
| 24 | private $compressed; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @param EcAdapter $adapter |
||
| 28 | * @param \GMP $r |
||
| 29 | * @param \GMP $s |
||
| 30 | * @param int $recid |
||
| 31 | * @param bool $compressed |
||
| 32 | */ |
||
| 33 | 19 | public function __construct(EcAdapter $adapter, \GMP $r, \GMP $s, $recid, $compressed) |
|
| 34 | { |
||
| 35 | 19 | if (!is_bool($compressed)) { |
|
| 36 | throw new \InvalidArgumentException('CompactSignature: $compressed must be a boolean'); |
||
| 37 | } |
||
| 38 | |||
| 39 | 19 | $this->ecAdapter = $adapter; |
|
| 40 | 19 | $this->recid = $recid; |
|
| 41 | 19 | $this->compressed = $compressed; |
|
| 42 | 19 | parent::__construct($adapter, $r, $s); |
|
| 43 | 19 | } |
|
| 44 | |||
| 45 | /** |
||
| 46 | * @return Signature |
||
| 47 | */ |
||
| 48 | 17 | public function convert() |
|
| 52 | |||
| 53 | /** |
||
| 54 | * @return int |
||
| 55 | */ |
||
| 56 | 17 | public function getRecoveryId() |
|
| 60 | |||
| 61 | /** |
||
| 62 | * @return bool |
||
| 63 | */ |
||
| 64 | 17 | public function isCompressed() |
|
| 68 | |||
| 69 | /** |
||
| 70 | * @return int |
||
| 71 | */ |
||
| 72 | 12 | public function getFlags() |
|
| 76 | |||
| 77 | /** |
||
| 78 | * @return \BitWasp\Buffertools\BufferInterface |
||
| 79 | */ |
||
| 80 | 12 | public function getBuffer() |
|
| 84 | } |
||
| 85 |