xref: /PHP-7.0/ext/mcrypt/tests/bug46010.phpt (revision a861a3a9)
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--
15string(16) "f7a2ce11d4002294"
16string(16) "f7a2ce11d4002294"
17string(16) "f7a2ce11d4002294"
18