pub struct ZqVector { /* private fields */ }
Expand description
A ZqVector is a vector of Zq elements with a flexible size. Mainly used for store random Zq elements
Implementations§
Source§impl ZqVector
impl ZqVector
pub fn new(coeffs: Vec<Zq>) -> Self
pub fn zero(len: usize) -> Self
pub fn get_coeffs(&self) -> &Vec<Zq>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn random<R: Rng + CryptoRng>(rng: &mut R, n: usize) -> Self
pub fn iter(&self) -> impl Iterator<Item = &Zq>
pub fn iter_mut(&mut self) -> impl Iterator<Item = &mut Zq>
Sourcepub fn inner_product(&self, other: &Self) -> Zq
pub fn inner_product(&self, other: &Self) -> Zq
Dot product between coefficients
Sourcepub fn conjugate_automorphism(&self) -> ZqVector
pub fn conjugate_automorphism(&self) -> ZqVector
Compute the conjugate automorphism \sigma_{-1} of vector based on B) Constraints…, Page 21.
Trait Implementations§
Source§impl FromIterator<Zq> for ZqVector
impl FromIterator<Zq> for ZqVector
Source§impl Mul<&ZqVector> for &ZqVector
Note: This is a key performance bottleneck. The multiplication here is primarily used in: Prover.check_projection()
which verifies the condition: p_j? = ct(sum(<σ−1(pi_i^(j)), s_i>))
Each ZqVector involved has a length of 2*lambda (default: 256).
Consider optimizing this operation by applying NTT-based multiplication to improve performance.
impl Mul<&ZqVector> for &ZqVector
Note: This is a key performance bottleneck. The multiplication here is primarily used in: Prover.check_projection() which verifies the condition: p_j? = ct(sum(<σ−1(pi_i^(j)), s_i>)) Each ZqVector involved has a length of 2*lambda (default: 256). Consider optimizing this operation by applying NTT-based multiplication to improve performance.
impl Eq for ZqVector
impl StructuralPartialEq for ZqVector
Auto Trait Implementations§
impl Freeze for ZqVector
impl RefUnwindSafe for ZqVector
impl Send for ZqVector
impl Sync for ZqVector
impl Unpin for ZqVector
impl UnwindSafe for ZqVector
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