Class: ECHConfig::ECHConfigContents::HpkeKeyConfig::HpkeSymmetricCipherSuite
- Inherits:
-
Object
- Object
- ECHConfig::ECHConfigContents::HpkeKeyConfig::HpkeSymmetricCipherSuite
- Extended by:
- T::Sig
- Defined in:
- lib/ech_config/ech_config_contents/hpke_key_config/hpke_symmetric_cipher_suite.rb,
lib/ech_config/ech_config_contents/hpke_key_config/hpke_symmetric_cipher_suite.rb
Overview
typed: true frozen_string_literal: true
Defined Under Namespace
Classes: HpkeAeadId, HpkeKdfId
Instance Attribute Summary collapse
-
#aead_id ⇒ Object
readonly
Returns the value of attribute aead_id.
-
#kdf_id ⇒ Object
readonly
Returns the value of attribute kdf_id.
Class Method Summary collapse
Instance Method Summary collapse
- #encode ⇒ Object
-
#initialize(kdf_id, aead_id) ⇒ HpkeSymmetricCipherSuite
constructor
A new instance of HpkeSymmetricCipherSuite.
Constructor Details
#initialize(kdf_id, aead_id) ⇒ HpkeSymmetricCipherSuite
Returns a new instance of HpkeSymmetricCipherSuite.
16 17 18 19 |
# File 'lib/ech_config/ech_config_contents/hpke_key_config/hpke_symmetric_cipher_suite.rb', line 16 def initialize(kdf_id, aead_id) @kdf_id = kdf_id @aead_id = aead_id end |
Instance Attribute Details
#aead_id ⇒ Object (readonly)
Returns the value of attribute aead_id.
13 14 15 |
# File 'lib/ech_config/ech_config_contents/hpke_key_config/hpke_symmetric_cipher_suite.rb', line 13 def aead_id @aead_id end |
#kdf_id ⇒ Object (readonly)
Returns the value of attribute kdf_id.
13 14 15 |
# File 'lib/ech_config/ech_config_contents/hpke_key_config/hpke_symmetric_cipher_suite.rb', line 13 def kdf_id @kdf_id end |
Class Method Details
.decode_vectors(octet) ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/ech_config/ech_config_contents/hpke_key_config/hpke_symmetric_cipher_suite.rb', line 27 def self.decode_vectors(octet) i = 0 cipher_suites = [] while i < octet.length raise ::ECHConfig::DecodeError if i + 4 > octet.length kdf_id = HpkeKdfId.decode(octet.slice(i, 2) || '') aead_id = HpkeAeadId.decode(octet.slice(i + 2, 2) || '') i += 4 cipher_suites << new(kdf_id, aead_id) end cipher_suites end |
Instance Method Details
#encode ⇒ Object
22 23 24 |
# File 'lib/ech_config/ech_config_contents/hpke_key_config/hpke_symmetric_cipher_suite.rb', line 22 def encode @kdf_id.encode + @aead_id.encode end |