Annotation of embedaddon/php/ext/mcrypt/tests/bug55169.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: mcrypt_create_iv https://bugs.php.net/bug.php?id=55169
! 3: --CREDIT--
! 4: Ryan Biesemeyer <ryan@yaauie.com>
! 5: --SKIPIF--
! 6: <?php if (!extension_loaded("mcrypt")) print "skip"; ?>
! 7: --FILE--
! 8: <?php
! 9: for( $i=1; $i<=64; $i = $i*2 ){
! 10: echo 'Input: '. $i . PHP_EOL;
! 11: $random = mcrypt_create_iv( $i, MCRYPT_DEV_URANDOM );
! 12: echo ' Length: ' . strlen( $random ) . PHP_EOL;
! 13: echo ' Hex: '. bin2hex( $random ) . PHP_EOL;
! 14: echo PHP_EOL;
! 15: }
! 16: ?>
! 17: --EXPECTF--
! 18: Input: 1
! 19: Length: 1
! 20: Hex: %x
! 21:
! 22: Input: 2
! 23: Length: 2
! 24: Hex: %x
! 25:
! 26: Input: 4
! 27: Length: 4
! 28: Hex: %x
! 29:
! 30: Input: 8
! 31: Length: 8
! 32: Hex: %x
! 33:
! 34: Input: 16
! 35: Length: 16
! 36: Hex: %x
! 37:
! 38: Input: 32
! 39: Length: 32
! 40: Hex: %x
! 41:
! 42: Input: 64
! 43: Length: 64
! 44: Hex: %x
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>