Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: feature gating js_high_level_api #1984

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading