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

A class of ciphertexts each of which contains a vector of polynomials of length > 1. More...

#include <Ciphertext.hpp>

Public Member Functions

 Ciphertext (const Context &context, bool is_extended=false)
 
ParameterPreset getParameterPreset () const
 
u64 getSize () const
 Get the size of a ciphertext. More...
 
void setSize (u64 size)
 Set the size of a ciphertext. More...
 
void setLogSlots (u64 log_slots)
 Set log(number of slots) of a ciphertext. More...
 
u64 getLogSlots () const
 Get log(number of slots) of a ciphertext. More...
 
u64 getNumberOfSlots () const
 
u64 getCurrentPrime () const
 Get prime of current level. More...
 
Real getCurrentScaleFactor () const
 Get scale factor of current level. More...
 
Polynomial & getPoly (u64 i)
 Get the i-th part of ciphertext. More...
 
const Polynomial & getPoly (u64 i) const
 Get the i-th part of ciphertext. More...
 
u64getPolyData (u64 i, u64 level) const
 Get the level -th data of the i-th part. More...
 
bool isModUp () const
 True if it is a mod-up ciphertext, False otherwise. More...
 
void save (const std::string &path) const
 Save a ciphertext to a file. More...
 
void save (std::ostream &stream) const
 Save a ciphertext. More...
 
void load (const std::string &path)
 Load a ciphertext from a file. More...
 
void load (std::istream &stream)
 Load a ciphertext. More...
 
int getRescaleCounter () const
 Rescaling flag. More...
 
void setRescaleCounter (int r_counter)
 set rescale counter More...
 
u64 getLevel () const
 Get level of a cipherext. More...
 
void setLevel (u64 level)
 Set level of a ciphertext. More...
 
const DevicegetDevice () const
 Get device which a ciphertext reside in. More...
 
void to (const Device &device)
 Send a ciphertext to given device. More...
 
void allocate (const Device &device)
 Allocate memory for a ciphertext at given device. More...
 

Private Member Functions

 Ciphertext (const Context &context, const Ciphertext &ctxt)
 Construct a Ciphertext containing polynomial of same value only valid when the input ciphertext constructed for context sharing primes. More...
 

Private Attributes

Pointer< CiphertextImpl > impl_
 

Friends

class BootstrapperImpl
 

Detailed Description

A class of ciphertexts each of which contains a vector of polynomials of length > 1.

Constructor & Destructor Documentation

◆ Ciphertext() [1/2]

HEaaN::Ciphertext::Ciphertext ( const Context context,
bool  is_extended = false 
)
explicit

◆ Ciphertext() [2/2]

HEaaN::Ciphertext::Ciphertext ( const Context context,
const Ciphertext ctxt 
)
explicitprivate

Construct a Ciphertext containing polynomial of same value only valid when the input ciphertext constructed for context sharing primes.

Member Function Documentation

◆ allocate()

void HEaaN::Ciphertext::allocate ( const Device device)

Allocate memory for a ciphertext at given device.

Parameters
[in]device

◆ getCurrentPrime()

u64 HEaaN::Ciphertext::getCurrentPrime ( ) const

Get prime of current level.

◆ getCurrentScaleFactor()

Real HEaaN::Ciphertext::getCurrentScaleFactor ( ) const

Get scale factor of current level.

◆ getDevice()

const Device& HEaaN::Ciphertext::getDevice ( ) const

Get device which a ciphertext reside in.

Returns
The device in which the ciphertext resides

◆ getLevel()

u64 HEaaN::Ciphertext::getLevel ( ) const

Get level of a cipherext.

Returns
The current level of the ciphertext.

◆ getLogSlots()

u64 HEaaN::Ciphertext::getLogSlots ( ) const

Get log(number of slots) of a ciphertext.

Returns
log(number of slots)

◆ getNumberOfSlots()

u64 HEaaN::Ciphertext::getNumberOfSlots ( ) const

◆ getParameterPreset()

ParameterPreset HEaaN::Ciphertext::getParameterPreset ( ) const

◆ getPoly() [1/2]

Polynomial& HEaaN::Ciphertext::getPoly ( u64  i)

Get the i-th part of ciphertext.

◆ getPoly() [2/2]

const Polynomial& HEaaN::Ciphertext::getPoly ( u64  i) const

Get the i-th part of ciphertext.

◆ getPolyData()

u64* HEaaN::Ciphertext::getPolyData ( u64  i,
u64  level 
) const

Get the level -th data of the i-th part.

the level -th data is a modulo q_{level} information of the polynomial

◆ getRescaleCounter()

int HEaaN::Ciphertext::getRescaleCounter ( ) const

Rescaling flag.

Returns
The amount of extra deltas multiplied.

◆ getSize()

u64 HEaaN::Ciphertext::getSize ( ) const

Get the size of a ciphertext.

◆ isModUp()

bool HEaaN::Ciphertext::isModUp ( ) const

True if it is a mod-up ciphertext, False otherwise.

◆ load() [1/2]

void HEaaN::Ciphertext::load ( const std::string &  path)

Load a ciphertext from a file.

◆ load() [2/2]

void HEaaN::Ciphertext::load ( std::istream &  stream)

Load a ciphertext.

◆ save() [1/2]

void HEaaN::Ciphertext::save ( const std::string &  path) const

Save a ciphertext to a file.

◆ save() [2/2]

void HEaaN::Ciphertext::save ( std::ostream &  stream) const

Save a ciphertext.

◆ setLevel()

void HEaaN::Ciphertext::setLevel ( u64  level)

Set level of a ciphertext.

Parameters
[in]level

◆ setLogSlots()

void HEaaN::Ciphertext::setLogSlots ( u64  log_slots)

Set log(number of slots) of a ciphertext.

Parameters
[in]log_slots

◆ setRescaleCounter()

void HEaaN::Ciphertext::setRescaleCounter ( int  r_counter)

set rescale counter

◆ setSize()

void HEaaN::Ciphertext::setSize ( u64  size)

Set the size of a ciphertext.

Exceptions
ifthe size is less than 2.

◆ to()

void HEaaN::Ciphertext::to ( const Device device)

Send a ciphertext to given device.

Parameters
[in]device

Friends And Related Function Documentation

◆ BootstrapperImpl

friend class BootstrapperImpl
friend

Member Data Documentation

◆ impl_

Pointer<CiphertextImpl> HEaaN::Ciphertext::impl_
private

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