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