Skip to content

Commit

Permalink
Merge pull request #19 from emboss/master
Browse files Browse the repository at this point in the history
Reset digest instance before generating derived bytes
  • Loading branch information
emboss committed Jan 20, 2013
2 parents b2cda46 + 862ec8a commit ba3e311
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/krypt/pkcs5/pbkdf2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def initialize(digest)
def generate(pwd, salt, iter, outlen)
raise "outlen too large" if outlen > MAX_FACTOR * @block_size

@digest.reset
num_blocks = (outlen.to_f / @block_size).ceil
# enforces ASCII-8BIT
String.new.tap do |result|
Expand Down

0 comments on commit ba3e311

Please sign in to comment.