mirror of
https://github.com/logos-storage/circom-compat.git
synced 2026-01-02 13:03:08 +00:00
Use BufReader for loading R1CS file (#79)
Co-authored-by: Bruno Valente <140794260+bruno-valante@users.noreply.github.com>
This commit is contained in:
parent
45bc3743d9
commit
bc60de984f
@ -1,13 +1,10 @@
|
|||||||
use std::{fs::File, path::Path};
|
use ark_ff::PrimeField;
|
||||||
|
use num_bigint::BigInt;
|
||||||
|
use std::{collections::HashMap, fs::File, io::BufReader, path::Path};
|
||||||
use wasmer::Store;
|
use wasmer::Store;
|
||||||
|
|
||||||
use ark_ff::PrimeField;
|
|
||||||
|
|
||||||
use super::{CircomCircuit, R1CS};
|
use super::{CircomCircuit, R1CS};
|
||||||
|
|
||||||
use num_bigint::BigInt;
|
|
||||||
use std::collections::HashMap;
|
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
circom::R1CSFile,
|
circom::R1CSFile,
|
||||||
witness::{Wasm, WitnessCalculator},
|
witness::{Wasm, WitnessCalculator},
|
||||||
@ -33,7 +30,7 @@ impl<F: PrimeField> CircomConfig<F> {
|
|||||||
pub fn new(wtns: impl AsRef<Path>, r1cs: impl AsRef<Path>) -> Result<Self> {
|
pub fn new(wtns: impl AsRef<Path>, r1cs: impl AsRef<Path>) -> Result<Self> {
|
||||||
let mut store = Store::default();
|
let mut store = Store::default();
|
||||||
let wtns = WitnessCalculator::new(&mut store, wtns).unwrap();
|
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();
|
let r1cs = R1CSFile::new(reader)?.into();
|
||||||
Ok(Self {
|
Ok(Self {
|
||||||
wtns,
|
wtns,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user