Search Results

A class for encoding, encrypting, decoding, and decrypting a CipherMatrix. More...

#include <CipherMatrixEncoder.h>

Public Member Functions

 CipherMatrixEncoder (HeContext &he)
Constructs a ready to use object. More...
 
 CipherMatrixEncoder (const CipherMatrixEncoder &src)=delete
Copy constructor deleted. Construct new objects when needed.
 
CipherMatrixEncoderoperator= (const CipherMatrixEncoder &src)=delete
Assignment deleted. Construct new objects when needed.
 
EncodergetEncoder ()
Returns a reference to the basic encoder used by the CipherMatrixEncoder.
 
void encodeEncrypt (CipherMatrix &res, const boost::numeric::ublas::tensor< double > &vals, int chainIndex=-1) const
Encode and encrypt a 3d array of doubles. More...
 
void encodeEncrypt (CipherMatrix &res, const boost::numeric::ublas::tensor< std::complex< double >> &vals, int chainIndex=-1) const
Encode and encrypt a 3d array of complex numbers. More...
 
boost::numeric::ublas::tensor< double > decryptDecodeDouble (const CipherMatrix &src) const
Decrypt and decode a given CipherMatrix to a 3d tensor of double numbers. More...
 
boost::numeric::ublas::tensor< std::complex< double > > decryptDecodeComplex (const CipherMatrix &src) const
Decrypt and decode a given CipherMatrix to a 3d tensor of complex numbers. More...
 

Detailed Description

A class for encoding, encrypting, decoding, and decrypting a CipherMatrix.

Encrypting raw plain data in HE involves two stages: encode and encrypt. Similary, the opposite direction involes decrypt and decode.

This class performs both steps in each direction, encoding and encrypting a plain matrix to a CipherMatrix, and vice versa.

The plain values are represented using boost::numeric::ublas::tensor with element values that are either double or complex.

Constructor & Destructor Documentation

◆ CipherMatrixEncoder()

helayers::CipherMatrixEncoder::CipherMatrixEncoder ( HeContext he)

Constructs a ready to use object.

Parameters
[in]hethe underlying context.

Member Function Documentation

◆ decryptDecodeComplex()

tensor< complex< double > > helayers::CipherMatrixEncoder::decryptDecodeComplex ( const CipherMatrix src) const

Decrypt and decode a given CipherMatrix to a 3d tensor of complex numbers.

Parameters
[in]srcinput CipherMatrix

◆ decryptDecodeDouble()

tensor< double > helayers::CipherMatrixEncoder::decryptDecodeDouble ( const CipherMatrix src) const

Decrypt and decode a given CipherMatrix to a 3d tensor of double numbers.

Only the real part is retreived.

Parameters
[in]srcinput CipherMatrix

◆ encodeEncrypt() [1/2]

void helayers::CipherMatrixEncoder::encodeEncrypt ( CipherMatrix res,
const boost::numeric::ublas::tensor< double > &  vals,
int  chainIndex = -1 
) const

Encode and encrypt a 3d array of doubles.

Parameters
[out]resobject to contain encrypted matrix.
[in]valsa 3d tensor to encrypt
[in]chainIndexoptional target chain index

◆ encodeEncrypt() [2/2]

void helayers::CipherMatrixEncoder::encodeEncrypt ( CipherMatrix res,
const boost::numeric::ublas::tensor< std::complex< double >> &  vals,
int  chainIndex = -1 
) const

Encode and encrypt a 3d array of complex numbers.

Parameters
[out]resobject to contain encrypted matrix.
[in]valsa 3d tensor to encrypt
[in]chainIndexoptional target chain index

The documentation for this class was generated from the following files:
  • /opt/IBM/FHE-distro/ML-HElib/src/helayers/simple_nn/CipherMatrixEncoder.h
  • /opt/IBM/FHE-distro/ML-HElib/src/helayers/simple_nn/CipherMatrixEncoder.cpp