From 55f6736866d2c166b6f71763840bbba9fb70b0a8 Mon Sep 17 00:00:00 2001 From: Samuel Burnham <45365069+samuelburnham@users.noreply.github.com> Date: Mon, 30 Jan 2023 14:31:36 -0500 Subject: [PATCH] Add Wasm support (#125) * Add Wasm support * Use SeedableRng for Wasm randomness * Fix tests * Formatting --- Cargo.toml | 10 +++++----- src/pasta.rs | 3 +-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 05fcddd..feb1ef5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,6 @@ keywords = ["zkSNARKs", "cryptography", "proofs"] bellperson = { version = "0.24", default-features = false } ff = { version = "0.12.0", features = ["derive"]} merlin = "2.0.0" -rand = "0.8.4" digest = "0.8.1" sha3 = "0.8.2" rayon = "1.3.0" @@ -34,8 +33,12 @@ flate2 = "1.0" bitvec = "1.0" byteorder = "1.4.3" +[target.'cfg(any(target_arch = "x86_64", target_arch = "aarch64"))'.dependencies] +pasta-msm = "0.1.3" + [dev-dependencies] criterion = "0.3.1" +rand = "0.8.4" [[bench]] name = "recursive-snark" @@ -46,7 +49,4 @@ name = "compressed-snark" harness = false [features] -default = ["bellperson/default", "neptune/default"] - -[target.'cfg(any(target_arch = "x86_64", target_arch = "aarch64"))'.dependencies] -pasta-msm = "0.1.3" +default = [ "bellperson/default", "neptune/default" ] diff --git a/src/pasta.rs b/src/pasta.rs index a4610ae..7bf0681 100644 --- a/src/pasta.rs +++ b/src/pasta.rs @@ -14,8 +14,7 @@ use pasta_curves::{ group::{Curve, Group as AnotherGroup, GroupEncoding}, pallas, vesta, Ep, Eq, }; -use rand::SeedableRng; -use rand_chacha::ChaCha20Rng; +use rand_chacha::{rand_core::SeedableRng, ChaCha20Rng}; use sha3::Shake256; use std::io::Read;