HEaaN
Crypto Lab's great homomorphic encryption library
Public Member Functions | Private Attributes | List of all members
HEaaN::Decryptor Class Reference

Abstract entity for decrypting ciphertexts. More...

#include <Decryptor.hpp>

Public Member Functions

 Decryptor (const Context &context)
 
void decrypt (const Ciphertext &ctxt, const SecretKey &sk, Message &msg) const
 Decrypt a ciphertext to message using a secret key. More...
 
void decrypt (const Ciphertext &ctxt, const SecretKey &sk, Plaintext &ptxt) const
 Decrypt a ciphertext to plaintext using a secret key. More...
 
void partialDecrypt (const Ciphertext &ctxt, const SecretKey &sk, Ciphertext &ctxt_out) const
 Partially decrypt a ciphertext, which is encrypted with a collectively generated encryption key, to another ciphertext using a secret key, generated by one of the parties. More...
 

Private Attributes

const Context context_
 A context with which decryptor is associated. More...
 

Detailed Description

Abstract entity for decrypting ciphertexts.

Constructor & Destructor Documentation

◆ Decryptor()

HEaaN::Decryptor::Decryptor ( const Context context)
explicit

Member Function Documentation

◆ decrypt() [1/2]

void HEaaN::Decryptor::decrypt ( const Ciphertext ctxt,
const SecretKey sk,
Message msg 
) const

Decrypt a ciphertext to message using a secret key.

Parameters
[in]ctxt
[in]sk
[out]msg

◆ decrypt() [2/2]

void HEaaN::Decryptor::decrypt ( const Ciphertext ctxt,
const SecretKey sk,
Plaintext ptxt 
) const

Decrypt a ciphertext to plaintext using a secret key.

Parameters
[in]ctxt
[in]sk
[out]ptxt

It sets the parameters of plaintext automatically. You may use any constructor of plaintext.

◆ partialDecrypt()

void HEaaN::Decryptor::partialDecrypt ( const Ciphertext ctxt,
const SecretKey sk,
Ciphertext ctxt_out 
) const

Partially decrypt a ciphertext, which is encrypted with a collectively generated encryption key, to another ciphertext using a secret key, generated by one of the parties.

Parameters
[in]ctxt
[in]sk
[out]ctxt_out

It sets the parameters of ciphertext automatically. You may use any constructor of ciphertext. ctxt should be encrypted with an encryption key which is generated by collective key generation. If ctxt is encrypted for the set of secret keys {sk_1 , ... , sk_n} and sk is one of the secret keys, ctxt_out is a ciphertext encrypted for the set of secret keys {sk_1, ... , sk_n} - {sk}. The parties of collective key generation may sequentially call partialDecrypt to decrypt the ciphertext. The last party may receive a ciphertext encrypted with a single sk_i, and call decrypt to get the decrypted plaintext.

Exceptions
RuntimeExceptionif the size of input ciphertext is not 2.

Member Data Documentation

◆ context_

const Context HEaaN::Decryptor::context_
private

A context with which decryptor is associated.


The documentation for this class was generated from the following file: