PALISADE consists of a number of library objects that can be linked into lattice cryptography applications.
The source files in the demo directories, particularly those in src/demo/pke, illustrate the use of the library.
To use PALISADE, you must
select a lattice element to be used for your application. We support:
select a scheme to use
Null (a test scheme which does not actually encrypt/decrypt anything)
Create a CryptoContext for the scheme and lattice element type.
This requires that you:
decide on lattice parameters (cyclotomic order, ciphertext modulus)
decide on encoding parameters (plaintext modulus)
decide on scheme-specific parameters
Enable the algorithms that you want to use
Enable(ENCRYPTION) - allows for key generation and encrypt/decrypt
Enable(PRE) - allows for the use of proxy re-encryption
Enable(SHE) - enables SHE operations such as EvalAdd and EvalMult
In order to make this easier for the user, there are several CryptoContextFactory methods for the various schemes.
Streamlining and improving the process of parameter selection and CryptoContext generation is an area that is being actively worked.
Anything done in PALISADE is done through the CryptoContext. All operations are CryptoContext methods. The code only allows operations between objects that were created in the same context, and will generate an error if it finds that this is not the case.
Objects created by a CryptoContext usually have a Serialize method that converts the object into a rapidjson object that can be saved to a string or to a disk file.
A serialization can be Deserialized through the use of several of the CryptoContext's Deserialize methods. The following methods are provided:
Each of these methods will convert a Serialized object into a newly Deserialized object in the CryptoContext. The Deserialize process will ensure that the serialized object's parameters match the CryptoContext. If they do, then the new object "belongs to" the CryptoContext and can be used with other objects from the same CryptoContext. A mismatch of parameters will cause the deserialization to fail.
PALISADE can be "bootstrapped" from a serialized object. The CryptoContextFactory contains a method DeserializeAndCreateContext which will create a CryptoContext from a serialization.