Skip to content

Commit 7aed239

Browse files
committed
Ask for less random data in mcrypt_create_iv
Otherwise the RNG blocks and the test takes a lot of time to run (and occasionally fails).
1 parent 9bc1af1 commit 7aed239

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ext/mcrypt/tests/mcrypt_create_iv.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ mcrypt_create_iv
55
--FILE--
66
<?php
77
$iv1 = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_ECB), MCRYPT_RAND);
8-
$iv2 = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_192, MCRYPT_MODE_ECB), MCRYPT_DEV_URANDOM);
9-
$iv3 = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_DEV_RANDOM);
8+
$iv2 = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_ECB), MCRYPT_DEV_URANDOM);
9+
$iv3 = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_ECB), MCRYPT_DEV_RANDOM);
1010

1111
echo strlen($iv1) . "\n";
1212
echo strlen($iv2) . "\n";
1313
echo strlen($iv3) . "\n";
1414
--EXPECT--
1515
16
16-
24
17-
32
16+
16
17+
16

0 commit comments

Comments
 (0)