1
0
mirror of https://github.com/danog/tgseclib.git synced 2024-11-27 04:34:45 +01:00

Tests: crypt_random_string -> Random::string

This commit is contained in:
terrafrost 2017-01-27 12:29:00 -06:00
parent ac2b7ef76c
commit 062ee6b5b5
2 changed files with 4 additions and 2 deletions

View File

@ -7,6 +7,7 @@
use phpseclib\Crypt\Base; use phpseclib\Crypt\Base;
use phpseclib\Crypt\Blowfish; use phpseclib\Crypt\Blowfish;
use phpseclib\Crypt\Random;
class Unit_Crypt_BlowfishTest extends PhpseclibTestCase class Unit_Crypt_BlowfishTest extends PhpseclibTestCase
{ {
@ -118,7 +119,7 @@ class Unit_Crypt_BlowfishTest extends PhpseclibTestCase
$plaintext = str_repeat('.', 100); $plaintext = str_repeat('.', 100);
for ($keyLen = 4; $keyLen <= 56; $keyLen++) { for ($keyLen = 4; $keyLen <= 56; $keyLen++) {
$key = crypt_random_string($keyLen); $key = Random::string($keyLen);
$objects[0]->setKey($key); $objects[0]->setKey($key);
$ref = $objects[0]->encrypt($plaintext); $ref = $objects[0]->encrypt($plaintext);
for ($i = 1; $i < count($objects); $i++) { for ($i = 1; $i < count($objects); $i++) {

View File

@ -7,6 +7,7 @@
use phpseclib\Crypt\Base; use phpseclib\Crypt\Base;
use phpseclib\Crypt\RC4; use phpseclib\Crypt\RC4;
use phpseclib\Crypt\Random;
class Unit_Crypt_RC4Test extends PhpseclibTestCase class Unit_Crypt_RC4Test extends PhpseclibTestCase
{ {
@ -239,7 +240,7 @@ class Unit_Crypt_RC4Test extends PhpseclibTestCase
$plaintext = str_repeat('.', 100); $plaintext = str_repeat('.', 100);
for ($keyLen = 5; $keyLen <= 256; $keyLen++) { for ($keyLen = 5; $keyLen <= 256; $keyLen++) {
$key = crypt_random_string($keyLen); $key = Random::string($keyLen);
$objects[0]->setKey($key); $objects[0]->setKey($key);
$ref = $objects[0]->encrypt($plaintext); $ref = $objects[0]->encrypt($plaintext);
for ($i = 1; $i < count($objects); $i++) { for ($i = 1; $i < count($objects); $i++) {