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

Abstract entity for encrypting messages into ciphertexts. More...

#include <Encryptor.hpp>

Public Member Functions

 Encryptor (const Context &context)
 
void encrypt (const Message &msg, const SecretKey &sk, Ciphertext &ctxt) const
 Encrypt a message using a secret key, to the maximal supported level, to rescale counter zero. More...
 
void encrypt (const Message &msg, const SecretKey &sk, Ciphertext &ctxt, u64 level, int r_counter=0) const
 Encrypt a message using a secret key, to a certain level, to a certain rescale counter. More...
 
void encrypt (const Message &msg, const KeyPack &keypack, Ciphertext &ctxt) const
 Encrypt a message using a keypack (Public key encryption), to the maximal supported level, to rescale counter zero. More...
 
void encrypt (const Message &msg, const KeyPack &keypack, Ciphertext &ctxt, u64 level, int r_counter=0) const
 Encrypt a message using a keypack (Public key encryption), to a certain level, to a certain rescale counter. More...
 
void encrypt (const Plaintext &ptxt, const SecretKey &sk, Ciphertext &ctxt) const
 Encrypt a plaintext using a secret key. More...
 
void encrypt (const Plaintext &ptxt, const KeyPack &keypack, Ciphertext &ctxt) const
 Encrypt a plaintext using an encryption key. More...
 

Private Attributes

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

Detailed Description

Abstract entity for encrypting messages into ciphertexts.

Constructor & Destructor Documentation

◆ Encryptor()

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

Member Function Documentation

◆ encrypt() [1/6]

void HEaaN::Encryptor::encrypt ( const Message msg,
const KeyPack keypack,
Ciphertext ctxt 
) const

Encrypt a message using a keypack (Public key encryption), to the maximal supported level, to rescale counter zero.

Parameters
[in]msg
[in]keypack
[out]ctxt
Exceptions
RuntimeExceptionif msg and key are at different devices.

◆ encrypt() [2/6]

void HEaaN::Encryptor::encrypt ( const Message msg,
const KeyPack keypack,
Ciphertext ctxt,
u64  level,
int  r_counter = 0 
) const

Encrypt a message using a keypack (Public key encryption), to a certain level, to a certain rescale counter.

Parameters
[in]msg
[in]keypack
[in]level
[in]r_counter
[out]ctxt
Exceptions
RuntimeExceptionif msg and key are at different devices.

◆ encrypt() [3/6]

void HEaaN::Encryptor::encrypt ( const Message msg,
const SecretKey sk,
Ciphertext ctxt 
) const

Encrypt a message using a secret key, to the maximal supported level, to rescale counter zero.

Parameters
[in]msg
[in]sk
[out]ctxt
Exceptions
RuntimeExceptionif msg and key are at different devices.

◆ encrypt() [4/6]

void HEaaN::Encryptor::encrypt ( const Message msg,
const SecretKey sk,
Ciphertext ctxt,
u64  level,
int  r_counter = 0 
) const

Encrypt a message using a secret key, to a certain level, to a certain rescale counter.

Parameters
[in]msg
[in]sk
[in]level
[in]r_counter
[out]ctxt
Exceptions
RuntimeExceptionif msg and key are at different devices.

◆ encrypt() [5/6]

void HEaaN::Encryptor::encrypt ( const Plaintext ptxt,
const KeyPack keypack,
Ciphertext ctxt 
) const

Encrypt a plaintext using an encryption key.

compute (va + e_1, vb + e_2 + m) where (a, b) = (a, -as + e_0) is an encryption key

Exceptions
RuntimeExceptionif ptxt and key are at different devices.

◆ encrypt() [6/6]

void HEaaN::Encryptor::encrypt ( const Plaintext ptxt,
const SecretKey sk,
Ciphertext ctxt 
) const

Encrypt a plaintext using a secret key.

compute (a, -as + e + m)

Exceptions
RuntimeExceptionif ptxt and key are at different devices.

Member Data Documentation

◆ context_

const Context HEaaN::Encryptor::context_
private

A context with which Encryptor is associated.


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