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.



331
332
333
334
# File 'lib/pq_crypto/kem.rb', line 331

def initialize(ciphertext, shared_secret)
  @ciphertext = Internal.binary_string(ciphertext)
  @shared_secret = Internal.binary_string(shared_secret)
end

Instance Attribute Details

#ciphertextObject (readonly)

Returns the value of attribute ciphertext.



329
330
331
# File 'lib/pq_crypto/kem.rb', line 329

def ciphertext
  @ciphertext
end

#shared_secretObject (readonly)

Returns the value of attribute shared_secret.



329
330
331
# File 'lib/pq_crypto/kem.rb', line 329

def shared_secret
  @shared_secret
end

Instance Method Details

#inspectObject



336
337
338
# File 'lib/pq_crypto/kem.rb', line 336

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