public abstract class AbstractHybridConstructionKEM extends java.lang.Object implements KeyEncapsulationMechanism<SymmetricKey>
encaps(EncryptionKey) by generating a random key and encrypting it afterwards
with some encryption scheme.
Implementations of this abstract class need to define how to generate random plaintexts for the encryption scheme and how to derive a secret key (for a symmetric scheme) from the random plaintext (key derivation function).
KeyEncapsulationMechanism.KeyAndCiphertext<T>| Modifier and Type | Field and Description |
|---|---|
protected KeyDerivationFunction<? extends SymmetricKey> |
kdf |
protected EncryptionScheme |
scheme |
| Constructor and Description |
|---|
AbstractHybridConstructionKEM(EncryptionScheme scheme,
KeyDerivationFunction<? extends SymmetricKey> kdf) |
| Modifier and Type | Method and Description |
|---|---|
SymmetricKey |
decaps(CipherText encapsulatedKey,
DecryptionKey sk)
Takes an encapsulated key that was created by
encaps() and decrypts it with sk. |
KeyEncapsulationMechanism.KeyAndCiphertext<SymmetricKey> |
encaps(EncryptionKey pk)
Randomly chooses a key k and encrypts it using the given
pk. |
protected abstract PlainText |
generateRandomPlaintext()
Generates random plaintexts for the underlying scheme.
|
protected abstract int |
getPlaintextMinEntropyInBit()
Returns the min entropy, of generateRandomPlaintext i.e.
|
DecryptionKey |
restoreDecapsulationKey(org.cryptimeleon.math.serialization.Representation repr) |
CipherText |
restoreEncapsulatedKey(org.cryptimeleon.math.serialization.Representation repr) |
EncryptionKey |
restoreEncapsulationKey(org.cryptimeleon.math.serialization.Representation repr) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitrestoreFromRepresentationprotected EncryptionScheme scheme
protected KeyDerivationFunction<? extends SymmetricKey> kdf
public AbstractHybridConstructionKEM(EncryptionScheme scheme, KeyDerivationFunction<? extends SymmetricKey> kdf)
protected abstract PlainText generateRandomPlaintext()
protected abstract int getPlaintextMinEntropyInBit()
(if you choose uniformly random among n plaintexts, it's just floor(log2(n)))
public KeyEncapsulationMechanism.KeyAndCiphertext<SymmetricKey> encaps(EncryptionKey pk)
KeyEncapsulationMechanismpk.
The result is (key, encapsulatedKey).encaps in interface KeyEncapsulationMechanism<SymmetricKey>pk - public key used for encrypting kpublic SymmetricKey decaps(CipherText encapsulatedKey, DecryptionKey sk)
KeyEncapsulationMechanismencaps() and decrypts it with sk.
That is, if (key, encapsulatedKey) = encaps(pk), then decrypt(encapsulatedKey, sk) == key.decaps in interface KeyEncapsulationMechanism<SymmetricKey>public CipherText restoreEncapsulatedKey(org.cryptimeleon.math.serialization.Representation repr)
restoreEncapsulatedKey in interface KeyEncapsulationMechanism<SymmetricKey>public EncryptionKey restoreEncapsulationKey(org.cryptimeleon.math.serialization.Representation repr)
restoreEncapsulationKey in interface KeyEncapsulationMechanism<SymmetricKey>public DecryptionKey restoreDecapsulationKey(org.cryptimeleon.math.serialization.Representation repr)
restoreDecapsulationKey in interface KeyEncapsulationMechanism<SymmetricKey>