Struct seal_fhe::EncryptionParameters
source · [−]pub struct EncryptionParameters { /* private fields */ }
Expand description
An immutable collection of parameters that defines an encryption scheme. Use either the CKKSBuilder or BFVBuilder to create one of these. Once created, these objects are effectively immutable.
Picking appropriate encryption parameters is essential to enable a particular application while balancing performance and security. Some encryption settings will not allow some inputs (e.g. attempting to encrypt a polynomial with more coefficients than PolyModulus or larger coefficients than PlainModulus) or support the desired computations (with noise growing too fast due to too large PlainModulus and too small CoeffModulus).
The EncryptionParameters class maintains at all times a 256-bit hash of the
currently set encryption parameters called the ParmsId. This hash acts as
a unique identifier of the encryption parameters and is used by all further
objects created for these encryption parameters. The ParmsId is not intended
to be directly modified by the user but is used internally for pre-computation
data lookup and input validity checks. In modulus switching the user can use
the ParmsId to keep track of the chain of encryption parameters. The ParmsId is
not exposed in the public API of EncryptionParameters, but can be accessed
through the
Choosing inappropriate encryption parameters may lead to an encryption scheme that is not secure, does not perform well, and/or does not support the input and computation of the desired application. We highly recommend consulting an expert in RLWE-based encryption when selecting parameters, as this is where inexperienced users seem to most often make critical mistakes.
Implementations
sourceimpl EncryptionParameters
impl EncryptionParameters
sourcepub fn get_handle(&self) -> *mut c_void
pub fn get_handle(&self) -> *mut c_void
Returns the handle to the underlying SEAL object.
sourcepub fn get_poly_modulus_degree(&self) -> u64
pub fn get_poly_modulus_degree(&self) -> u64
Returns the polynomial degree of the underlying CKKS or BFV scheme.
sourcepub fn get_scheme(&self) -> SchemeType
pub fn get_scheme(&self) -> SchemeType
Get the underlying scheme.
sourcepub fn get_plain_modulus(&self) -> Modulus
pub fn get_plain_modulus(&self) -> Modulus
Returns the plain text modulus for the encryption scheme.
sourcepub fn get_coefficient_modulus(&self) -> Vec<Modulus>
pub fn get_coefficient_modulus(&self) -> Vec<Modulus>
Returns the coefficient modulus for the encryption scheme.
Trait Implementations
sourceimpl Drop for EncryptionParameters
impl Drop for EncryptionParameters
impl Send for EncryptionParameters
impl Sync for EncryptionParameters
Auto Trait Implementations
impl RefUnwindSafe for EncryptionParameters
impl Unpin for EncryptionParameters
impl UnwindSafe for EncryptionParameters
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more