You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
725 B
PHP
28 lines
725 B
PHP
<?php
|
|
|
|
use Dcrypt\Mcrypt;
|
|
|
|
class McryptTest extends PHPUnit_Framework_TestCase
|
|
{
|
|
|
|
public function testEngine()
|
|
{
|
|
$modes = \Dcrypt\Support\TestSupport::mcryptModes();
|
|
$ciphers = \Dcrypt\Support\TestSupport::mcryptCiphers();
|
|
|
|
foreach (hash_algos() as $algo) {
|
|
$input = 'AAAAAAAA';
|
|
$key = 'AAAAAAAA';
|
|
$cost = 0;
|
|
|
|
foreach ($modes as $mode) {
|
|
foreach ($ciphers as $cipher) {
|
|
$encrypted = Mcrypt::encrypt($input, $key, $cost, $cipher, $mode, $algo);
|
|
$this->assertEquals($input, Mcrypt::decrypt($encrypted, $key, $cost, $cipher, $mode, $algo));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|