[−][src]Struct amcl_wrapper::group_elem_g1::G1Vector
Implementations
impl G1Vector
[src]
pub fn inner_product_const_time<'g, 'f>(
&'g self,
b: impl IntoIterator<Item = &'f FieldElement>
) -> Result<G1, ValueError>
[src]
&'g self,
b: impl IntoIterator<Item = &'f FieldElement>
) -> Result<G1, ValueError>
Computes inner product of 2 vectors, one of field elements and other of group elements. [a1, a2, a3, ...field elements].[b1, b2, b3, ...group elements] = (a1b1 + a2b2 + a3*b3)
pub fn inner_product_var_time<'g, 'f>(
&'g self,
b: impl IntoIterator<Item = &'f FieldElement>
) -> Result<G1, ValueError>
[src]
&'g self,
b: impl IntoIterator<Item = &'f FieldElement>
) -> Result<G1, ValueError>
pub fn inner_product_var_time_with_ref_vecs(
group_elems: Vec<&G1>,
field_elems: Vec<&FieldElement>
) -> Result<G1, ValueError>
[src]
group_elems: Vec<&G1>,
field_elems: Vec<&FieldElement>
) -> Result<G1, ValueError>
Please use the inner_product_var_time
function instead
pub fn hadamard_product(&self, b: &Self) -> Result<Self, ValueError>
[src]
Calculates Hadamard product of 2 group element vectors.
Hadamard product of a
and b
= a
o b
= (a0 o b0, a1 o b1, ...).
Here o
denotes group operation, which in elliptic curve is point addition
pub fn split_at(&self, mid: usize) -> (Self, Self)
[src]
pub fn multi_scalar_mul_const_time_naive(
&self,
field_elems: &FieldElementVector
) -> Result<G1, ValueError>
[src]
&self,
field_elems: &FieldElementVector
) -> Result<G1, ValueError>
Constant time multi-scalar multiplication. Naive approach computing n
scalar
multiplications and n-1 additions for n
field elements
pub fn multi_scalar_mul_const_time<'g, 'f>(
&'g self,
field_elems: impl IntoIterator<Item = &'f FieldElement>
) -> Result<G1, ValueError>
[src]
&'g self,
field_elems: impl IntoIterator<Item = &'f FieldElement>
) -> Result<G1, ValueError>
Constant time multi-scalar multiplication
pub fn multi_scalar_mul_var_time<'g, 'f>(
&'g self,
field_elems: impl IntoIterator<Item = &'f FieldElement>
) -> Result<G1, ValueError>
[src]
&'g self,
field_elems: impl IntoIterator<Item = &'f FieldElement>
) -> Result<G1, ValueError>
Variable time multi-scalar multiplication
pub fn multi_scalar_mul_var_time_without_precomputation<'g, 'f>(
group_elems: impl IntoIterator<Item = &'g G1>,
field_elems: impl IntoIterator<Item = &'f FieldElement>
) -> Result<G1, ValueError>
[src]
group_elems: impl IntoIterator<Item = &'g G1>,
field_elems: impl IntoIterator<Item = &'f FieldElement>
) -> Result<G1, ValueError>
Strauss multi-scalar multiplication
pub fn multi_scalar_mul_var_time_from_ref_vecs(
group_elems: Vec<&G1>,
field_elems: Vec<&FieldElement>
) -> Result<G1, ValueError>
[src]
group_elems: Vec<&G1>,
field_elems: Vec<&FieldElement>
) -> Result<G1, ValueError>
Please use the multi_scalar_mul_var_time_without_precomputation
function instead
pub fn multi_scalar_mul_var_time_with_precomputation_done<'f>(
lookup_tables: &[G1LookupTable],
field_elems: impl IntoIterator<Item = &'f FieldElement>
) -> Result<G1, ValueError>
[src]
lookup_tables: &[G1LookupTable],
field_elems: impl IntoIterator<Item = &'f FieldElement>
) -> Result<G1, ValueError>
Strauss multi-scalar multiplication. Passing the lookup tables since in lot of cases generators will be fixed
pub fn multi_scalar_mul_const_time_without_precomputation<'g, 'f>(
group_elems: impl IntoIterator<Item = &'g G1>,
field_elems: impl IntoIterator<Item = &'f FieldElement>
) -> Result<G1, ValueError>
[src]
group_elems: impl IntoIterator<Item = &'g G1>,
field_elems: impl IntoIterator<Item = &'f FieldElement>
) -> Result<G1, ValueError>
Constant time multi-scalar multiplication. Taken from Guide to Elliptic Curve Cryptography book, "Algorithm 3.48 Simultaneous multiple point multiplication" without precomputing the addition Still helps with reducing doublings
pub fn multi_scalar_mul_const_time_with_precomputation_done<'f>(
group_elem_multiples: &[Vec<G1>],
field_elems: impl IntoIterator<Item = &'f FieldElement>
) -> Result<G1, ValueError>
[src]
group_elem_multiples: &[Vec<G1>],
field_elems: impl IntoIterator<Item = &'f FieldElement>
) -> Result<G1, ValueError>
pub fn scale_var_time(&mut self, n: &FieldElement)
[src]
Non-constant time operation. Scale this group element vector by a factor. Each group element is multiplied by the same factor so wnaf is computed only once.
pub fn scaled_by_var_time(&self, n: &FieldElement) -> Self
[src]
Non-constant time operation. Return a scaled vector. Each group element is multiplied by the same factor so wnaf is computed only once.
Trait Implementations
impl AsRef<[G1]> for G1Vector
[src]
impl Clone for G1Vector
[src]
impl Debug for G1Vector
[src]
impl<'de> Deserialize<'de> for G1Vector
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl<'_> From<&'_ [G1]> for G1Vector
[src]
impl From<Vec<G1>> for G1Vector
[src]
impl GroupElementVector<G1> for G1Vector
[src]
fn new(size: usize) -> Self
[src]
fn with_capacity(capacity: usize) -> Self
[src]
fn as_slice(&self) -> &[G1]
[src]
fn as_mut_slice(&mut self) -> &mut [G1]
[src]
fn len(&self) -> usize
[src]
fn push(&mut self, value: G1)
[src]
fn append(&mut self, other: &mut Self)
[src]
fn pop(&mut self) -> Option<G1>
[src]
fn insert(&mut self, index: usize, element: G1)
[src]
fn remove(&mut self, index: usize) -> G1
[src]
fn sum(&self) -> G1
[src]
fn scale(&mut self, n: &FieldElement)
[src]
fn scaled_by(&self, n: &FieldElement) -> Self
[src]
fn plus(&self, b: &Self) -> Result<Self, ValueError>
[src]
fn minus(&self, b: &Self) -> Result<Self, ValueError>
[src]
fn iter(&self) -> Iter<G1>
[src]
fn random(size: usize) -> Self
[src]
impl Index<usize> for G1Vector
[src]
impl IndexMut<usize> for G1Vector
[src]
impl<'a> Into<&'a [G1]> for &'a G1Vector
[src]
impl Into<Vec<G1>> for G1Vector
[src]
impl IntoIterator for G1Vector
[src]
type Item = G1
The type of the elements being iterated over.
type IntoIter = IntoIter<G1>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
impl PartialEq<G1Vector> for G1Vector
[src]
impl Serialize for G1Vector
[src]
Auto Trait Implementations
impl RefUnwindSafe for G1Vector
impl Send for G1Vector
impl Sync for G1Vector
impl Unpin for G1Vector
impl UnwindSafe for G1Vector
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,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<I> IntoIterator for I where
I: Iterator,
[src]
I: Iterator,
type Item = <I as Iterator>::Item
The type of the elements being iterated over.
type IntoIter = I
Which kind of iterator are we turning this into?
fn into_iter(self) -> I
[src]
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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.
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,