Skip to content

Commit

Permalink
chore(core_crypto): remove Serde on some decomposition structs
Browse files Browse the repository at this point in the history
- those structures are not expected to be serialized by a user
  • Loading branch information
IceTDrinker committed Jan 10, 2024
1 parent 77c0532 commit 7c50216
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
4 changes: 1 addition & 3 deletions tfhe/src/core_crypto/commons/math/decomposition/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
//! located in the least significant bits, which are already erroneous.
use std::fmt::Debug;

use serde::{Deserialize, Serialize};

pub use decomposer::*;
pub use iter::*;
pub use term::*;
Expand All @@ -35,5 +33,5 @@ mod tests;
///
/// When decomposing an integer over the $l$ levels, this type represent the level (in $[0,l)$)
/// currently manipulated.
#[derive(Debug, PartialEq, Eq, Copy, Clone, Serialize, Deserialize)]
#[derive(Debug, PartialEq, Eq, Copy, Clone)]
pub struct DecompositionLevel(pub usize);
5 changes: 2 additions & 3 deletions tfhe/src/core_crypto/commons/math/decomposition/term.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ use crate::core_crypto::commons::ciphertext_modulus::CiphertextModulus;
use crate::core_crypto::commons::math::decomposition::DecompositionLevel;
use crate::core_crypto::commons::numeric::{Numeric, UnsignedInteger};
use crate::core_crypto::commons::parameters::DecompositionBaseLog;
use serde::{Deserialize, Serialize};
use std::fmt::Debug;

/// A member of the decomposition.
///
/// If we decompose a value $\theta$ as a sum $\sum\_{i=1}^l\tilde{\theta}\_i\frac{q}{B^i}$, this
/// represents a $\tilde{\theta}\_i$.
#[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize)]
#[derive(Debug, PartialEq, Eq, Clone)]
pub struct DecompositionTerm<T>
where
T: UnsignedInteger,
Expand Down Expand Up @@ -93,7 +92,7 @@ where
///
/// If we decompose a value $\theta$ as a sum $\sum\_{i=1}^l\tilde{\theta}\_i\frac{q}{B^i}$, this
/// represents a $\tilde{\theta}\_i$.
#[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize)]
#[derive(Debug, PartialEq, Eq, Clone)]
pub struct DecompositionTermNonNative<T>
where
T: UnsignedInteger,
Expand Down

0 comments on commit 7c50216

Please sign in to comment.