Skip to content

Commit

Permalink
Reset digest instance before generating derived bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
emboss committed Jan 20, 2013
1 parent 63ac28a commit 862ec8a
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 862ec8a

Please sign in to comment.