Skip to content

Commit

Permalink
Add FastMSM tips when not init (#264)
Browse files Browse the repository at this point in the history
* Add FastMSM tips when not init

* Fix the features
  • Loading branch information
findora-sun authored Apr 25, 2023
1 parent ed3322b commit 5bfef83
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions algebra/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ rayon = { version = "1", optional = true }

[target.'cfg(target_arch = "wasm32")'.dependencies]
js-sys = "0.3.27"
web-sys = { version = "0.3.61", features = [ "console" ] }
wasm-bindgen-futures = "0.4.23"
tokio = { version = "1.10.1", features = ['rt'] }
wasm-rs-async-executor = "0.9.0"
Expand Down
1 change: 1 addition & 0 deletions algebra/src/bls12_381/g1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ impl Group for BLSG1 {
// unsafe here is alright because WASM is single threaded
unsafe {
if WASM_INSTANCE.is_none() {
web_sys::console::log_1(&"FastMSM for WASM has not been initialized, and the proof generation will use the Rust-based implementation. To initialize FastMSM, call the async WASM function `init_noah()` to initialize the Noah library before proof generation.".into());
return Self::common_multi_exp(scalars, points);
}

Expand Down

0 comments on commit 5bfef83

Please sign in to comment.