|
@@ 70-79 (lines=10) @@
|
| 67 |
|
/** |
| 68 |
|
* Tests whether the cipher is properly set and the block size is updated correctly |
| 69 |
|
*/ |
| 70 |
|
public function testSetCipher() |
| 71 |
|
{ |
| 72 |
|
$cipher = MCRYPT_TRIPLEDES; |
| 73 |
|
$this->fileCrypt->setCipher($cipher); |
| 74 |
|
|
| 75 |
|
$this->assertEquals($cipher, $this->readAttribute($this->fileCrypt, 'cipher')); |
| 76 |
|
|
| 77 |
|
$block_size = mcrypt_get_block_size($cipher, $this->readAttribute($this->fileCrypt, 'mode')); |
| 78 |
|
$this->assertEquals($block_size, $this->readAttribute($this->fileCrypt, 'block')); |
| 79 |
|
} |
| 80 |
|
|
| 81 |
|
/** |
| 82 |
|
* Tests whether the mode is set correctly and and the block size is updated accordingly |
|
@@ 84-93 (lines=10) @@
|
| 81 |
|
/** |
| 82 |
|
* Tests whether the mode is set correctly and and the block size is updated accordingly |
| 83 |
|
*/ |
| 84 |
|
public function testSetMode() |
| 85 |
|
{ |
| 86 |
|
$mode = MCRYPT_MODE_OFB; |
| 87 |
|
$this->fileCrypt->setMode($mode); |
| 88 |
|
|
| 89 |
|
$this->assertEquals($mode, $this->readAttribute($this->fileCrypt, 'mode')); |
| 90 |
|
|
| 91 |
|
$block_size = mcrypt_get_block_size($this->readAttribute($this->fileCrypt, 'cipher'), $mode); |
| 92 |
|
$this->assertEquals($block_size, $this->readAttribute($this->fileCrypt, 'block')); |
| 93 |
|
} |
| 94 |
|
|
| 95 |
|
/** |
| 96 |
|
* Tests the setting of the key |