Skip to content
Browse files

ZendTest\Crypt: bugfix \n for windows

  • Loading branch information...
1 parent c3acfcd commit 22c40bb0338130ce5fb2d77f730f6751de4d09f1 @ThaDafinser committed Oct 28, 2013
Showing with 7 additions and 7 deletions.
  1. +7 −7 tests/ZendTest/Crypt/Key/Derivation/ScryptTest.php
View
14 tests/ZendTest/Crypt/Key/Derivation/ScryptTest.php
@@ -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
@@ -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));
}
/**
@@ -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));
}
@@ -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));
}
/**

0 comments on commit 22c40bb

Please sign in to comment.
Something went wrong with that request. Please try again.