Allow linear combination terms to be inspected for downstream evaluation.

This commit is contained in:
Sean Bowe 2017-11-22 21:11:41 -07:00
parent e54c4bc1b3
commit 1d394e00f6
1 changed files with 6 additions and 0 deletions

View File

@ -9,6 +9,12 @@ use std::error::Error;
/// in the scalar field of a pairing-friendly elliptic curve group.
pub struct LinearCombination<T, E: Engine>(Vec<(T, E::Fr)>);
impl<T, E: Engine> AsRef<[(T, E::Fr)]> for LinearCombination<T, E> {
fn as_ref(&self) -> &[(T, E::Fr)] {
&self.0
}
}
impl<T, E: Engine> LinearCombination<T, E> {
pub fn zero() -> LinearCombination<T, E> {
LinearCombination(vec![])