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.



205
206
207
208
# File 'lib/pq_crypto/kem.rb', line 205

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.



203
204
205
# File 'lib/pq_crypto/kem.rb', line 203

def ciphertext
  @ciphertext
end

#shared_secretObject (readonly)

Returns the value of attribute shared_secret.



203
204
205
# File 'lib/pq_crypto/kem.rb', line 203

def shared_secret
  @shared_secret
end

Instance Method Details

#inspectObject



210
211
212
# File 'lib/pq_crypto/kem.rb', line 210

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