xref: /PHP-7.1/ext/mcrypt/tests/bug46010.phpt (revision dadef203)
1--TEST--
2Bug #46010 (warnings incorrectly generated for iv in ecb mode)
3--SKIPIF--
4<?php if (!extension_loaded("mcrypt")) print "skip"; ?>
5--FILE--
6<?php
7
8$key = "012345678901234567890123";
9var_dump(bin2hex(mcrypt_encrypt(MCRYPT_TRIPLEDES, $key, "data", MCRYPT_MODE_ECB)));
10var_dump(bin2hex(mcrypt_encrypt(MCRYPT_TRIPLEDES, $key, "data", MCRYPT_MODE_ECB, "a")));
11var_dump(bin2hex(mcrypt_encrypt(MCRYPT_TRIPLEDES, $key, "data", MCRYPT_MODE_ECB, "12345678")));
12
13?>
14--EXPECTF--
15Deprecated: Function mcrypt_encrypt() is deprecated in %s%ebug46010.php on line 4
16string(16) "f7a2ce11d4002294"
17
18Deprecated: Function mcrypt_encrypt() is deprecated in %s%ebug46010.php on line 5
19string(16) "f7a2ce11d4002294"
20
21Deprecated: Function mcrypt_encrypt() is deprecated in %s%ebug46010.php on line 6
22string(16) "f7a2ce11d4002294"
23