T - type of the encapsulated keypublic interface KeyEncapsulationMechanism<T>
extends org.cryptimeleon.math.serialization.StandaloneRepresentable, org.cryptimeleon.math.serialization.annotations.RepresentationRestorer
The usual use case is:
encaps(EncryptionKey) with the public key of the receiver to get a random symmetric key k
and an encrypted version c
decaps(CipherText, DecryptionKey) on c and their secret decryption key,
which yields k
| Modifier and Type | Interface and Description |
|---|---|
static class |
KeyEncapsulationMechanism.KeyAndCiphertext<T> |
| Modifier and Type | Method and Description |
|---|---|
T |
decaps(CipherText encapsulatedKey,
DecryptionKey sk)
Takes an encapsulated key that was created by
encaps() and decrypts it with sk. |
KeyEncapsulationMechanism.KeyAndCiphertext<T> |
encaps(EncryptionKey pk)
Randomly chooses a key k and encrypts it using the given
pk. |
DecryptionKey |
restoreDecapsulationKey(org.cryptimeleon.math.serialization.Representation repr) |
CipherText |
restoreEncapsulatedKey(org.cryptimeleon.math.serialization.Representation repr) |
EncryptionKey |
restoreEncapsulationKey(org.cryptimeleon.math.serialization.Representation repr) |
default java.lang.Object |
restoreFromRepresentation(java.lang.reflect.Type type,
org.cryptimeleon.math.serialization.Representation repr) |
KeyEncapsulationMechanism.KeyAndCiphertext<T> encaps(EncryptionKey pk)
pk.
The result is (key, encapsulatedKey).pk - public key used for encrypting kT decaps(CipherText encapsulatedKey, DecryptionKey sk) throws java.lang.IllegalArgumentException
encaps() and decrypts it with sk.
That is, if (key, encapsulatedKey) = encaps(pk), then decrypt(encapsulatedKey, sk) == key.java.lang.IllegalArgumentExceptionCipherText restoreEncapsulatedKey(org.cryptimeleon.math.serialization.Representation repr)
EncryptionKey restoreEncapsulationKey(org.cryptimeleon.math.serialization.Representation repr)
DecryptionKey restoreDecapsulationKey(org.cryptimeleon.math.serialization.Representation repr)
default java.lang.Object restoreFromRepresentation(java.lang.reflect.Type type,
org.cryptimeleon.math.serialization.Representation repr)
restoreFromRepresentation in interface org.cryptimeleon.math.serialization.annotations.RepresentationRestorer