Struct concrete_core::crypto::glwe::GlweMask [−][src]
The mask of a GLWE ciphertext
Implementations
impl<Cont> GlweMask<Cont>
[src]
pub fn mask_element_iter(
&self
) -> impl Iterator<Item = GlweMaskElement<&[Self::Element]>> where
Self: AsRefTensor,
[src]
&self
) -> impl Iterator<Item = GlweMaskElement<&[Self::Element]>> where
Self: AsRefTensor,
Returns an iterator over borrowed mask elements contained in the mask.
Example
use concrete_core::crypto::{*, glwe::*}; use concrete_core::math::polynomial::PolynomialSize; let rlwe_ciphertext = GlweCiphertext::allocate(0 as u8, PolynomialSize(10), GlweSize(100)); for mask in rlwe_ciphertext.get_mask().mask_element_iter(){ assert_eq!(mask.as_polynomial().polynomial_size(), PolynomialSize(10)); } assert_eq!(rlwe_ciphertext.get_mask().mask_element_iter().count(), 99);
pub fn mask_element_iter_mut(
&mut self
) -> impl Iterator<Item = GlweMaskElement<&mut [Self::Element]>> where
Self: AsMutTensor,
[src]
&mut self
) -> impl Iterator<Item = GlweMaskElement<&mut [Self::Element]>> where
Self: AsMutTensor,
Returns an iterator over mutably borrowed mask elements contained in the mask.
Example
use concrete_core::crypto::{*, glwe::*}; use concrete_core::math::polynomial::PolynomialSize; use concrete_core::math::tensor::{AsMutTensor, AsRefTensor}; let mut rlwe = GlweCiphertext::allocate(0 as u8, PolynomialSize(10), GlweSize(100)); for mut mask in rlwe.get_mut_mask().mask_element_iter_mut(){ mask.as_mut_tensor().fill_with_element(9); } assert!(rlwe.get_mask().as_tensor().iter().all(|a| *a==9)); assert_eq!(rlwe.get_mask().mask_element_iter().count(), 99);
pub fn as_polynomial_list(&self) -> PolynomialList<&[Self::Element]> where
Self: AsRefTensor,
[src]
Self: AsRefTensor,
Returns a borrowed polynomial list from the current mask.
Example
use concrete_core::crypto::{*, glwe::*}; use concrete_core::math::polynomial::{PolynomialSize, PolynomialCount}; use concrete_core::math::tensor::{AsMutTensor, AsRefTensor}; let rlwe = GlweCiphertext::allocate(0 as u8, PolynomialSize(10), GlweSize(100)); let masks = rlwe.get_mask(); let list = masks.as_polynomial_list(); assert_eq!(list.polynomial_size(), PolynomialSize(10)); assert_eq!(list.polynomial_count(), PolynomialCount(99));
pub fn as_mut_polynomial_list(&mut self) -> PolynomialList<&mut [Self::Element]> where
Self: AsMutTensor,
[src]
Self: AsMutTensor,
Returns a mutably borrowed polynomial list from the current mask list.
Example
use concrete_core::crypto::{*, glwe::*}; use concrete_core::math::polynomial::{PolynomialSize, PolynomialCount}; use concrete_core::math::tensor::{AsMutTensor, AsRefTensor}; let mut rlwe = GlweCiphertext::allocate(0 as u8, PolynomialSize(10), GlweSize(100)); let mut masks = rlwe.get_mut_mask(); let mut tensor = masks.as_mut_polynomial_list(); assert_eq!(tensor.polynomial_size(), PolynomialSize(10)); assert_eq!(tensor.polynomial_count(), PolynomialCount(99));
Trait Implementations
impl<Element> AsMutTensor for GlweMask<Vec<Element>>
[src]
type Element = Element
The element type.
type Container = Vec<Element>
The container used by the tensor.
fn as_mut_tensor(&mut self) -> &mut Tensor<Self::Container>
[src]
impl<Element> AsMutTensor for GlweMask<[Element; 1]>
[src]
type Element = Element
The element type.
type Container = [Element; 1]
The container used by the tensor.
fn as_mut_tensor(&mut self) -> &mut Tensor<Self::Container>
[src]
impl<Element> AsMutTensor for GlweMask<AlignedVec<Element>>
[src]
type Element = Element
The element type.
type Container = AlignedVec<Element>
The container used by the tensor.
fn as_mut_tensor(&mut self) -> &mut Tensor<Self::Container>
[src]
impl<'a, Element> AsMutTensor for GlweMask<&'a mut [Element]>
[src]
type Element = Element
The element type.
type Container = &'a mut [Element]
The container used by the tensor.
fn as_mut_tensor(&mut self) -> &mut Tensor<Self::Container>
[src]
impl<Element> AsRefTensor for GlweMask<Vec<Element>>
[src]
type Element = Element
The element type.
type Container = Vec<Element>
The container used by the tensor.
fn as_tensor(&self) -> &Tensor<Self::Container>
[src]
impl<Element> AsRefTensor for GlweMask<AlignedVec<Element>>
[src]
type Element = Element
The element type.
type Container = AlignedVec<Element>
The container used by the tensor.
fn as_tensor(&self) -> &Tensor<Self::Container>
[src]
impl<Element> AsRefTensor for GlweMask<[Element; 1]>
[src]
type Element = Element
The element type.
type Container = [Element; 1]
The container used by the tensor.
fn as_tensor(&self) -> &Tensor<Self::Container>
[src]
impl<'a, Element> AsRefTensor for GlweMask<&'a [Element]>
[src]
type Element = Element
The element type.
type Container = &'a [Element]
The container used by the tensor.
fn as_tensor(&self) -> &Tensor<Self::Container>
[src]
impl<'a, Element> AsRefTensor for GlweMask<&'a mut [Element]>
[src]
type Element = Element
The element type.
type Container = &'a mut [Element]
The container used by the tensor.
fn as_tensor(&self) -> &Tensor<Self::Container>
[src]
impl<Element> IntoTensor for GlweMask<Vec<Element>>
[src]
type Element = Element
The element type of the collection container.
type Container = Vec<Element>
The type of the collection container.
fn into_tensor(self) -> Tensor<Self::Container>
[src]
impl<Element> IntoTensor for GlweMask<AlignedVec<Element>>
[src]
type Element = Element
The element type of the collection container.
type Container = AlignedVec<Element>
The type of the collection container.
fn into_tensor(self) -> Tensor<Self::Container>
[src]
impl<Element> IntoTensor for GlweMask<[Element; 1]>
[src]
type Element = Element
The element type of the collection container.
type Container = [Element; 1]
The type of the collection container.
fn into_tensor(self) -> Tensor<Self::Container>
[src]
impl<'a, Element> IntoTensor for GlweMask<&'a [Element]>
[src]
type Element = Element
The element type of the collection container.
type Container = &'a [Element]
The type of the collection container.
fn into_tensor(self) -> Tensor<Self::Container>
[src]
impl<'a, Element> IntoTensor for GlweMask<&'a mut [Element]>
[src]
type Element = Element
The element type of the collection container.
type Container = &'a mut [Element]
The type of the collection container.
fn into_tensor(self) -> Tensor<Self::Container>
[src]
Auto Trait Implementations
impl<Cont> RefUnwindSafe for GlweMask<Cont> where
Cont: RefUnwindSafe,
Cont: RefUnwindSafe,
impl<Cont> Send for GlweMask<Cont> where
Cont: Send,
Cont: Send,
impl<Cont> Sync for GlweMask<Cont> where
Cont: Sync,
Cont: Sync,
impl<Cont> Unpin for GlweMask<Cont> where
Cont: Unpin,
Cont: Unpin,
impl<Cont> UnwindSafe for GlweMask<Cont> where
Cont: UnwindSafe,
Cont: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<Input, Output> CastInto<Output> for Input where
Output: CastFrom<Input>,
[src]
Output: CastFrom<Input>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,