From 466629a39953311f069093bd5a86fd0f4cb10c19 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Sun, 12 Aug 2018 10:01:13 -0500 Subject: [PATCH] Use a high-strength generator by default, when using RandomLibAdapter --- src/Generator/RandomLibAdapter.php | 4 ++-- tests/Generator/RandomLibAdapterTest.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Generator/RandomLibAdapter.php b/src/Generator/RandomLibAdapter.php index 15be9ee..5aa0e88 100644 --- a/src/Generator/RandomLibAdapter.php +++ b/src/Generator/RandomLibAdapter.php @@ -33,7 +33,7 @@ class RandomLibAdapter implements RandomGeneratorInterface /** * Constructs a `RandomLibAdapter` using a `RandomLib\Generator` * - * By default, if no `Generator` is passed in, this creates a medium-strength + * By default, if no `Generator` is passed in, this creates a high-strength * generator to use when generating random binary data. * * @param Generator $generator An paragonie/random-lib `Generator` @@ -45,7 +45,7 @@ class RandomLibAdapter implements RandomGeneratorInterface if ($this->generator === null) { $factory = new Factory(); - $this->generator = $factory->getMediumStrengthGenerator(); + $this->generator = $factory->getHighStrengthGenerator(); } } diff --git a/tests/Generator/RandomLibAdapterTest.php b/tests/Generator/RandomLibAdapterTest.php index b28ecba..9e0da77 100644 --- a/tests/Generator/RandomLibAdapterTest.php +++ b/tests/Generator/RandomLibAdapterTest.php @@ -20,7 +20,7 @@ class RandomLibAdapterTest extends TestCase public function testAdapterWithGeneratorDoesNotCreateGenerator() { $factory = Mockery::mock('overload:RandomLib\Factory'); - $factory->shouldNotReceive('getMediumStrengthGenerator') + $factory->shouldNotReceive('getHighStrengthGenerator') ->getMock(); $generator = $this->getMockBuilder('RandomLib\Generator') @@ -36,7 +36,7 @@ class RandomLibAdapterTest extends TestCase public function testAdapterWithoutGeneratorGreatesGenerator() { $factory = Mockery::mock('overload:RandomLib\Factory'); - $factory->shouldReceive('getMediumStrengthGenerator') + $factory->shouldReceive('getHighStrengthGenerator') ->once() ->getMock();