Skip to content

Commit

Permalink
Use BufReader for loading R1CS file (#79)
Browse files Browse the repository at this point in the history
Co-authored-by: Bruno Valente <[email protected]>
  • Loading branch information
Pratyush and bruno-valante authored Oct 25, 2024
1 parent dbc38c5 commit 89b1327
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/circom/builder.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
use std::{fs::File, path::Path};
use wasmer::Store;

use ark_ff::PrimeField;
use num_bigint::BigInt;
use std::{collections::HashMap, fs::File, io::BufReader, path::Path};
use wasmer::Store;

use super::{CircomCircuit, R1CS};

use num_bigint::BigInt;
use std::collections::HashMap;

use crate::{
circom::R1CSFile,
witness::{Wasm, WitnessCalculator},
Expand All @@ -33,7 +30,7 @@ impl<F: PrimeField> CircomConfig<F> {
pub fn new(wtns: impl AsRef<Path>, r1cs: impl AsRef<Path>) -> Result<Self> {
let mut store = Store::default();
let wtns = WitnessCalculator::new(&mut store, wtns).unwrap();
let reader = File::open(r1cs)?;
let reader = BufReader::new(File::open(r1cs)?);
let r1cs = R1CSFile::new(reader)?.into();
Ok(Self {
wtns,
Expand Down

0 comments on commit 89b1327

Please sign in to comment.