Struct concrete_core::crypto::glwe::GlweMaskElement[][src]

pub struct GlweMaskElement<Cont> { /* fields omitted */ }

A mask of an GLWE ciphertext.

Implementations

impl<Container> GlweMaskElement<Container>[src]

pub fn from_container(cont: Container) -> GlweMaskElement<Container>[src]

Creates a mask element from a container.

Example

use concrete_core::crypto::glwe::GlweMaskElement;
use concrete_core::math::polynomial::PolynomialSize;
let mask = GlweMaskElement::from_container(vec![0 as u8; 10]);
assert_eq!(mask.as_polynomial().polynomial_size(), PolynomialSize(10));

pub fn as_polynomial(&self) -> Polynomial<&[Self::Element]> where
    Self: AsRefTensor
[src]

Returns a borrowed polynomial from the current mask element.

Example

use concrete_core::crypto::glwe::GlweMaskElement;
use concrete_core::math::polynomial::PolynomialSize;
let mask = GlweMaskElement::from_container(vec![0 as u8; 10]);
assert_eq!(mask.as_polynomial().polynomial_size(), PolynomialSize(10));

pub fn as_mut_polynomial(&mut self) -> Polynomial<&mut [Self::Element]> where
    Self: AsMutTensor
[src]

Returns a mutably borrowed polynomial from the current mask element.

Example

use concrete_core::crypto::glwe::GlweMaskElement;
use concrete_core::math::polynomial::PolynomialSize;
use concrete_core::math::tensor::{AsMutTensor, AsRefTensor};
let mut mask = GlweMaskElement::from_container(vec![0 as u8; 10]);
mask.as_mut_polynomial().as_mut_tensor().fill_with_element(9);
assert!(mask.as_tensor().iter().all(|a| *a == 9));

Trait Implementations

impl<Element> AsMutTensor for GlweMaskElement<Vec<Element>>[src]

type Element = Element

The element type.

type Container = Vec<Element>

The container used by the tensor.

impl<Element> AsMutTensor for GlweMaskElement<[Element; 1]>[src]

type Element = Element

The element type.

type Container = [Element; 1]

The container used by the tensor.

impl<Element> AsMutTensor for GlweMaskElement<AlignedVec<Element>>[src]

type Element = Element

The element type.

type Container = AlignedVec<Element>

The container used by the tensor.

impl<'a, Element> AsMutTensor for GlweMaskElement<&'a mut [Element]>[src]

type Element = Element

The element type.

type Container = &'a mut [Element]

The container used by the tensor.

impl<Element> AsRefTensor for GlweMaskElement<Vec<Element>>[src]

type Element = Element

The element type.

type Container = Vec<Element>

The container used by the tensor.

impl<Element> AsRefTensor for GlweMaskElement<AlignedVec<Element>>[src]

type Element = Element

The element type.

type Container = AlignedVec<Element>

The container used by the tensor.

impl<Element> AsRefTensor for GlweMaskElement<[Element; 1]>[src]

type Element = Element

The element type.

type Container = [Element; 1]

The container used by the tensor.

impl<'a, Element> AsRefTensor for GlweMaskElement<&'a [Element]>[src]

type Element = Element

The element type.

type Container = &'a [Element]

The container used by the tensor.

impl<'a, Element> AsRefTensor for GlweMaskElement<&'a mut [Element]>[src]

type Element = Element

The element type.

type Container = &'a mut [Element]

The container used by the tensor.

impl<Element> IntoTensor for GlweMaskElement<Vec<Element>>[src]

type Element = Element

The element type of the collection container.

type Container = Vec<Element>

The type of the collection container.

impl<Element> IntoTensor for GlweMaskElement<AlignedVec<Element>>[src]

type Element = Element

The element type of the collection container.

type Container = AlignedVec<Element>

The type of the collection container.

impl<Element> IntoTensor for GlweMaskElement<[Element; 1]>[src]

type Element = Element

The element type of the collection container.

type Container = [Element; 1]

The type of the collection container.

impl<'a, Element> IntoTensor for GlweMaskElement<&'a [Element]>[src]

type Element = Element

The element type of the collection container.

type Container = &'a [Element]

The type of the collection container.

impl<'a, Element> IntoTensor for GlweMaskElement<&'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.

Auto Trait Implementations

impl<Cont> RefUnwindSafe for GlweMaskElement<Cont> where
    Cont: RefUnwindSafe

impl<Cont> Send for GlweMaskElement<Cont> where
    Cont: Send

impl<Cont> Sync for GlweMaskElement<Cont> where
    Cont: Sync

impl<Cont> Unpin for GlweMaskElement<Cont> where
    Cont: Unpin

impl<Cont> UnwindSafe for GlweMaskElement<Cont> where
    Cont: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<Input, Output> CastInto<Output> for Input where
    Output: CastFrom<Input>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.