Class: RubyHome::HAP::Crypto::HKDF

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_home/hap/crypto/hkdf.rb

Instance Method Summary collapse

Constructor Details

#initialize(salt:, info:) ⇒ HKDF

Returns a new instance of HKDF.



7
8
9
10
# File 'lib/ruby_home/hap/crypto/hkdf.rb', line 7

def initialize(salt:, info: )
  @salt = salt
  @info = info
end

Instance Method Details

#encrypt(source) ⇒ Object



12
13
14
15
# File 'lib/ruby_home/hap/crypto/hkdf.rb', line 12

def encrypt(source)
  byte_string = convert_string_to_byte_string(source)
  GEM_HKDF.new(byte_string, hkdf_opts).next_bytes(BYTE_LENGTH)
end