Migrate usage from E:Pairing to F:PrimeField when Pairing is not needed

The motivation to do so, is so we can use the witness generation with
other curves that don't have pairings (and hence the Pairing trait
implemented).
This commit is contained in:
2024-02-22 11:15:49 +01:00
parent 170b10fc9e
commit 5f8cfd49be
8 changed files with 73 additions and 79 deletions

View File

@@ -2,7 +2,7 @@ use ark_circom::{CircomBuilder, CircomConfig};
use ark_std::rand::thread_rng;
use color_eyre::Result;
use ark_bn254::Bn254;
use ark_bn254::{Bn254, Fr};
use ark_crypto_primitives::snark::SNARK;
use ark_groth16::Groth16;
@@ -10,7 +10,7 @@ type GrothBn = Groth16<Bn254>;
#[test]
fn groth16_proof() -> Result<()> {
let cfg = CircomConfig::<Bn254>::new(
let cfg = CircomConfig::<Fr>::new(
"./test-vectors/mycircuit.wasm",
"./test-vectors/mycircuit.r1cs",
)?;
@@ -41,7 +41,7 @@ fn groth16_proof() -> Result<()> {
#[test]
fn groth16_proof_wrong_input() {
let cfg = CircomConfig::<Bn254>::new(
let cfg = CircomConfig::<Fr>::new(
"./test-vectors/mycircuit.wasm",
"./test-vectors/mycircuit.r1cs",
)
@@ -63,7 +63,7 @@ fn groth16_proof_wrong_input() {
#[test]
#[cfg(feature = "circom-2")]
fn groth16_proof_circom2() -> Result<()> {
let cfg = CircomConfig::<Bn254>::new(
let cfg = CircomConfig::<Fr>::new(
"./test-vectors/circom2_multiplier2.wasm",
"./test-vectors/circom2_multiplier2.r1cs",
)?;
@@ -95,7 +95,7 @@ fn groth16_proof_circom2() -> Result<()> {
#[test]
#[cfg(feature = "circom-2")]
fn witness_generation_circom2() -> Result<()> {
let cfg = CircomConfig::<Bn254>::new(
let cfg = CircomConfig::<Fr>::new(
"./test-vectors/circom2_multiplier2.wasm",
"./test-vectors/circom2_multiplier2.r1cs",
)?;

View File

@@ -2,7 +2,7 @@ use ark_circom::{ethereum, CircomBuilder, CircomConfig};
use ark_std::rand::thread_rng;
use color_eyre::Result;
use ark_bn254::Bn254;
use ark_bn254::{Bn254, Fr};
use ark_crypto_primitives::snark::SNARK;
use ark_groth16::Groth16;
@@ -16,7 +16,7 @@ use std::{convert::TryFrom, sync::Arc};
#[tokio::test]
async fn solidity_verifier() -> Result<()> {
let cfg = CircomConfig::<Bn254>::new(
let cfg = CircomConfig::<Fr>::new(
"./test-vectors/mycircuit.wasm",
"./test-vectors/mycircuit.r1cs",
)?;