Skip to content

Commit

Permalink
chore(backward): adds a test for proven list versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
nsarlin-zama committed Sep 12, 2024
1 parent 2e9acf1 commit f955b3f
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions tfhe/tests/backward_compatibility/high_level_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ use tfhe::backward_compatibility::integers::{

use tfhe::prelude::{CiphertextList, FheDecrypt, FheEncrypt};
use tfhe::shortint::PBSParameters;
#[cfg(feature = "zk-pok")]
use tfhe::ProvenCompactCiphertextList;
use tfhe::{
set_server_key, ClientKey, CompactCiphertextList, CompressedCiphertextList,
CompressedCompactPublicKey, CompressedFheBool, CompressedFheInt8, CompressedFheUint8,
Expand Down Expand Up @@ -261,7 +263,6 @@ pub fn test_hl_bool_ciphertext_list(

/// Test HL ciphertext list: loads the ciphertext list and compare the decrypted values to the ones
/// in the metadata.

pub fn test_hl_heterogeneous_ciphertext_list(
dir: &Path,
test: &HlHeterogeneousCiphertextListTest,
Expand All @@ -279,9 +280,26 @@ pub fn test_hl_heterogeneous_ciphertext_list(
if test.compressed {
let list: CompressedCiphertextList = load_and_unversionize(dir, test, format)?;
test_hl_heterogeneous_ciphertext_list_elements(list, &key, test)
} else if test.proven {
#[cfg(feature = "zk-pok")]
{
let list: ProvenCompactCiphertextList = load_and_unversionize(dir, test, format)?;
test_hl_heterogeneous_ciphertext_list_elements(
list.verify_and_expand()
.map_err(|msg| test.failure(msg, format))?,
&key,
test,
)
}
#[cfg(not(feature = "zk-pok"))]
Ok(())
} else {
let list: CompactCiphertextList = load_and_unversionize(dir, test, format)?;
test_hl_heterogeneous_ciphertext_list_elements(list.expand().unwrap(), &key, test)
test_hl_heterogeneous_ciphertext_list_elements(
list.expand().map_err(|msg| test.failure(msg, format))?,
&key,
test,
)
}
.map(|_| test.success(format))
.map_err(|msg| test.failure(msg, format))
Expand Down

0 comments on commit f955b3f

Please sign in to comment.