Class: ECHConfig::ECHConfigContents::HpkeKeyConfig::HpkeSymmetricCipherSuite::HpkeKdfId
- Inherits:
-
Object
- Object
- ECHConfig::ECHConfigContents::HpkeKeyConfig::HpkeSymmetricCipherSuite::HpkeKdfId
- Extended by:
- T::Sig
- Defined in:
- lib/ech_config/ech_config_contents/hpke_key_config/hpke_symmetric_cipher_suite/hpke_kdf_id.rb
Overview
typed: false frozen_string_literal: true
Instance Attribute Summary collapse
-
#uint16 ⇒ Object
readonly
Returns the value of attribute uint16.
Class Method Summary collapse
Instance Method Summary collapse
- #==(other) ⇒ Object
- #encode ⇒ Object
-
#initialize(uint16) ⇒ HpkeKdfId
constructor
A new instance of HpkeKdfId.
Constructor Details
#initialize(uint16) ⇒ HpkeKdfId
Returns a new instance of HpkeKdfId.
8 9 10 |
# File 'lib/ech_config/ech_config_contents/hpke_key_config/hpke_symmetric_cipher_suite/hpke_kdf_id.rb', line 8 def initialize(uint16) @uint16 = uint16 end |
Instance Attribute Details
#uint16 ⇒ Object (readonly)
Returns the value of attribute uint16.
6 7 8 |
# File 'lib/ech_config/ech_config_contents/hpke_key_config/hpke_symmetric_cipher_suite/hpke_kdf_id.rb', line 6 def uint16 @uint16 end |
Class Method Details
.decode(octet) ⇒ Object
23 24 25 26 27 |
# File 'lib/ech_config/ech_config_contents/hpke_key_config/hpke_symmetric_cipher_suite/hpke_kdf_id.rb', line 23 def self.decode(octet) raise ::ECHConfig::DecodeError if octet.length != 2 new(octet.unpack1('n')) end |
Instance Method Details
#==(other) ⇒ Object
18 19 20 |
# File 'lib/ech_config/ech_config_contents/hpke_key_config/hpke_symmetric_cipher_suite/hpke_kdf_id.rb', line 18 def ==(other) other.uint16 == @uint16 end |
#encode ⇒ Object
13 14 15 |
# File 'lib/ech_config/ech_config_contents/hpke_key_config/hpke_symmetric_cipher_suite/hpke_kdf_id.rb', line 13 def encode [@uint16].pack('n') end |