public abstract class SymmetricKeyKEM extends java.lang.Object implements KeyEncapsulationMechanism<SymmetricKey>
KeyEncapsulationMechanism providing KeyMaterial and
a KeyDerivationFunction that derives a SymmetricKey from the KeyMaterial produced by the KEM.
This should be used in combination with an symmetric encryption scheme to implement the standard hybrid encryption technique.
KeyEncapsulationMechanism.KeyAndCiphertext<T>| Modifier and Type | Field and Description |
|---|---|
protected KeyDerivationFunction<? extends SymmetricKey> |
kdf
KDF that derives a symmetric key from the key material generated by
kem |
protected KeyEncapsulationMechanism<? extends KeyMaterial> |
kem
Underlying KEM that generates the key material of this KEM.
|
| Constructor and Description |
|---|
SymmetricKeyKEM(KeyEncapsulationMechanism<? extends KeyMaterial> kem,
KeyDerivationFunction<? extends SymmetricKey> kdf) |
SymmetricKeyKEM(org.cryptimeleon.math.serialization.Representation repr) |
| 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. |
boolean |
equals(java.lang.Object o) |
KeyDerivationFunction<? extends SymmetricKey> |
getKdf() |
KeyEncapsulationMechanism<? extends KeyMaterial> |
getKem() |
org.cryptimeleon.math.serialization.Representation |
getRepresentation() |
int |
hashCode() |
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, finalize, getClass, notify, notifyAll, toString, wait, wait, waitrestoreFromRepresentationprotected KeyEncapsulationMechanism<? extends KeyMaterial> kem
protected KeyDerivationFunction<? extends SymmetricKey> kdf
kempublic SymmetricKeyKEM(KeyEncapsulationMechanism<? extends KeyMaterial> kem, KeyDerivationFunction<? extends SymmetricKey> kdf)
public SymmetricKeyKEM(org.cryptimeleon.math.serialization.Representation repr)
public KeyEncapsulationMechanism.KeyAndCiphertext<SymmetricKey> encaps(EncryptionKey pk)
pk.
The result is (key, encapsulatedKey).
It basically outputs the derived key from the key material given by the KEM's encaps and the corresponding encapsulation.
encaps in interface KeyEncapsulationMechanism<SymmetricKey>pk - public key used for encrypting kpublic SymmetricKey decaps(CipherText encapsulatedKey, DecryptionKey sk)
encaps() and decrypts it with sk.
That is, if (key, encapsulatedKey) = encaps(pk), then decrypt(encapsulatedKey, sk) == key.
It outputs the image of the kdf on the decapsulation of the given encapsulatedKey.
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>public KeyEncapsulationMechanism<? extends KeyMaterial> getKem()
public KeyDerivationFunction<? extends SymmetricKey> getKdf()
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic org.cryptimeleon.math.serialization.Representation getRepresentation()
getRepresentation in interface org.cryptimeleon.math.serialization.Representable