Skip to content

Commit

Permalink
Revert "add constraint test"
Browse files Browse the repository at this point in the history
This reverts commit 728b240.
  • Loading branch information
liuxiaobleach committed Mar 18, 2024
1 parent 728b240 commit 6b05353
Showing 1 changed file with 0 additions and 33 deletions.
33 changes: 0 additions & 33 deletions std/recursion/groth16/verifier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,39 +131,6 @@ func TestBLS12InBW6(t *testing.T) {
assert.NoError(err)
}

func TestBLS12InBW6WithConstraint(t *testing.T) {
assert := test.NewAssert(t)
innerCcs, innerVK, innerWitness, innerProof := getInner(assert, ecc.BLS12_377.ScalarField())

// outer proof
circuitVk, err := ValueOfVerifyingKey[sw_bls12377.G1Affine, sw_bls12377.G2Affine, sw_bls12377.GT](innerVK)
assert.NoError(err)
circuitWitness, err := ValueOfWitness[sw_bls12377.ScalarField](innerWitness)
assert.NoError(err)
circuitProof, err := ValueOfProof[sw_bls12377.G1Affine, sw_bls12377.G2Affine](innerProof)
assert.NoError(err)

outerCircuit := &OuterCircuit[sw_bls12377.ScalarField, sw_bls12377.G1Affine, sw_bls12377.G2Affine, sw_bls12377.GT]{
InnerWitness: PlaceholderWitness[sw_bls12377.ScalarField](innerCcs),
VerifyingKey: PlaceholderVerifyingKey[sw_bls12377.G1Affine, sw_bls12377.G2Affine, sw_bls12377.GT](innerCcs),
Proof: PlaceholderProof[sw_bls12377.G1Affine, sw_bls12377.G2Affine](innerCcs),
}
outerAssignment := &OuterCircuit[sw_bls12377.ScalarField, sw_bls12377.G1Affine, sw_bls12377.G2Affine, sw_bls12377.GT]{
InnerWitness: circuitWitness,
Proof: circuitProof,
VerifyingKey: circuitVk,
}

err = test.IsSolved(outerCircuit, outerAssignment, ecc.BW6_761.ScalarField())
assert.NoError(err)

ccs1, err := frontend.Compile(ecc.BW6_761.ScalarField(), r1cs.NewBuilder, outerCircuit)
assert.NoError(err)
ccs2, err := frontend.Compile(ecc.BW6_761.ScalarField(), r1cs.NewBuilder, outerAssignment)
assert.NoError(err)
fmt.Printf("%d %d", ccs1.GetNbConstraints(), ccs2.GetNbConstraints())
}

func TestBW6InBN254(t *testing.T) {
assert := test.NewAssert(t)
innerCcs, innerVK, innerWitness, innerProof := getInner(assert, ecc.BW6_761.ScalarField())
Expand Down

0 comments on commit 6b05353

Please sign in to comment.