summaryrefslogtreecommitdiff
path: root/ext/mcrypt/tests/mcrypt_rijndael128_128BitKey.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/mcrypt/tests/mcrypt_rijndael128_128BitKey.phpt')
-rw-r--r--ext/mcrypt/tests/mcrypt_rijndael128_128BitKey.phpt38
1 files changed, 19 insertions, 19 deletions
diff --git a/ext/mcrypt/tests/mcrypt_rijndael128_128BitKey.phpt b/ext/mcrypt/tests/mcrypt_rijndael128_128BitKey.phpt
index d9e7d96bbc..2af5e33d8b 100644
--- a/ext/mcrypt/tests/mcrypt_rijndael128_128BitKey.phpt
+++ b/ext/mcrypt/tests/mcrypt_rijndael128_128BitKey.phpt
@@ -1,27 +1,27 @@
--TEST--
-Test mcrypt_encrypt() function : AES functionality
+Test mcrypt_encrypt() function : AES functionality
--SKIPIF--
-<?php
+<?php
if (!extension_loaded("mcrypt")) {
- print "skip - mcrypt extension not loaded";
-}
+ print "skip - mcrypt extension not loaded";
+}
?>
--FILE--
<?php
/* Prototype : string mcrypt_encrypt(string cipher, string key, string data, string mode, string iv)
- * Description: OFB crypt/decrypt data using key key with cipher cipher starting with iv
+ * Description: OFB crypt/decrypt data using key key with cipher cipher starting with iv
* Source code: ext/mcrypt/mcrypt.c
- * Alias to functions:
+ * Alias to functions:
*/
/* Prototype : string mcrypt_decrypt(string cipher, string key, string data, string mode, string iv)
- * Description: OFB crypt/decrypt data using key key with cipher cipher starting with iv
+ * Description: OFB crypt/decrypt data using key key with cipher cipher starting with iv
* Source code: ext/mcrypt/mcrypt.c
- * Alias to functions:
+ * Alias to functions:
*/
/* Prototype : string mcrypt_cbc(int cipher, string key, string data, int mode, string iv)
- * Description: CBC crypt/decrypt data using key key with cipher cipher starting with iv
+ * Description: CBC crypt/decrypt data using key key with cipher cipher starting with iv
* Source code: ext/mcrypt/mcrypt.c
- * Alias to functions:
+ * Alias to functions:
*/
echo "*** Testing mcrypt : Rijndael128 functionality ***\n";
@@ -32,17 +32,17 @@ $data = b'This is the secret message which must be encrypted';
// keys up to 128 bits (16 bytes)
$keys = array(
- null,
- '',
- b'12345678',
+ null,
+ '',
+ b'12345678',
b'1234567890123456'
);
// rijndael128 is a block cipher of 128 bits (16 bytes)
$ivs = array(
- null,
- '',
- b'12345678',
- b'1234567890123456',
+ null,
+ '',
+ b'12345678',
+ b'1234567890123456',
b'12345678901234567'
);
@@ -55,12 +55,12 @@ foreach ($keys as $key) {
var_dump(bin2hex($res));
}
-$key = b'1234567890123456';
+$key = b'1234567890123456';
echo "\n--- testing different iv lengths\n";
foreach ($ivs as $iv) {
echo "\niv length=".strlen($iv)."\n";
$res = mcrypt_decrypt($cipher, $key, $res, MCRYPT_MODE_CBC, $iv);
- var_dump(bin2hex($res));
+ var_dump(bin2hex($res));
}
?>