diff --git a/data/0_7/high_level_api/client_key_with_compression.bcode b/data/0_7/high_level_api/client_key_with_compression.bcode new file mode 100644 index 0000000..cfa2b70 --- /dev/null +++ b/data/0_7/high_level_api/client_key_with_compression.bcode @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f466228bda0eb39feb4dd285355a8447ab40540dc7255167f3b706e4cd0a0e57 +size 246579464 diff --git a/data/0_7/high_level_api/client_key_with_compression.cbor b/data/0_7/high_level_api/client_key_with_compression.cbor new file mode 100644 index 0000000..ca328f2 --- /dev/null +++ b/data/0_7/high_level_api/client_key_with_compression.cbor @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7685373d5af746ad42e85a9517772abfbb1c47ec8275c4510a79d2ece2eefd80 +size 285713294 diff --git a/data/0_7/high_level_api/server_key_with_compression.bcode b/data/0_7/high_level_api/server_key_with_compression.bcode new file mode 100644 index 0000000..cfa2b70 --- /dev/null +++ b/data/0_7/high_level_api/server_key_with_compression.bcode @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f466228bda0eb39feb4dd285355a8447ab40540dc7255167f3b706e4cd0a0e57 +size 246579464 diff --git a/data/0_7/high_level_api/server_key_with_compression.cbor b/data/0_7/high_level_api/server_key_with_compression.cbor new file mode 100644 index 0000000..ca328f2 --- /dev/null +++ b/data/0_7/high_level_api/server_key_with_compression.cbor @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7685373d5af746ad42e85a9517772abfbb1c47ec8275c4510a79d2ece2eefd80 +size 285713294 diff --git a/data/high_level_api.ron b/data/high_level_api.ron index e3440b3..8f519c5 100644 --- a/data/high_level_api.ron +++ b/data/high_level_api.ron @@ -347,4 +347,37 @@ ], )), ), + ( + tfhe_version_min: "0.7", + tfhe_module: "high_level_api", + metadata: HlClientKey(( + test_filename: "client_key_with_compression", + parameters: ( + lwe_dimension: 761, + glwe_dimension: 1, + polynomial_size: 2048, + lwe_noise_gaussian_stddev: 0.00000636835566258815, + glwe_noise_gaussian_stddev: 0.00000000000000031529322391500584, + pbs_base_log: 23, + pbs_level: 1, + ks_base_log: 3, + ks_level: 5, + message_modulus: 4, + ciphertext_modulus: 18446744073709551616, + carry_modulus: 4, + max_noise_level: 5, + log2_p_fail: -40.05, + encryption_key_choice: "big", + ), + )), + ), + ( + tfhe_version_min: "0.7", + tfhe_module: "high_level_api", + metadata: HlServerKey(( + test_filename: "server_key_with_compression", + client_key_filename: "client_key.cbor", + compressed: false, + )), + ), ] \ No newline at end of file diff --git a/src/data_0_7.rs b/src/data_0_7.rs index 2c00c1e..b3b319e 100644 --- a/src/data_0_7.rs +++ b/src/data_0_7.rs @@ -2,7 +2,8 @@ use crate::generate::{ store_versioned_auxiliary_02, store_versioned_test_02, TfhersVersion, VALID_TEST_PARAMS, }; use crate::{ - DataKind, HlHeterogeneousCiphertextListTest, TestMetadata, TestParameterSet, HL_MODULE_NAME, + DataKind, HlClientKeyTest, HlHeterogeneousCiphertextListTest, HlServerKeyTest, TestMetadata, + TestParameterSet, HL_MODULE_NAME, }; use std::borrow::Cow; use std::fs::create_dir_all; @@ -111,6 +112,17 @@ const HL_COMPRESSED_LIST_TEST: HlHeterogeneousCiphertextListTest = compressed: true, }; +const HL_CLIENTKEY_WITH_COMPRESSION_TEST: HlClientKeyTest = HlClientKeyTest { + test_filename: Cow::Borrowed("client_key_with_compression"), + parameters: VALID_TEST_PARAMS, +}; + +const HL_SERVERKEY_WITH_COMPRESSION_TEST: HlServerKeyTest = HlServerKeyTest { + test_filename: Cow::Borrowed("server_key_with_compression"), + client_key_filename: Cow::Borrowed("client_key_with_compression.cbor"), + compressed: false, +}; + pub struct V0_7; impl TfhersVersion for V0_7 { @@ -141,7 +153,7 @@ impl TfhersVersion for V0_7 { .build(); let (hl_client_key, hl_server_key) = generate_keys(config); - set_server_key(hl_server_key); + set_server_key(hl_server_key.clone()); let compact_pub_key = CompactPublicKey::new(&hl_client_key); @@ -191,10 +203,24 @@ impl TfhersVersion for V0_7 { &HL_COMPRESSED_LIST_TEST.test_filename, ); + store_versioned_test!( + &hl_server_key, + &dir, + &HL_CLIENTKEY_WITH_COMPRESSION_TEST.test_filename, + ); + + store_versioned_test!( + &hl_server_key, + &dir, + &HL_SERVERKEY_WITH_COMPRESSION_TEST.test_filename, + ); + vec![ TestMetadata::HlHeterogeneousCiphertextList(HL_PACKED_COMPACTLIST_TEST), TestMetadata::HlHeterogeneousCiphertextList(HL_COMPACTLIST_TEST), TestMetadata::HlHeterogeneousCiphertextList(HL_COMPRESSED_LIST_TEST), + TestMetadata::HlClientKey(HL_CLIENTKEY_WITH_COMPRESSION_TEST), + TestMetadata::HlServerKey(HL_SERVERKEY_WITH_COMPRESSION_TEST), ] } }