Class: PQCrypto::KEM::EncapsulationResult

Inherits:
Object
  • Object
show all
Defined in:
lib/pq_crypto/kem.rb

Direct Known Subclasses

HybridKEM::EncapsulationResult

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ciphertext, shared_secret) ⇒ EncapsulationResult

Returns a new instance of EncapsulationResult.



296
297
298
299
# File 'lib/pq_crypto/kem.rb', line 296

def initialize(ciphertext, shared_secret)
  @ciphertext = String(ciphertext).b
  @shared_secret = String(shared_secret).b
end

Instance Attribute Details

#ciphertextObject (readonly)

Returns the value of attribute ciphertext.



294
295
296
# File 'lib/pq_crypto/kem.rb', line 294

def ciphertext
  @ciphertext
end

#shared_secretObject (readonly)

Returns the value of attribute shared_secret.



294
295
296
# File 'lib/pq_crypto/kem.rb', line 294

def shared_secret
  @shared_secret
end

Instance Method Details

#inspectObject



301
302
303
# File 'lib/pq_crypto/kem.rb', line 301

def inspect
  "#<#{self.class}:0x#{object_id.to_s(16)} ciphertext_bytes=#{@ciphertext.bytesize} shared_secret_bytes=#{@shared_secret.bytesize}>"
end