From 1d394e00f6121fc81c24f0b368596708f91702b6 Mon Sep 17 00:00:00 2001 From: Sean Bowe Date: Wed, 22 Nov 2017 21:11:41 -0700 Subject: [PATCH] Allow linear combination terms to be inspected for downstream evaluation. --- src/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index da7387e..c12fc72 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -9,6 +9,12 @@ use std::error::Error; /// in the scalar field of a pairing-friendly elliptic curve group. pub struct LinearCombination(Vec<(T, E::Fr)>); +impl AsRef<[(T, E::Fr)]> for LinearCombination { + fn as_ref(&self) -> &[(T, E::Fr)] { + &self.0 + } +} + impl LinearCombination { pub fn zero() -> LinearCombination { LinearCombination(vec![])