From 0bf73c5d085466fe74fa1db75750109b26ed84d3 Mon Sep 17 00:00:00 2001 From: therealyingtong Date: Wed, 2 Sep 2020 23:18:43 +0800 Subject: [PATCH] Minor fixes to srs.rs --- src/plonk/srs.rs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/plonk/srs.rs b/src/plonk/srs.rs index d878e32..d22ac77 100644 --- a/src/plonk/srs.rs +++ b/src/plonk/srs.rs @@ -66,15 +66,9 @@ impl SRS { // Don't perform the copy constraint because it will undo // the effect of the permutation. } else { - *self.copy[permutation] - .get_mut(left_wire) - .and_then(|wire| wire.get_mut(left_row)) - .ok_or(Error::BoundsFailure)? = right; + self.copy[permutation][left_wire][left_row] = right; - *self.copy[permutation] - .get_mut(right_wire) - .and_then(|wire| wire.get_mut(right_row)) - .ok_or(Error::BoundsFailure)? = left; + self.copy[permutation][right_wire][right_row] = left; } Ok(()) @@ -94,7 +88,7 @@ impl SRS { // The permutation argument will serve alongside the gates, so must be // accounted for. - let mut degree = largest_permutation_length; + let mut degree = largest_permutation_length + 1; // Account for each gate to ensure our quotient polynomial is the // correct degree and that our extended domain is the right size.