Browse Source

Rename Prover and ProvingAssignment.

main
porcuquine 3 years ago
committed by Srinath Setty
parent
commit
efb73ef325
3 changed files with 12 additions and 12 deletions
  1. +1
    -1
      src/bellperson/mod.rs
  2. +5
    -5
      src/bellperson/r1cs.rs
  3. +6
    -6
      src/bellperson/solver.rs

+ 1
- 1
src/bellperson/mod.rs

@ -2,6 +2,6 @@
//! //!
//! [Bellperson]: https://github.com/filecoin-project/bellperson //! [Bellperson]: https://github.com/filecoin-project/bellperson
pub mod prover;
pub mod r1cs; pub mod r1cs;
pub mod shape_cs; pub mod shape_cs;
pub mod solver;

+ 5
- 5
src/bellperson/r1cs.rs

@ -2,8 +2,8 @@
#![allow(non_snake_case)] #![allow(non_snake_case)]
use super::prover::ProvingAssignment;
use super::shape_cs::ShapeCS; use super::shape_cs::ShapeCS;
use super::solver::SatisfyingAssignment;
use bellperson::{Index, LinearCombination}; use bellperson::{Index, LinearCombination};
use ff::PrimeField; use ff::PrimeField;
@ -16,7 +16,7 @@ use crate::{
/// `NovaWitness` provide a method for acquiring an `R1CSInstance` and `R1CSWitness` from implementers. /// `NovaWitness` provide a method for acquiring an `R1CSInstance` and `R1CSWitness` from implementers.
pub trait NovaWitness<G: Group> { pub trait NovaWitness<G: Group> {
/// Return an instance and witness, given a shape and gens.
/// Return an instance and witness, given a shape and gens.
fn r1cs_instance_and_witness( fn r1cs_instance_and_witness(
&self, &self,
shape: &R1CSShape<G>, shape: &R1CSShape<G>,
@ -26,13 +26,13 @@ pub trait NovaWitness {
/// `NovaShape` provides methods for acquiring `R1CSShape` and `R1CSGens` from implementers. /// `NovaShape` provides methods for acquiring `R1CSShape` and `R1CSGens` from implementers.
pub trait NovaShape<G: Group> { pub trait NovaShape<G: Group> {
/// Return an appropriate `R1CSShape` struct.
/// Return an appropriate `R1CSShape` struct.
fn r1cs_shape(&self) -> R1CSShape<G>; fn r1cs_shape(&self) -> R1CSShape<G>;
/// Return an appropriate `R1CSGens` struct.
/// Return an appropriate `R1CSGens` struct.
fn r1cs_gens(&self) -> R1CSGens<G>; fn r1cs_gens(&self) -> R1CSGens<G>;
} }
impl<G: Group> NovaWitness<G> for ProvingAssignment<G>
impl<G: Group> NovaWitness<G> for SatisfyingAssignment<G>
where where
G::Scalar: PrimeField, G::Scalar: PrimeField,
{ {

src/bellperson/prover.rs → src/bellperson/solver.rs

@ -8,7 +8,7 @@ use bellperson::{
}; };
/// A `ConstraintSystem` which calculates witness values for a concrete instance of an R1CS circuit. /// A `ConstraintSystem` which calculates witness values for a concrete instance of an R1CS circuit.
pub struct ProvingAssignment<G: Group>
pub struct SatisfyingAssignment<G: Group>
where where
G::Scalar: PrimeField, G::Scalar: PrimeField,
{ {
@ -28,13 +28,13 @@ where
} }
use std::fmt; use std::fmt;
impl<G: Group> fmt::Debug for ProvingAssignment<G>
impl<G: Group> fmt::Debug for SatisfyingAssignment<G>
where where
G::Scalar: PrimeField, G::Scalar: PrimeField,
{ {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fmt fmt
.debug_struct("ProvingAssignment")
.debug_struct("SatisfyingAssignment")
.field("a_aux_density", &self.a_aux_density) .field("a_aux_density", &self.a_aux_density)
.field("b_input_density", &self.b_input_density) .field("b_input_density", &self.b_input_density)
.field("b_aux_density", &self.b_aux_density) .field("b_aux_density", &self.b_aux_density)
@ -68,11 +68,11 @@ where
} }
} }
impl<G: Group> PartialEq for ProvingAssignment<G>
impl<G: Group> PartialEq for SatisfyingAssignment<G>
where where
G::Scalar: PrimeField, G::Scalar: PrimeField,
{ {
fn eq(&self, other: &ProvingAssignment<G>) -> bool {
fn eq(&self, other: &SatisfyingAssignment<G>) -> bool {
self.a_aux_density == other.a_aux_density self.a_aux_density == other.a_aux_density
&& self.b_input_density == other.b_input_density && self.b_input_density == other.b_input_density
&& self.b_aux_density == other.b_aux_density && self.b_aux_density == other.b_aux_density
@ -84,7 +84,7 @@ where
} }
} }
impl<G: Group> ConstraintSystem<G::Scalar> for ProvingAssignment<G>
impl<G: Group> ConstraintSystem<G::Scalar> for SatisfyingAssignment<G>
where where
G::Scalar: PrimeField, G::Scalar: PrimeField,
{ {

Loading…
Cancel
Save