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. | |
CipherMatrixEncoder & operator= (const CipherMatrixEncoder &src)=delete | |
Assignment deleted. Construct new objects when needed. | |
Encoder & getEncoder () | |
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] he the 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] src input 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] src input 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] res object to contain encrypted matrix. [in] vals a 3d tensor to encrypt [in] chainIndex optional 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] res object to contain encrypted matrix. [in] vals a 3d tensor to encrypt [in] chainIndex optional 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