mirror of
https://github.com/zama-ai/tfhe-rs.git
synced 2026-01-10 07:08:03 -05:00
chore(tfhe): derive PartialEq and Eq for all entities by default
This commit is contained in:
@@ -2,7 +2,7 @@ use crate::core_crypto::commons::parameters::*;
|
||||
use crate::core_crypto::commons::traits::*;
|
||||
use crate::core_crypto::entities::*;
|
||||
|
||||
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
|
||||
pub struct GgswCiphertext<C: Container> {
|
||||
data: C,
|
||||
polynomial_size: PolynomialSize,
|
||||
|
||||
@@ -2,7 +2,7 @@ use crate::core_crypto::commons::parameters::*;
|
||||
use crate::core_crypto::commons::traits::*;
|
||||
use crate::core_crypto::entities::*;
|
||||
|
||||
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
|
||||
pub struct GgswCiphertextList<C: Container> {
|
||||
data: C,
|
||||
glwe_size: GlweSize,
|
||||
|
||||
@@ -2,7 +2,7 @@ use crate::core_crypto::commons::parameters::*;
|
||||
use crate::core_crypto::commons::traits::*;
|
||||
use crate::core_crypto::entities::*;
|
||||
|
||||
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
|
||||
pub struct GlweBody<C: Container> {
|
||||
data: C,
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ use crate::core_crypto::commons::parameters::*;
|
||||
use crate::core_crypto::commons::traits::*;
|
||||
use crate::core_crypto::entities::*;
|
||||
|
||||
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
|
||||
pub struct GlweCiphertextList<C: Container> {
|
||||
data: C,
|
||||
polynomial_size: PolynomialSize,
|
||||
|
||||
@@ -2,7 +2,7 @@ use crate::core_crypto::commons::parameters::*;
|
||||
use crate::core_crypto::commons::traits::*;
|
||||
use crate::core_crypto::entities::*;
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
|
||||
pub struct GlweSecretKey<C: Container> {
|
||||
data: C,
|
||||
polynomial_size: PolynomialSize,
|
||||
|
||||
@@ -4,7 +4,7 @@ use crate::core_crypto::entities::*;
|
||||
|
||||
// An LweBootstrapKey is literally a GgswCiphertextList, so we wrap a GgswCiphetextList and use
|
||||
// Deref to have access to all the primitives of the GgswCiphertextList easily
|
||||
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
|
||||
pub struct LweBootstrapKey<C: Container> {
|
||||
ggsw_list: GgswCiphertextList<C>,
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ impl<T, C: ContainerMut<Element = T>> AsMut<[T]> for LweMask<C> {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
|
||||
pub struct LweCiphertext<C: Container> {
|
||||
data: C,
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ use crate::core_crypto::commons::parameters::*;
|
||||
use crate::core_crypto::commons::traits::*;
|
||||
use crate::core_crypto::entities::*;
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
|
||||
pub struct LweCiphertextList<C: Container> {
|
||||
data: C,
|
||||
lwe_size: LweSize,
|
||||
|
||||
@@ -2,7 +2,7 @@ use crate::core_crypto::commons::parameters::*;
|
||||
use crate::core_crypto::commons::traits::*;
|
||||
use crate::core_crypto::entities::*;
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
|
||||
pub struct LweKeyswitchKey<C: Container> {
|
||||
data: C,
|
||||
decomp_base_log: DecompositionBaseLog,
|
||||
|
||||
@@ -2,7 +2,7 @@ use crate::core_crypto::commons::parameters::*;
|
||||
use crate::core_crypto::commons::traits::*;
|
||||
use crate::core_crypto::entities::*;
|
||||
|
||||
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
|
||||
pub struct LwePrivateFunctionalPackingKeyswitchKey<C: Container> {
|
||||
data: C,
|
||||
decomp_base_log: DecompositionBaseLog,
|
||||
|
||||
@@ -2,7 +2,7 @@ use crate::core_crypto::commons::parameters::*;
|
||||
use crate::core_crypto::commons::traits::*;
|
||||
use crate::core_crypto::entities::*;
|
||||
|
||||
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
|
||||
pub struct LwePrivateFunctionalPackingKeyswitchKeyList<C: Container> {
|
||||
data: C,
|
||||
decomp_base_log: DecompositionBaseLog,
|
||||
|
||||
@@ -4,7 +4,7 @@ use crate::core_crypto::entities::*;
|
||||
|
||||
// An LwePublicKey is literally an LweCiphertextList, so we wrap an LweCiphertextList and use
|
||||
// Deref to have access to all the primitives of the LweCiphertextList easily
|
||||
#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
|
||||
pub struct LwePublicKey<C: Container> {
|
||||
lwe_list: LweCiphertextList<C>,
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use crate::core_crypto::commons::parameters::LweDimension;
|
||||
use crate::core_crypto::commons::traits::*;
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
|
||||
pub struct LweSecretKey<C: Container> {
|
||||
data: C,
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ use crate::core_crypto::commons::parameters::*;
|
||||
use crate::core_crypto::commons::traits::*;
|
||||
use crate::core_crypto::entities::*;
|
||||
|
||||
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
|
||||
pub struct PlaintextList<C: Container> {
|
||||
data: C,
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ use crate::core_crypto::commons::parameters::*;
|
||||
use crate::core_crypto::commons::traits::*;
|
||||
use std::ops::{Deref, DerefMut};
|
||||
|
||||
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
|
||||
pub struct Polynomial<C: Container> {
|
||||
data: C,
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ use crate::core_crypto::commons::parameters::*;
|
||||
use crate::core_crypto::commons::traits::*;
|
||||
use crate::core_crypto::entities::*;
|
||||
|
||||
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
|
||||
pub struct PolynomialList<C: Container> {
|
||||
data: C,
|
||||
polynomial_size: PolynomialSize,
|
||||
|
||||
Reference in New Issue
Block a user