-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(backward): use the Deprecated type from tfhe-versionable
- Loading branch information
1 parent
38f81a7
commit 64cc70d
Showing
9 changed files
with
75 additions
and
224 deletions.
There are no files selected for viewing
24 changes: 8 additions & 16 deletions
24
tfhe/src/core_crypto/backward_compatibility/entities/seeded_lwe_keyswitch_key.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,21 @@ | ||
use tfhe_versionable::{Upgrade, Version, VersionsDispatch}; | ||
use tfhe_versionable::deprecation::{Deprecable, Deprecated}; | ||
use tfhe_versionable::VersionsDispatch; | ||
|
||
use crate::core_crypto::prelude::{Container, SeededLweKeyswitchKey, UnsignedInteger}; | ||
|
||
#[derive(Version)] | ||
pub struct UnsupportedSeededLweKeyswitchKeyV0; | ||
|
||
impl<Scalar: UnsignedInteger, C: Container<Element = Scalar>> Upgrade<SeededLweKeyswitchKey<C>> | ||
for UnsupportedSeededLweKeyswitchKeyV0 | ||
impl<C: Container> Deprecable for SeededLweKeyswitchKey<C> | ||
where | ||
C::Element: UnsignedInteger, | ||
{ | ||
type Error = crate::Error; | ||
|
||
fn upgrade(self) -> Result<SeededLweKeyswitchKey<C>, Self::Error> { | ||
Err(crate::Error::new( | ||
"Unable to load SeededLweKeyswitchKey, \ | ||
this format is unsupported by this TFHE-rs version." | ||
.to_string(), | ||
)) | ||
} | ||
const TYPE_NAME: &'static str = "SeededLweKeyswitchKey"; | ||
const MIN_SUPPORTED_APP_VERSION: &'static str = "TFHE-rs v0.9"; | ||
} | ||
|
||
#[derive(VersionsDispatch)] | ||
pub enum SeededLweKeyswitchKeyVersions<C: Container> | ||
where | ||
C::Element: UnsignedInteger, | ||
{ | ||
V0(UnsupportedSeededLweKeyswitchKeyV0), | ||
V0(Deprecated<SeededLweKeyswitchKey<C>>), | ||
V1(SeededLweKeyswitchKey<C>), | ||
} |
24 changes: 8 additions & 16 deletions
24
tfhe/src/core_crypto/backward_compatibility/entities/seeded_lwe_packing_keyswitch_key.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,21 @@ | ||
use tfhe_versionable::{Upgrade, Version, VersionsDispatch}; | ||
use tfhe_versionable::deprecation::{Deprecable, Deprecated}; | ||
use tfhe_versionable::VersionsDispatch; | ||
|
||
use crate::core_crypto::prelude::{Container, SeededLwePackingKeyswitchKey, UnsignedInteger}; | ||
|
||
#[derive(Version)] | ||
pub struct UnsupportedSeededLwePackingKeyswitchKeyV0; | ||
|
||
impl<Scalar: UnsignedInteger, C: Container<Element = Scalar>> | ||
Upgrade<SeededLwePackingKeyswitchKey<C>> for UnsupportedSeededLwePackingKeyswitchKeyV0 | ||
impl<C: Container> Deprecable for SeededLwePackingKeyswitchKey<C> | ||
where | ||
C::Element: UnsignedInteger, | ||
{ | ||
type Error = crate::Error; | ||
|
||
fn upgrade(self) -> Result<SeededLwePackingKeyswitchKey<C>, Self::Error> { | ||
Err(crate::Error::new( | ||
"Unable to load SeededLwePackingKeyswitchKey, \ | ||
this format is unsupported by this TFHE-rs version." | ||
.to_string(), | ||
)) | ||
} | ||
const TYPE_NAME: &'static str = "SeededLwePackingKeyswitchKey"; | ||
const MIN_SUPPORTED_APP_VERSION: &'static str = "TFHE-rs v0.9"; | ||
} | ||
|
||
#[derive(VersionsDispatch)] | ||
pub enum SeededLwePackingKeyswitchKeyVersions<C: Container> | ||
where | ||
C::Element: UnsignedInteger, | ||
{ | ||
V0(UnsupportedSeededLwePackingKeyswitchKeyV0), | ||
V0(Deprecated<SeededLwePackingKeyswitchKey<C>>), | ||
V1(SeededLwePackingKeyswitchKey<C>), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.