pub struct HypercubeStructure { /* private fields */ }Expand description
Represents a hypercube, which is a map
h: { 0, ..., m1 - 1 } x ... x { 0, ..., mr - 1 } -> (Z/nZ)^*
a1, ..., ar -> prod_i gi^aisuch that the composition (mod <p>) ∘ h is a bijection.
We use the following notation:
nandpas abovedis the order of<p>as subgroup of(Z/nZ)*miis the length of thei-th “hypercube dimension” as abovegiis the generator of thei-th hypercube dimension
Implementations§
Source§impl HypercubeStructure
impl HypercubeStructure
pub fn new( galois_group: CyclotomicGaloisGroup, p: CyclotomicGaloisGroupEl, d: usize, ms: Vec<usize>, gs: Vec<CyclotomicGaloisGroupEl>, ) -> Self
Sourcepub fn halevi_shoup_hypercube(
galois_group: CyclotomicGaloisGroup,
p: i64,
) -> Self
pub fn halevi_shoup_hypercube( galois_group: CyclotomicGaloisGroup, p: i64, ) -> Self
Computes “the” Halevi-Shoup hypercube as described in [https://ia.cr/2014/873].
Note that the Halevi-Shoup hypercube is unique except for the ordering of prime
factors of n. This function uses a deterministic but unspecified ordering.
pub fn map_1d(&self, dim_idx: usize, steps: i64) -> CyclotomicGaloisGroupEl
pub fn map(&self, idxs: &[i64]) -> CyclotomicGaloisGroupEl
pub fn map_usize(&self, idxs: &[usize]) -> CyclotomicGaloisGroupEl
pub fn std_preimage(&self, g: CyclotomicGaloisGroupEl) -> &[usize]
pub fn is_tensor_product_compatible(&self) -> bool
pub fn factor_of_n(&self, dim_idx: usize) -> Option<i64>
pub fn p(&self) -> CyclotomicGaloisGroupEl
pub fn frobenius(&self, power: i64) -> CyclotomicGaloisGroupEl
pub fn d(&self) -> usize
pub fn m(&self, i: usize) -> usize
pub fn g(&self, i: usize) -> CyclotomicGaloisGroupEl
pub fn ord_g(&self, i: usize) -> usize
pub fn n(&self) -> usize
pub fn dim_count(&self) -> usize
pub fn galois_group(&self) -> &CyclotomicGaloisGroup
pub fn element_count(&self) -> usize
pub fn hypercube_iter<'b, G, T>( &'b self, for_slot: G, ) -> impl ExactSizeIterator<Item = T> + use<'b, G, T>
pub fn element_iter<'b>( &'b self, ) -> impl ExactSizeIterator<Item = CyclotomicGaloisGroupEl> + use<'b>
Trait Implementations§
Source§impl Clone for HypercubeStructure
impl Clone for HypercubeStructure
Source§fn clone(&self) -> HypercubeStructure
fn clone(&self) -> HypercubeStructure
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for HypercubeStructure
impl RefUnwindSafe for HypercubeStructure
impl Send for HypercubeStructure
impl Sync for HypercubeStructure
impl Unpin for HypercubeStructure
impl UnwindSafe for HypercubeStructure
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more