diff options
Diffstat (limited to 'ext/mcrypt/tests/mcrypt_cbc_3des_decrypt.phpt')
-rw-r--r-- | ext/mcrypt/tests/mcrypt_cbc_3des_decrypt.phpt | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/ext/mcrypt/tests/mcrypt_cbc_3des_decrypt.phpt b/ext/mcrypt/tests/mcrypt_cbc_3des_decrypt.phpt index b306a8a94e..73467c2118 100644 --- a/ext/mcrypt/tests/mcrypt_cbc_3des_decrypt.phpt +++ b/ext/mcrypt/tests/mcrypt_cbc_3des_decrypt.phpt @@ -1,17 +1,17 @@ --TEST-- -Test mcrypt_cbc() function : basic functionality +Test mcrypt_cbc() function : basic 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_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: */ $cipher = MCRYPT_TRIPLEDES; @@ -19,9 +19,9 @@ $data = b"This is the secret message which must be encrypted"; // tripledes uses keys with exactly 192 bits (24 bytes) $keys = array( - b'12345678', - b'12345678901234567890', - b'123456789012345678901234', + b'12345678', + b'12345678901234567890', + b'123456789012345678901234', b'12345678901234567890123456' ); $data1 = array( @@ -32,8 +32,8 @@ $data1 = array( ); // tripledes is a block cipher of 64 bits (8 bytes) $ivs = array( - b'1234', - b'12345678', + b'1234', + b'12345678', b'123456789' ); // data represented in base64 (ascii) @@ -50,7 +50,7 @@ for ($i = 0; $i < sizeof($keys); $i++) { special_var_dump(mcrypt_decrypt($cipher, $keys[$i], base64_decode($data1[$i]), MCRYPT_MODE_CBC, $iv)); } -$key = b'123456789012345678901234'; +$key = b'123456789012345678901234'; echo "\n--- testing different iv lengths\n"; for ($i = 0; $i < sizeof($ivs); $i++) { echo "\niv length=".strlen($ivs[$i])."\n"; @@ -59,7 +59,7 @@ for ($i = 0; $i < sizeof($ivs); $i++) { function special_var_dump($str) { var_dump(bin2hex($str)); -} +} ?> ===DONE=== --EXPECTF-- |