mirror of
https://github.com/danog/phpseclib.git
synced 2024-11-30 04:39:21 +01:00
Tests: crypt_random_string -> Random::string
This commit is contained in:
parent
ac2b7ef76c
commit
062ee6b5b5
@ -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++) {
|
||||||
|
@ -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++) {
|
||||||
|
Loading…
Reference in New Issue
Block a user