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

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

A mask of an GLWE ciphertext.

Implementations

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));

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));

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

The element type.

The container used by the tensor.

Returns a mutable reference to the enclosed tensor.

The element type.

The container used by the tensor.

Returns a mutable reference to the enclosed tensor.

The element type.

The container used by the tensor.

Returns a mutable reference to the enclosed tensor.

The element type.

The container used by the tensor.

Returns a mutable reference to the enclosed tensor.

The element type.

The container used by the tensor.

Returns a reference to the enclosed tensor.

The element type.

The container used by the tensor.

Returns a reference to the enclosed tensor.

The element type.

The container used by the tensor.

Returns a reference to the enclosed tensor.

The element type.

The container used by the tensor.

Returns a reference to the enclosed tensor.

The element type.

The container used by the tensor.

Returns a reference to the enclosed tensor.

The element type of the collection container.

The type of the collection container.

Consumes self and returns an owned tensor.

The element type of the collection container.

The type of the collection container.

Consumes self and returns an owned tensor.

The element type of the collection container.

The type of the collection container.

Consumes self and returns an owned tensor.

The element type of the collection container.

The type of the collection container.

Consumes self and returns an owned tensor.

The element type of the collection container.

The type of the collection container.

Consumes self and returns an owned tensor.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.