Trait snarkvm_polycommit::PCCheckVar
source · [−]pub trait PCCheckVar<PCF: PrimeField, PC: PolynomialCommitment<PCF, ConstraintF>, ConstraintF: PrimeField>: Clone {
type VerifierKeyVar: AllocGadget<PC::VerifierKey, ConstraintF> + Clone + ToBytesGadget<ConstraintF> + ToConstraintFieldGadget<ConstraintF> + PrepareGadget<Self::PreparedVerifierKeyVar, ConstraintF>;
type PreparedVerifierKeyVar: AllocGadget<PC::PreparedVerifierKey, ConstraintF> + AllocGadget<PC::VerifierKey, ConstraintF> + Clone + Into<Self::VerifierKeyVar>;
type CommitmentVar: AllocGadget<PC::Commitment, ConstraintF> + Clone + ToBytesGadget<ConstraintF> + ToConstraintFieldGadget<ConstraintF> + PrepareGadget<Self::PreparedCommitmentVar, ConstraintF> + ToMinimalBitsGadget<ConstraintF>;
type PreparedCommitmentVar: AllocGadget<PC::PreparedCommitment, ConstraintF> + Clone;
type LabeledCommitmentVar: AllocGadget<LabeledCommitment<PC::Commitment>, ConstraintF> + Clone;
type PreparedLabeledCommitmentVar: Clone;
type ProofVar: AllocGadget<PC::Proof, ConstraintF> + Clone;
type BatchLCProofVar: AllocGadget<BatchLCProof<PCF, ConstraintF, PC>, ConstraintF> + Clone;
fn prepared_check_combinations<CS: ConstraintSystem<ConstraintF>>(
cs: CS,
prepared_verification_key: &Self::PreparedVerifierKeyVar,
linear_combinations: &[LinearCombinationVar<PCF, ConstraintF>],
prepared_commitments: &[Self::PreparedLabeledCommitmentVar],
query_set: &QuerySetVar<PCF, ConstraintF>,
evaluations: &EvaluationsVar<PCF, ConstraintF>,
proof: &Self::BatchLCProofVar,
rand_data: &PCCheckRandomDataVar<PCF, ConstraintF>
) -> Result<Boolean, SynthesisError>;
fn create_labeled_commitment(
label: String,
commitment: Self::CommitmentVar,
degree_bound: Option<FpGadget<ConstraintF>>
) -> Self::LabeledCommitmentVar;
fn create_prepared_labeled_commitment(
label: String,
commitment: Self::PreparedCommitmentVar,
degree_bound: Option<FpGadget<ConstraintF>>
) -> Self::PreparedLabeledCommitmentVar;
}
Expand description
Describes the interface for a gadget for a PolynomialCommitment
verifier.
Associated Types
type VerifierKeyVar: AllocGadget<PC::VerifierKey, ConstraintF> + Clone + ToBytesGadget<ConstraintF> + ToConstraintFieldGadget<ConstraintF> + PrepareGadget<Self::PreparedVerifierKeyVar, ConstraintF>
type VerifierKeyVar: AllocGadget<PC::VerifierKey, ConstraintF> + Clone + ToBytesGadget<ConstraintF> + ToConstraintFieldGadget<ConstraintF> + PrepareGadget<Self::PreparedVerifierKeyVar, ConstraintF>
An allocated version of PC::VerifierKey
.
type PreparedVerifierKeyVar: AllocGadget<PC::PreparedVerifierKey, ConstraintF> + AllocGadget<PC::VerifierKey, ConstraintF> + Clone + Into<Self::VerifierKeyVar>
type PreparedVerifierKeyVar: AllocGadget<PC::PreparedVerifierKey, ConstraintF> + AllocGadget<PC::VerifierKey, ConstraintF> + Clone + Into<Self::VerifierKeyVar>
An allocated version of PC::PreparedVerifierKey
.
type CommitmentVar: AllocGadget<PC::Commitment, ConstraintF> + Clone + ToBytesGadget<ConstraintF> + ToConstraintFieldGadget<ConstraintF> + PrepareGadget<Self::PreparedCommitmentVar, ConstraintF> + ToMinimalBitsGadget<ConstraintF>
type CommitmentVar: AllocGadget<PC::Commitment, ConstraintF> + Clone + ToBytesGadget<ConstraintF> + ToConstraintFieldGadget<ConstraintF> + PrepareGadget<Self::PreparedCommitmentVar, ConstraintF> + ToMinimalBitsGadget<ConstraintF>
An allocated version of PC::Commitment
.
type PreparedCommitmentVar: AllocGadget<PC::PreparedCommitment, ConstraintF> + Clone
type PreparedCommitmentVar: AllocGadget<PC::PreparedCommitment, ConstraintF> + Clone
An allocated version of PC::PreparedCommitment
.
type LabeledCommitmentVar: AllocGadget<LabeledCommitment<PC::Commitment>, ConstraintF> + Clone
type LabeledCommitmentVar: AllocGadget<LabeledCommitment<PC::Commitment>, ConstraintF> + Clone
An allocated version of LabeledCommitment<PC::Commitment>
.
A prepared, allocated version of LabeledCommitment<PC::Commitment>
.
type ProofVar: AllocGadget<PC::Proof, ConstraintF> + Clone
type ProofVar: AllocGadget<PC::Proof, ConstraintF> + Clone
An allocated version of PC::Proof
.
type BatchLCProofVar: AllocGadget<BatchLCProof<PCF, ConstraintF, PC>, ConstraintF> + Clone
type BatchLCProofVar: AllocGadget<BatchLCProof<PCF, ConstraintF, PC>, ConstraintF> + Clone
An allocated version of PC::BatchLCProof
.
Required methods
fn prepared_check_combinations<CS: ConstraintSystem<ConstraintF>>(
cs: CS,
prepared_verification_key: &Self::PreparedVerifierKeyVar,
linear_combinations: &[LinearCombinationVar<PCF, ConstraintF>],
prepared_commitments: &[Self::PreparedLabeledCommitmentVar],
query_set: &QuerySetVar<PCF, ConstraintF>,
evaluations: &EvaluationsVar<PCF, ConstraintF>,
proof: &Self::BatchLCProofVar,
rand_data: &PCCheckRandomDataVar<PCF, ConstraintF>
) -> Result<Boolean, SynthesisError>
fn prepared_check_combinations<CS: ConstraintSystem<ConstraintF>>(
cs: CS,
prepared_verification_key: &Self::PreparedVerifierKeyVar,
linear_combinations: &[LinearCombinationVar<PCF, ConstraintF>],
prepared_commitments: &[Self::PreparedLabeledCommitmentVar],
query_set: &QuerySetVar<PCF, ConstraintF>,
evaluations: &EvaluationsVar<PCF, ConstraintF>,
proof: &Self::BatchLCProofVar,
rand_data: &PCCheckRandomDataVar<PCF, ConstraintF>
) -> Result<Boolean, SynthesisError>
Add to ConstraintSystem<ConstraintF>
new constraints that conditionally check that proof
is a valid evaluation
proof at the points in query_set
for the combinations linear_combinations
.
fn create_labeled_commitment(
label: String,
commitment: Self::CommitmentVar,
degree_bound: Option<FpGadget<ConstraintF>>
) -> Self::LabeledCommitmentVar
fn create_labeled_commitment(
label: String,
commitment: Self::CommitmentVar,
degree_bound: Option<FpGadget<ConstraintF>>
) -> Self::LabeledCommitmentVar
Create the labeled commitment gadget from the commitment gadget
fn create_prepared_labeled_commitment(
label: String,
commitment: Self::PreparedCommitmentVar,
degree_bound: Option<FpGadget<ConstraintF>>
) -> Self::PreparedLabeledCommitmentVar
fn create_prepared_labeled_commitment(
label: String,
commitment: Self::PreparedCommitmentVar,
degree_bound: Option<FpGadget<ConstraintF>>
) -> Self::PreparedLabeledCommitmentVar
Create the prepared labeled commitment gadget from the commitment gadget