# README
References
- Somewhat Practical Fully Homomorphic Encryption (https://eprint.iacr.org/2012/144)
- Fully Homomorphic Encryption without Bootstrapping (https://eprint.iacr.org/2011/277)
- Efficient Homomorphic Conversion Between (Ring) LWE Ciphertexts (https://eprint.iacr.org/2020/015)
- HERMES: Efficient Ring Packing using MLWE Ciphertexts and Application to Transciphering (https://eprint.iacr.org/2023/1244)
# Functions
AddPlaintextToMatrix takes a plaintext polynomial and adds the plaintext times the gadget decomposition matrix to the matrix ct.
CheckModuli checks that the provided q and p correspond to a valid moduli chain.
GaloisElementsForInnerSum returns the list of Galois elements necessary to apply the method `InnerSum` operation with parameters `batch` and `n`.
GaloisElementsForReplicate returns the list of Galois elements necessary to perform the `Replicate` operation with parameters `batch` and `n`.
GaloisElementsForTrace returns the list of Galois elements requored for the for the `Trace` operation.
GenModuli generates a valid moduli chain from the provided moduli sizes.
GetSmallestLargest returns the provided element that has the smallest degree as a first returned value and the largest degree as second return value.
NewCiphertext returns a new Ciphertext with zero values.
NewCiphertextAtLevelFromPoly returns an instance of a Ciphertext at a specific level where the message is set to the passed poly.
NewCustomParameters enables the construction of custom [rlwe.Parameters] by passing each private field individually.
NewDecryptor instantiates a new [rlwe.Decryptor].
No description provided by the author
NewEncryptor creates a new [rlwe.Encryptor] from either an [rlwe.EncryptionKey].
NewEvaluationKey returns a new EvaluationKey with pre-allocated zero-value.
NewEvaluator creates a new Evaluator.
No description provided by the author
NewGadgetCiphertext returns a new Ciphertext key with pre-allocated zero-value.
NewGadgetPlaintext creates a new gadget plaintext from value, which can be either uint64, int64 or *ring.RNSPoly.
NewGaloisKey allocates a new GaloisKey with zero coefficients and GaloisElement set to zero.
NewKeyGenerator creates a new KeyGenerator, from which the secret and public keys, as well as EvaluationKeys.
NewMemEvaluationKeySet returns a new EvaluationKeySet with the provided RelinearizationKey and GaloisKeys.
NewParameters returns a new set of generic RLWE parameters from the given ring degree logn, moduli q and p, and error distribution Xs (secret) and Xe (error).
NewParametersFromLiteral instantiate a set of generic RLWE parameters from an [rlwe.ParametersLiteral] specification.
NewPlaintext creates a new Plaintext.
NewPlaintextAtLevelFromPoly constructs a new Plaintext at a specific level where the message is set to the passed poly.
NewPublicKey returns a new PublicKey with zero values.
NewRelinearizationKey allocates a new RelinearizationKey with zero coefficients.
NewScale instantiates a new floating point Scale.
NewScaleModT instantiates a new integer mod T Scale.
NewSecretKey generates a new SecretKey with zero values.
NoiseCiphertext returns the log2 of the standard deviation of the input ciphertext with respect to the given secret-key and parameters.
NoiseEvaluationKey the log2 of the standard deviation of the noise of the input Galois key key with respect to the given secret-key and parameters.
NoiseGadgetCiphertext returns the log2 of the standard deviation of the noise of the input gadget ciphertext with respect to the given plaintext, secret-key and parameters.
NoiseGaloisKey the log2 of the standard deviation of the noise of the input Galois key key with respect to the given secret-key and parameters.
NoisePublicKey returns the log2 of the standard deviation of the input public-key with respect to the given secret-key and parameters.
NoiseRelinearizationKey the log2 of the standard deviation of the noise of the input relinearization key with respect to the given secret-key and parameters.
Norm returns the log2 of the standard deviation, minimum and maximum absolute norm of the decrypted Ciphertext, before the decoding (i.e.
No description provided by the author
NTTSparseAndMontgomery takes a polynomial Z[Y] outside of the NTT domain and maps it to a polynomial Z[X] in the NTT domain where Y = X^(gap).
No description provided by the author
# Constants
DefaultNoise is the default standard deviation of the error.
6*3.2.
GaloisGen is an integer of order N=2^d modulo M=2N and that spans Z_M with the integer -1.
MaxLogN is the log2 of the largest supported polynomial modulus degree.
MaxModuliSize is the largest bit-length supported for the moduli in the RNS representation.
MinLogN is the log2 of the smallest supported polynomial modulus degree (needed to ensure the NTT correctness).
ScalePrecision is the default precision of the scale.
Signed: signed digit decomposition, Var[X] = 2^{w}/12, E[X] = -0.5 Sligthly slower than unsigned (up to 15%), close to optimal error.
SignedBalanced: signed balanced digit decomposition, Var[X] = (2^{w}+0.25)/12, E[X] = 0 Much slower than unsigned (up to 50%), but optimal error.
Unsigned: unsigned digit decomposition, Var[X] = 2^{w}/12, E[X] = 2^{w-1} Fastest decomposition, but greatest error.
Sqrt(2/3).
# Variables
DefaultXe is the default discrete Gaussian distribution.
No description provided by the author
ExampleParameterLogN14LogQP438 is an example parameters set with logN=14 and logQP=438 offering 128-bit of security.
No description provided by the author
# Structs
Ciphertext is wrapper around an [rlwe.Vector].
CompressionInfos is a struct storing information to be able to reconstruct public random polynomial from a seed.
Decryptor is a structure used to decrypt [rlwe.Ciphertext].
DigitDecomposition is a struct that stores the parameters for the digit decomposition.
No description provided by the author
Encryptor is a struct dedicated to encrypting - [rlwe.Ciphertext] - [rlwe.GadgetCiphertext].
EncryptorBuffers is a struct storing the read and write buffers of an encryptor.
EvaluationKey is a public key indented to be used during the evaluation phase of a homomorphic circuit.
No description provided by the author
Evaluator is a struct that holds the necessary elements to execute general homomorphic operation on RLWE ciphertexts, such as automorphisms, key-switching and relinearization.
No description provided by the author
GadgetCiphertext is a struct for storing an encrypted plaintext times the gadget power matrix.
GadgetPlaintext stores a plaintext value times the gadget vector.
GaloisKey is a type of evaluation key used to evaluate automorphisms on ciphertext.
KeyGenerator is a structure that stores the elements required to create new keys, as well as a memory buffer for intermediate values.
MemEvaluationKeySet is a basic in-memory implementation of the EvaluationKeySet interface.
MetaData is a struct storing metadata.
Parameters represents a set of generic RLWE parameters.
ParametersLiteral is a literal representation of RLWE parameters.
Plaintext is a common base type for RLWE plaintexts.
PublicKey is a type for generic RLWE public keys.
RelinearizationKey is type of evaluation key used for ciphertext multiplication compactness.
Scale is a struct used to track the scaling factor of Plaintext and Ciphertext structs.
SecretKey is a type for generic RLWE secret keys.
# Interfaces
No description provided by the author
No description provided by the author
No description provided by the author
EncryptionKey is an interface for encryption keys.
EvaluationKeySet is an interface implementing methods to load the RelinearizationKey and GaloisKeys in the Evaluator.
Operand is an empty interface aimed at providing an anchor for documentation.
No description provided by the author
No description provided by the author
# Type aliases
DigitDecompositionType defines the type of the digit decomposition.