A handle, describing the secret-key element that "matches" a part, of the form s^r(X^t). More...
#include <Ctxt.h>
Public Member Functions | |
| SKHandle (long newPowerOfS=0, long newPowerOfX=1, long newSecretKeyID=0) | |
| void | setBase (long newSecretKeyID=-1) |
| Set powerOfS=powerOfX=1. More... | |
| bool | isBase (long ofKeyID=0) const |
| Is powerOfS==powerOfX==1? More... | |
| void | setOne (long newSecretKeyID=-1) |
| Set powerOfS=0, powerOfX=1. More... | |
| bool | isOne () const |
| Is powerOfS==0? More... | |
| bool | operator== (const SKHandle &other) const |
| bool | operator!= (const SKHandle &other) const |
| long | getPowerOfS () const |
| long | getPowerOfX () const |
| long | getSecretKeyID () const |
| bool | mul (const SKHandle &a, const SKHandle &b) |
| Computes the "product" of two handles. More... | |
| void | writeTo (std::ostream &str) const |
Write out the SKHandle object in binary format. More... | |
| void | writeToJSON (std::ostream &str) const |
Write out the secret key handle (SKHandle) object to the output stream using JSON format. More... | |
| JsonWrapper | writeToJSON () const |
Write out the secret key handle (SKHandle) object to a JsonWrapper. More... | |
| void | readJSON (std::istream &str) |
Read from the stream the serialized secret key handle (SKHandle) object using JSON format. More... | |
| void | readJSON (const JsonWrapper &j) |
Read from the JsonWrapper the serialized secret key handle (SKHandle) object. More... | |
Static Public Member Functions | |
| static SKHandle | readFrom (std::istream &str) |
Read from the stream the serialized SKHandle object in binary format. More... | |
| static SKHandle | readFromJSON (std::istream &str) |
Read from the stream the serialized secret key handle (SKHandle) object using JSON format. More... | |
| static SKHandle | readFromJSON (const JsonWrapper &j) |
Read from the JsonWrapper the serialized secret key handle (SKHandle) object. More... | |
Friends | |
| class | Ctxt |
| std::istream & | operator>> (std::istream &s, SKHandle &handle) |
Detailed Description
A handle, describing the secret-key element that "matches" a part, of the form s^r(X^t).
Constructor & Destructor Documentation
◆ SKHandle()
|
inline |
Member Function Documentation
◆ getPowerOfS()
|
inline |
◆ getPowerOfX()
|
inline |
◆ getSecretKeyID()
|
inline |
◆ isBase()
|
inline |
Is powerOfS==powerOfX==1?
◆ isOne()
|
inline |
Is powerOfS==0?
◆ mul()
Computes the "product" of two handles.
The key-ID's and powers of X must match, else an error state arises, which is represented using a key-ID of -1 and returning false. Also, note that inputs may alias outputs.
To determine if the resulting handle can be re-linearized using some key-switching matrices from the public key, use the method pubKey.haveKeySWmatrix(handle,handle.secretKeyID), from the class PubKey in keys.h
◆ operator!=()
|
inline |
◆ operator==()
|
inline |
◆ readFrom()
|
static |
◆ readFromJSON() [1/2]
|
static |
Read from the JsonWrapper the serialized secret key handle (SKHandle) object.
- Parameters
-
j The JsonWrappercontaining the serializedSKHandleobject.
- Returns
- The deserialized
SKHandleobject.
◆ readFromJSON() [2/2]
|
static |
◆ readJSON() [1/2]
| void helib::SKHandle::readJSON | ( | const JsonWrapper & | j | ) |
Read from the JsonWrapper the serialized secret key handle (SKHandle) object.
- Parameters
-
j The JsonWrappercontaining the serializedSKHandleobject.
◆ readJSON() [2/2]
| void helib::SKHandle::readJSON | ( | std::istream & | str | ) |
Read from the stream the serialized secret key handle (SKHandle) object using JSON format.
- Parameters
-
str Input std::istream.
◆ setBase()
|
inline |
Set powerOfS=powerOfX=1.
◆ setOne()
|
inline |
Set powerOfS=0, powerOfX=1.
◆ writeTo()
| void helib::SKHandle::writeTo | ( | std::ostream & | str | ) | const |
Write out the SKHandle object in binary format.
- Parameters
-
str Output std::ostream.
◆ writeToJSON() [1/2]
| JsonWrapper helib::SKHandle::writeToJSON | ( | ) | const |
Write out the secret key handle (SKHandle) object to a JsonWrapper.
- Returns
- The
JsonWrapper.
◆ writeToJSON() [2/2]
| void helib::SKHandle::writeToJSON | ( | std::ostream & | str | ) | const |
Write out the secret key handle (SKHandle) object to the output stream using JSON format.
- Parameters
-
str Output std::ostream.
Friends And Related Function Documentation
◆ Ctxt
|
friend |
◆ operator>>
|
friend |
1.9.1