Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
ircmaxell committed Mar 25, 2011
1 parent 4650310 commit c4adf06
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/CryptLib/Password/Implementation/PBKDF.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public function __construct(
$this->size = $size < 40 ? 40 : (int) $size;
$this->iterations = $iterations > 0 ? (int) $iterations : 1;
if (is_null($generator)) {
$factory = new RandomFactory;
$factory = new RandomFactory;
$generator = $factory->getMediumStrengthGenerator();
}
$this->generator = $generator;
Expand All @@ -129,10 +129,10 @@ public function __construct(
* @return string The formatted password hash
*/
public function create($password) {
$size = $this->size - 8; // remove size of stored bits
$saltSize = floor($size / 5); //Use 20% of the size for the salt
$hashSize = $size - $saltSize;
$salt = $this->generator->generate($saltSize);
$size = $this->size - 8; // remove size of stored bits
$saltSize = floor($size / 5); //Use 20% of the size for the salt
$hashSize = $size - $saltSize;
$salt = $this->generator->generate($saltSize);
return $this->hash($password, $salt, $this->iterations, $hashSize);
}

Expand Down

0 comments on commit c4adf06

Please sign in to comment.