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

A class of plaintexts each of which is simply a polynomial. More...

#include <Plaintext.hpp>

Public Member Functions

 Plaintext (const Context &context)
 
void setLogSlots (u64 log_slots)
 Set log(number of slots) of a plaintext. More...
 
u64 getLogSlots () const
 Get log(number of slots) of a plaintext. More...
 
u64 getNumberOfSlots () const
 Get number of slots of a plaintext. More...
 
Polynomial & getMx ()
 Get polynomial representing plaintext. More...
 
const Polynomial & getMx () const
 Get const polynomial representing plaintext. More...
 
u64getMxData (u64 i) const
 Get i-th data of a plaintext. More...
 
void save (const std::string &path) const
 Save a plaintext to a file. More...
 
void save (std::ostream &stream) const
 Save a plaintext. More...
 
void load (const std::string &path)
 Load a plaintext from a file. More...
 
void load (std::istream &stream)
 Load a plaintext. More...
 
int getRescaleCounter () const
 Rescaling flag. More...
 
void setRescaleCounter (int r_counter)
 set rescale counter More...
 
u64 getLevel () const
 Get level of a plaintext. More...
 
void setLevel (u64 level)
 Set level of a plaintext. More...
 
const DevicegetDevice () const
 Get device which a plaintext reside in. More...
 
void to (const Device &device)
 Send a plaintext to given device. More...
 
void allocate (const Device &device)
 Allocate memory for a plaintext at given device. More...
 
bool isZero () const
 Check whether a plaintext has the zero polynomial. More...
 

Private Attributes

Pointer< PlaintextImpl > impl_
 

Detailed Description

A class of plaintexts each of which is simply a polynomial.

Constructor & Destructor Documentation

◆ Plaintext()

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

Member Function Documentation

◆ allocate()

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

Allocate memory for a plaintext at given device.

Parameters
[in]device

◆ getDevice()

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

Get device which a plaintext reside in.

Returns
The device in which the plaintext resides

◆ getLevel()

u64 HEaaN::Plaintext::getLevel ( ) const

Get level of a plaintext.

Returns
The current level of the plaintext.

◆ getLogSlots()

u64 HEaaN::Plaintext::getLogSlots ( ) const

Get log(number of slots) of a plaintext.

Returns
log(number of slots)

◆ getMx() [1/2]

Polynomial& HEaaN::Plaintext::getMx ( )

Get polynomial representing plaintext.

◆ getMx() [2/2]

const Polynomial& HEaaN::Plaintext::getMx ( ) const

Get const polynomial representing plaintext.

◆ getMxData()

u64* HEaaN::Plaintext::getMxData ( u64  i) const

Get i-th data of a plaintext.

i-th data is a modulo q_i information of the polynomial

◆ getNumberOfSlots()

u64 HEaaN::Plaintext::getNumberOfSlots ( ) const

Get number of slots of a plaintext.

Returns
number of slots

◆ getRescaleCounter()

int HEaaN::Plaintext::getRescaleCounter ( ) const

Rescaling flag.

Returns
The amount of extra deltas multiplied.

◆ isZero()

bool HEaaN::Plaintext::isZero ( ) const

Check whether a plaintext has the zero polynomial.

◆ load() [1/2]

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

Load a plaintext from a file.

◆ load() [2/2]

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

Load a plaintext.

◆ save() [1/2]

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

Save a plaintext to a file.

◆ save() [2/2]

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

Save a plaintext.

◆ setLevel()

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

Set level of a plaintext.

Parameters
[in]level

◆ setLogSlots()

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

Set log(number of slots) of a plaintext.

Parameters
[in]log_slots

◆ setRescaleCounter()

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

set rescale counter

◆ to()

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

Send a plaintext to given device.

Parameters
[in]device

Member Data Documentation

◆ impl_

Pointer<PlaintextImpl> HEaaN::Plaintext::impl_
private

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