From 87b8855a8ac3f83410ced0e079fd1ed2fc8860fe Mon Sep 17 00:00:00 2001 From: Bruno Valente <140794260+bruno-valante@users.noreply.github.com> Date: Fri, 28 Jun 2024 00:18:14 +0800 Subject: [PATCH] Use BufReader for loading R1CS file --- src/circom/builder.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/circom/builder.rs b/src/circom/builder.rs index 670e22b..76a8634 100644 --- a/src/circom/builder.rs +++ b/src/circom/builder.rs @@ -1,5 +1,5 @@ use ark_ec::pairing::Pairing; -use std::{fs::File, path::Path}; +use std::{fs::File, io::BufReader, path::Path}; use super::{CircomCircuit, R1CS}; @@ -26,7 +26,7 @@ pub struct CircomConfig { impl CircomConfig { pub fn new(wtns: impl AsRef, r1cs: impl AsRef) -> Result { let wtns = WitnessCalculator::new(wtns).unwrap(); - let reader = File::open(r1cs)?; + let reader = BufReader::new(File::open(r1cs)?); let r1cs = R1CSFile::new(reader)?.into(); Ok(Self { wtns,