Class: RubyHome::HAP::Crypto::HKDF
- Inherits:
-
Object
- Object
- RubyHome::HAP::Crypto::HKDF
- Defined in:
- lib/ruby_home/hap/crypto/hkdf.rb
Instance Method Summary collapse
- #encrypt(source) ⇒ Object
-
#initialize(salt:, info:) ⇒ HKDF
constructor
A new instance of HKDF.
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 |