Skip to content

Commit

Permalink
use home, non-wasm builds
Browse files Browse the repository at this point in the history
  • Loading branch information
Hanting Zhang committed Feb 20, 2024
1 parent 1fbe4af commit a7901e3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ camino = "1.1.6"
# grumpkin-msm has been patched to support MSMs for the pasta curve cycle
# see: https://github.com/lurk-lab/grumpkin-msm/pull/3
grumpkin-msm = { git = "https://github.com/lurk-lab/grumpkin-msm", branch = "dev" }
home = "0.5.9"

[target.'cfg(target_arch = "wasm32")'.dependencies]
# see https://github.com/rust-random/rand/pull/948
Expand Down
3 changes: 2 additions & 1 deletion src/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ pub struct DataConfig {
/// Initializes the global configuration for Arecibo data storage, setting up the root directory
/// and initializing counters. We create the root directory if it does not already exist.
pub fn init_config() -> DataConfig {
let root_dir = Utf8PathBuf::from(ARECIBO_DATA);
let root_dir = home::home_dir().unwrap().join(ARECIBO_DATA);
let root_dir = Utf8PathBuf::from_path_buf(root_dir).unwrap();
if !root_dir.exists() {
fs::create_dir_all(&root_dir).expect("Failed to create arecibo data directory");
}
Expand Down
8 changes: 7 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,22 @@ pub mod r1cs;
pub mod spartan;
pub mod traits;

#[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))]
pub mod data;
pub mod supernova;

use once_cell::sync::OnceCell;
use traits::{CurveCycleEquipped, Dual};

#[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))]
use crate::data::{write_arecibo_data, write_data};
use crate::digest::{DigestComputer, SimpleDigestible};
use crate::{
bellpepper::{
r1cs::{NovaShape, NovaWitness},
shape_cs::ShapeCS,
solver::SatisfyingAssignment,
},
data::{write_arecibo_data, write_data},
r1cs::R1CSResult,
};
use abomonation::Abomonation;
Expand Down Expand Up @@ -496,7 +498,10 @@ where
};

let config = RecursiveSNARKConfig {
#[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))]
write_data: write_data(),
#[cfg(not(any(target_arch = "x86_64", target_arch = "aarch64")))]
write_data: false,
};

Ok(Self {
Expand Down Expand Up @@ -606,6 +611,7 @@ where
&mut self.buffer_primary.ABC_Z_2,
)?;

#[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))]
if self.config.write_data {
let W = l_w_primary.W;
write_arecibo_data(
Expand Down

0 comments on commit a7901e3

Please sign in to comment.