Skip to content

Commit

Permalink
feat(hl): add serialize/versionize for hl KSK
Browse files Browse the repository at this point in the history
  • Loading branch information
nsarlin-zama committed Jul 17, 2024
1 parent 35201b0 commit 8d6bf42
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tfhe/src/high_level_api/backward_compatibility/keys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,8 @@ pub(in crate::high_level_api) enum IntegerCompactPublicKeyVersions {
pub(in crate::high_level_api) enum IntegerCompressedCompactPublicKeyVersions {
V0(IntegerCompressedCompactPublicKey),
}

#[derive(VersionsDispatch)]
pub enum KeySwitchingKeyVersions {
V0(KeySwitchingKey),
}
5 changes: 5 additions & 0 deletions tfhe/src/high_level_api/keys/key_switching_key.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
use tfhe_versionable::Versionize;

use crate::backward_compatibility::keys::KeySwitchingKeyVersions;
use crate::high_level_api::integers::{FheIntId, FheUintId};
use crate::integer::BooleanBlock;
use crate::prelude::FheKeyswitch;
Expand All @@ -16,6 +19,8 @@ impl Display for IncompatibleParameters {

impl std::error::Error for IncompatibleParameters {}

#[derive(serde::Deserialize, serde::Serialize, Versionize)]
#[versionize(KeySwitchingKeyVersions)]
pub struct KeySwitchingKey {
key: crate::integer::key_switching_key::KeySwitchingKey,
}
Expand Down

0 comments on commit 8d6bf42

Please sign in to comment.