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

Ns/chore/clean traits #1901

Open
wants to merge 2 commits 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
1 change: 0 additions & 1 deletion tfhe/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,6 @@ crate-type = ["lib", "staticlib", "cdylib"]

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = [
'cfg(bench)',
'cfg(tarpaulin)',
'cfg(tfhe_lints)',
# This is a bug/unwanted behavior from wasm_bindgen macro, for now warn instead of erroring
Expand Down
8 changes: 0 additions & 8 deletions tfhe/src/core_crypto/commons/ciphertext_modulus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,6 @@ enum CiphertextModulusInner {
Custom(NonZeroU128),
}

#[cfg(bench)]
impl Default for CiphertextModulusInner {
fn default() -> Self {
CiphertextModulusInner::Native
}
}

#[derive(Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize, Versionize)]
#[serde(
try_from = "SerializableCiphertextModulus",
Expand All @@ -37,7 +30,6 @@ impl Default for CiphertextModulusInner {
try_from = "SerializableCiphertextModulus",
into = "SerializableCiphertextModulus"
)]
#[cfg_attr(bench, derive(Default))]
/// Structure representing a [`CiphertextModulus`] often noted $q$.
pub struct CiphertextModulus<Scalar: UnsignedInteger> {
inner: CiphertextModulusInner,
Expand Down
8 changes: 4 additions & 4 deletions tfhe/src/high_level_api/prelude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
//! use tfhe::prelude::*;
//! ```
pub use crate::high_level_api::traits::{
BitSlice, CiphertextList, DivRem, FheBootstrap, FheDecrypt, FheEncrypt, FheEq, FheKeyswitch,
FheMax, FheMin, FheNumberConstant, FheOrd, FheTrivialEncrypt, FheTryEncrypt,
FheTryTrivialEncrypt, IfThenElse, OverflowingAdd, OverflowingMul, OverflowingSub, RotateLeft,
RotateLeftAssign, RotateRight, RotateRightAssign, Tagged,
BitSlice, CiphertextList, DivRem, FheDecrypt, FheEncrypt, FheEq, FheKeyswitch, FheMax, FheMin,
FheOrd, FheTrivialEncrypt, FheTryEncrypt, FheTryTrivialEncrypt, IfThenElse, OverflowingAdd,
OverflowingMul, OverflowingSub, RotateLeft, RotateLeftAssign, RotateRight, RotateRightAssign,
Tagged,
};

pub use crate::conformance::ParameterSetConformant;
Expand Down
22 changes: 0 additions & 22 deletions tfhe/src/high_level_api/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,28 +112,6 @@ pub trait FheMax<Rhs = Self> {
fn max(&self, other: Rhs) -> Self::Output;
}

/// Trait required to apply univariate function over homomorphic types.
///
/// A `univariate function` is a function with one variable, e.g., of the form f(x).
pub trait FheBootstrap
where
Self: Sized,
{
/// Compute a function over an encrypted message, and returns a new encrypted value containing
/// the result.
fn map<F: Fn(u64) -> u64>(&self, func: F) -> Self;

/// Compute a function over the encrypted message.
fn apply<F: Fn(u64) -> u64>(&mut self, func: F);
}

#[doc(hidden)]
pub trait FheNumberConstant {
const MIN: u64;
const MAX: u64;
const MODULUS: u64;
}

pub trait RotateLeft<Rhs = Self> {
type Output;

Expand Down
Loading