Method: HKDF#_generate_blocks

Defined in:
lib/hkdf.rb

#_generate_blocks(length) ⇒ Object



71
72
73
74
75
76
77
# File 'lib/hkdf.rb', line 71

def _generate_blocks(length)
  start = @blocks.size
  block_count = (length.to_f / @digest.digest_length).ceil
  start.upto(block_count) do |n|
    @blocks << OpenSSL::HMAC.digest(@digest, @prk, @blocks[n - 1] + @info + n.chr)
  end
end