|
@@ 414-422 (lines=9) @@
|
| 411 |
|
* |
| 412 |
|
* @return string |
| 413 |
|
*/ |
| 414 |
|
protected function readIV(string $data, int $ivLength): string |
| 415 |
|
{ |
| 416 |
|
$vector = substr($data, 0, $ivLength); |
| 417 |
|
$isOk = $vector !== false && strlen($vector) === $ivLength; |
| 418 |
|
|
| 419 |
|
$isOk === true ?: $this->throwException(new CryptException($this->getReadVectorErrorMessage())); |
| 420 |
|
|
| 421 |
|
return $vector; |
| 422 |
|
} |
| 423 |
|
|
| 424 |
|
/** |
| 425 |
|
* @param string $data |
|
@@ 446-454 (lines=9) @@
|
| 443 |
|
* |
| 444 |
|
* @return string |
| 445 |
|
*/ |
| 446 |
|
protected function extractData(string $data, int $ivLength): string |
| 447 |
|
{ |
| 448 |
|
$result = substr($data, $ivLength); |
| 449 |
|
|
| 450 |
|
$isOk = $result !== false && empty($result) === false; |
| 451 |
|
$isOk === true ?: $this->throwException(new CryptException($this->getExtractDataErrorMessage())); |
| 452 |
|
|
| 453 |
|
return $result; |
| 454 |
|
} |
| 455 |
|
|
| 456 |
|
/** |
| 457 |
|
* @param string $data |