| 1 |
<?php |
| 2 |
|
| 3 |
namespace Dudlewebs\WPMCS\s3\Aws\Crypto\Cipher; |
| 4 |
|
| 5 |
interface CipherMethod |
| 6 |
{ |
| 7 |
/** |
| 8 |
* Returns an identifier recognizable by `openssl_*` functions, such as |
| 9 |
* `aes-256-cbc` or `aes-128-ctr`. |
| 10 |
* |
| 11 |
* @return string |
| 12 |
*/ |
| 13 |
public function getOpenSslName(); |
| 14 |
/** |
| 15 |
* Returns an AES recognizable name, such as 'AES/GCM/NoPadding'. |
| 16 |
* |
| 17 |
* @return string |
| 18 |
*/ |
| 19 |
public function getAesName(); |
| 20 |
/** |
| 21 |
* Returns the IV that should be used to initialize the next block in |
| 22 |
* encrypt or decrypt. |
| 23 |
* |
| 24 |
* @return string |
| 25 |
*/ |
| 26 |
public function getCurrentIv(); |
| 27 |
/** |
| 28 |
* Indicates whether the cipher method used with this IV requires padding |
| 29 |
* the final block to make sure the plaintext is evenly divisible by the |
| 30 |
* block size. |
| 31 |
* |
| 32 |
* @return boolean |
| 33 |
*/ |
| 34 |
public function requiresPadding(); |
| 35 |
/** |
| 36 |
* Adjust the return of this::getCurrentIv to reflect a seek performed on |
| 37 |
* the encryption stream using this IV object. |
| 38 |
* |
| 39 |
* @param int $offset |
| 40 |
* @param int $whence |
| 41 |
* |
| 42 |
* @throws LogicException Thrown if the requested seek is not supported by |
| 43 |
* this IV implementation. For example, a CBC IV |
| 44 |
* only supports a full rewind ($offset === 0 && |
| 45 |
* $whence === SEEK_SET) |
| 46 |
*/ |
| 47 |
public function seek($offset, $whence = \SEEK_SET); |
| 48 |
/** |
| 49 |
* Take account of the last cipher text block to adjust the return of |
| 50 |
* this::getCurrentIv |
| 51 |
* |
| 52 |
* @param string $cipherTextBlock |
| 53 |
*/ |
| 54 |
public function update($cipherTextBlock); |
| 55 |
} |
| 56 |
|