Skip to content

Commit

Permalink
chore: feature gating js_high_level_api
Browse files Browse the repository at this point in the history
  • Loading branch information
mayeul-zama committed Jan 17, 2025
1 parent 1976a9d commit 1d98b28
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
5 changes: 2 additions & 3 deletions tfhe/src/js_on_wasm_api/js_high_level_api/mod.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
use wasm_bindgen::prelude::*;

pub(crate) mod config;

pub(crate) mod integers;
// using Self does not work well with #[wasm_bindgen] macro
#[allow(clippy::use_self)]
pub(crate) mod keys;
#[cfg(feature = "zk-pok")]
mod zk;

pub(crate) fn into_js_error<E: std::fmt::Debug>(e: E) -> wasm_bindgen::JsError {
wasm_bindgen::JsError::new(format!("{e:?}").as_str())
}
use super::into_js_error;

pub(crate) fn catch_panic_result<F, R>(closure: F) -> Result<R, JsError>
where
Expand Down
5 changes: 5 additions & 0 deletions tfhe/src/js_on_wasm_api/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,9 @@ mod boolean;
#[cfg(feature = "parallel-wasm-api")]
pub use wasm_bindgen_rayon::init_thread_pool;

#[cfg(feature = "integer")]
mod js_high_level_api;

pub(crate) fn into_js_error<E: std::fmt::Debug>(e: E) -> wasm_bindgen::JsError {
wasm_bindgen::JsError::new(format!("{e:?}").as_str())
}
2 changes: 1 addition & 1 deletion tfhe/src/js_on_wasm_api/shortint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
use crate::core_crypto::commons::generators::DeterministicSeeder;
use crate::core_crypto::commons::math::random::Seed;
use crate::core_crypto::prelude::DefaultRandomGenerator;
use crate::js_on_wasm_api::js_high_level_api::into_js_error;
use crate::js_on_wasm_api::into_js_error;
use crate::shortint::parameters::classic::compact_pk::*;
use crate::shortint::parameters::compact_public_key_only::p_fail_2_minus_64::ks_pbs::{
V0_11_PARAM_PKE_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
Expand Down

0 comments on commit 1d98b28

Please sign in to comment.