Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Commit

Permalink
Merge branch 'hotfix/5369' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions test/Key/Derivation/ScryptTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ public function testVectorSalsa208Core()
}
$salsa20 = self::getMethod($salsaAlg);
$obj = $this->getMockForAbstractClass('Zend\Crypt\Key\Derivation\Scrypt');
$input = self::hex2bin(str_replace(array(' ',"\n"),'',$hexInput));
$input = self::hex2bin(str_replace(array(' ',PHP_EOL),'',$hexInput));
$result = $salsa20->invokeArgs($obj, array($input));

$this->assertEquals(64, strlen($input), 'Input must be a string of 64 bytes');
$this->assertEquals(64, strlen($result), 'Output must be a string of 64 bytes');
$this->assertEquals(str_replace(array(' ',"\n"),'',$hexOutput), bin2hex($result));
$this->assertEquals(str_replace(array(' ',PHP_EOL),'',$hexOutput), bin2hex($result));
}
/**
* Test vector of Scrypt BlockMix
Expand Down Expand Up @@ -85,10 +85,10 @@ public function testVectorScryptBlockMix()

$blockMix = self::getMethod('scryptBlockMix');
$obj = $this->getMockForAbstractClass('Zend\Crypt\Key\Derivation\Scrypt');
$input = self::hex2bin(str_replace(array(' ',"\n"), '', $hexInput));
$input = self::hex2bin(str_replace(array(' ',PHP_EOL), '', $hexInput));
$result = $blockMix->invokeArgs($obj, array($input, 1));

$this->assertEquals(str_replace(array(' ',"\n"),'',$hexOutput), bin2hex($result));
$this->assertEquals(str_replace(array(' ',PHP_EOL),'',$hexOutput), bin2hex($result));
}

/**
Expand Down Expand Up @@ -119,10 +119,10 @@ public function testVectorScryptROMix()

$roMix = self::getMethod('scryptROMix');
$obj = $this->getMockForAbstractClass('Zend\Crypt\Key\Derivation\Scrypt');
$input = self::hex2bin(str_replace(array(' ',"\n"), '', $hexInput));
$input = self::hex2bin(str_replace(array(' ',PHP_EOL), '', $hexInput));
$result = $roMix->invokeArgs($obj, array($input, 16, 1));

$this->assertEquals(str_replace(array(' ',"\n"),'',$hexOutput), bin2hex($result));
$this->assertEquals(str_replace(array(' ',PHP_EOL),'',$hexOutput), bin2hex($result));
}


Expand All @@ -140,7 +140,7 @@ public function testVectorScrypt()

$result = Scrypt::calc('', '', 16, 1, 1, 64);
$this->assertEquals(64, strlen($result));
$this->assertEquals(str_replace(array(' ',"\n"),'',$hexOutput), bin2hex($result));
$this->assertEquals(str_replace(array(' ',PHP_EOL),'',$hexOutput), bin2hex($result));
}

/**
Expand Down

0 comments on commit 45ca30c

Please sign in to comment.