Class: Ccrypto::Java::CrystalKyberKEM

Inherits:
Object
  • Object
show all
Includes:
DataConversion, TR::CondUtils
Defined in:
lib/ccrypto/java/engines/crystal_kyber_engine.rb

Overview

class CrystalKyberPrivateKey

Instance Method Summary collapse

Methods included from DataConversion

#from_b64, #from_b64_mime, #from_hex, included, #logger, #to_b64, #to_b64_mime, #to_bin, #to_hex, #to_java_bytes, #to_str

Constructor Details

#initialize(kem) ⇒ CrystalKyberKEM

Returns a new instance of CrystalKyberKEM.

Raises:

  • (KeypairEngineException)


130
131
132
133
# File 'lib/ccrypto/java/engines/crystal_kyber_engine.rb', line 130

def initialize(kem)
  @kem = kem
  raise KeypairEngineException, "KEM cannot be empty" if is_empty?(@kem)
end

Instance Method Details

#for_cipherObject



139
140
141
# File 'lib/ccrypto/java/engines/crystal_kyber_engine.rb', line 139

def for_cipher
  @kem.getSecret()
end

#for_recipientObject



135
136
137
# File 'lib/ccrypto/java/engines/crystal_kyber_engine.rb', line 135

def for_recipient
  @kem.getEncapsulation() 
end

#nativeObject



143
144
145
# File 'lib/ccrypto/java/engines/crystal_kyber_engine.rb', line 143

def native
  @kem
end