Class: RubyHome::HAP::HKDFEncryption

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

Instance Method Summary collapse

Constructor Details

#initialize(salt:, info:) ⇒ HKDFEncryption

Returns a new instance of HKDFEncryption.



6
7
8
9
# File 'lib/ruby_home/hap/hkdf_encryption.rb', line 6

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

Instance Method Details

#encrypt(source) ⇒ Object



11
12
13
# File 'lib/ruby_home/hap/hkdf_encryption.rb', line 11

def encrypt(source)
  HKDF.new(source, hkdf_opts).next_bytes(BYTE_LENGTH)
end