-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tag The `Tag` allows to store bytes alongside of entities (keys, and ciphertext) the main purpose of this system is to `tag` / identify ciphertext with their keys. * When encrypted, a ciphertext gets the tag of the key used to encrypt it. * Ciphertexts resulting from operations (add, sub, etc.) get the tag from the ServerKey used * PublicKey gets its tag from the ClientKey that was used to create it * ServerKey gets its tag from the ClientKey that was used to create it User can change the tag of any entities at any point. BREAKING CHANGE: Many of the into_raw_parts and from_raw_parts changed to accommodate the addition of the `tag``
- Loading branch information
Showing
42 changed files
with
2,242 additions
and
606 deletions.
There are no files selected for viewing
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
22 changes: 19 additions & 3 deletions
22
tfhe/src/high_level_api/backward_compatibility/compact_list.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,8 +1,24 @@ | ||
use tfhe_versionable::VersionsDispatch; | ||
use std::convert::Infallible; | ||
use tfhe_versionable::{Upgrade, Version, VersionsDispatch}; | ||
|
||
use crate::CompactCiphertextList; | ||
use crate::{CompactCiphertextList, Tag}; | ||
|
||
#[derive(Version)] | ||
pub struct CompactCiphertextListV0(crate::integer::ciphertext::CompactCiphertextList); | ||
|
||
impl Upgrade<CompactCiphertextList> for CompactCiphertextListV0 { | ||
type Error = Infallible; | ||
|
||
fn upgrade(self) -> Result<CompactCiphertextList, Self::Error> { | ||
Ok(CompactCiphertextList { | ||
inner: self.0, | ||
tag: Tag::default(), | ||
}) | ||
} | ||
} | ||
|
||
#[derive(VersionsDispatch)] | ||
pub enum CompactCiphertextListVersions { | ||
V0(CompactCiphertextList), | ||
V0(CompactCiphertextListV0), | ||
V1(CompactCiphertextList), | ||
} |
22 changes: 19 additions & 3 deletions
22
tfhe/src/high_level_api/backward_compatibility/compressed_ciphertext_list.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,8 +1,24 @@ | ||
use tfhe_versionable::VersionsDispatch; | ||
use std::convert::Infallible; | ||
use tfhe_versionable::{Upgrade, Version, VersionsDispatch}; | ||
|
||
use crate::CompressedCiphertextList; | ||
use crate::{CompressedCiphertextList, Tag}; | ||
|
||
#[derive(Version)] | ||
pub struct CompressedCiphertextListV0(crate::integer::ciphertext::CompressedCiphertextList); | ||
|
||
impl Upgrade<CompressedCiphertextList> for CompressedCiphertextListV0 { | ||
type Error = Infallible; | ||
|
||
fn upgrade(self) -> Result<CompressedCiphertextList, Self::Error> { | ||
Ok(CompressedCiphertextList { | ||
inner: self.0, | ||
tag: Tag::default(), | ||
}) | ||
} | ||
} | ||
|
||
#[derive(VersionsDispatch)] | ||
pub enum CompressedCiphertextListVersions { | ||
V0(CompressedCiphertextList), | ||
V0(CompressedCiphertextListV0), | ||
V1(CompressedCiphertextList), | ||
} |
Oops, something went wrong.