From 27078c8d324610434228b9acce910a3bc3b540e3 Mon Sep 17 00:00:00 2001 From: Nicolas Sarlin Date: Fri, 19 Jul 2024 11:53:27 +0200 Subject: [PATCH 1/2] fix: change heterogeneous list metadata --- data/high_level_api.ron | 2 +- src/data_0_7.rs | 4 ++-- src/lib.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/data/high_level_api.ron b/data/high_level_api.ron index b779307..313cc52 100644 --- a/data/high_level_api.ron +++ b/data/high_level_api.ron @@ -1 +1 @@ -[(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlClientKey((test_filename:"client_key",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.6",tfhe_module:"high_level_api",metadata:HlServerKey((test_filename:"server_key",client_key_filename:"client_key.cbor",compressed:false))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlPublicKey((test_filename:"public_key",client_key_filename:"client_key_for_pubkey.cbor",compressed:false,compact:false))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlPublicKey((test_filename:"compressed_public_key",client_key_filename:"client_key.cbor",compressed:true,compact:false))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlPublicKey((test_filename:"compact_public_key",client_key_filename:"client_key.cbor",compressed:false,compact:true))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlPublicKey((test_filename:"compressed_compact_public_key",client_key_filename:"client_key.cbor",compressed:true,compact:true))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlServerKey((test_filename:"compressed_server_key",client_key_filename:"client_key.cbor",compressed:true))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlCiphertext((test_filename:"ct1",key_filename:"client_key.cbor",compressed:false,compact:false,clear_value:0))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlCiphertext((test_filename:"ct2",key_filename:"client_key.cbor",compressed:false,compact:false,clear_value:255))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlCiphertext((test_filename:"ct_compressed_seeded",key_filename:"client_key.cbor",compressed:true,compact:false,clear_value:255))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlCiphertext((test_filename:"ct_compressed_modswitched",key_filename:"client_key.cbor",compressed:true,compact:false,clear_value:255))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlCiphertext((test_filename:"ct_compact",key_filename:"client_key.cbor",compressed:false,compact:true,clear_value:255))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlCiphertextList((test_filename:"ct_list",key_filename:"client_key.cbor",clear_values:[0,255]))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlSignedCiphertext((test_filename:"ct1_signed",key_filename:"client_key.cbor",compressed:false,compact:false,clear_value:0))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlSignedCiphertext((test_filename:"ct2_signed",key_filename:"client_key.cbor",compressed:false,compact:false,clear_value:-127))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlSignedCiphertext((test_filename:"ct_compressed_seeded_signed",key_filename:"client_key.cbor",compressed:true,compact:false,clear_value:255))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlSignedCiphertext((test_filename:"ct_compressed_modswitched_signed",key_filename:"client_key.cbor",compressed:true,compact:false,clear_value:255))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlSignedCiphertext((test_filename:"ct_compact_signed",key_filename:"client_key.cbor",compressed:false,compact:true,clear_value:255))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlSignedCiphertextList((test_filename:"ct_list_signed",key_filename:"client_key.cbor",clear_values:[-127,0,127]))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlBoolCiphertext((test_filename:"bool1",key_filename:"client_key.cbor",compressed:false,compact:false,clear_value:true))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlBoolCiphertext((test_filename:"bool2",key_filename:"client_key.cbor",compressed:false,compact:false,clear_value:false))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlBoolCiphertext((test_filename:"compressed_seeded_bool",key_filename:"client_key.cbor",compressed:true,compact:false,clear_value:true))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlBoolCiphertext((test_filename:"compressed_modswitched_bool",key_filename:"client_key.cbor",compressed:true,compact:false,clear_value:true))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlBoolCiphertext((test_filename:"compact_bool",key_filename:"client_key.cbor",compressed:false,compact:true,clear_value:true))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlBoolCiphertextList((test_filename:"bool_list",key_filename:"client_key.cbor",clear_values:[true,false,true]))),(tfhe_version_min:"0.7",tfhe_module:"high_level_api",metadata:HlHeterogeneousCiphertextList((test_filename:"hl_packed_heterogeneous_list",key_filename:"client_key.cbor",packed:true,clear_values:[17,18446744073709551604,0,1],data_kinds:[Unsigned,Signed,Bool,Bool]))),(tfhe_version_min:"0.7",tfhe_module:"high_level_api",metadata:HlHeterogeneousCiphertextList((test_filename:"hl_heterogeneous_list",key_filename:"client_key.cbor",packed:false,clear_values:[17,18446744073709551604,0,1],data_kinds:[Unsigned,Signed,Bool,Bool])))] \ No newline at end of file +[(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlClientKey((test_filename:"client_key",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.6",tfhe_module:"high_level_api",metadata:HlServerKey((test_filename:"server_key",client_key_filename:"client_key.cbor",compressed:false))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlPublicKey((test_filename:"public_key",client_key_filename:"client_key_for_pubkey.cbor",compressed:false,compact:false))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlPublicKey((test_filename:"compressed_public_key",client_key_filename:"client_key.cbor",compressed:true,compact:false))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlPublicKey((test_filename:"compact_public_key",client_key_filename:"client_key.cbor",compressed:false,compact:true))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlPublicKey((test_filename:"compressed_compact_public_key",client_key_filename:"client_key.cbor",compressed:true,compact:true))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlServerKey((test_filename:"compressed_server_key",client_key_filename:"client_key.cbor",compressed:true))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlCiphertext((test_filename:"ct1",key_filename:"client_key.cbor",compressed:false,compact:false,clear_value:0))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlCiphertext((test_filename:"ct2",key_filename:"client_key.cbor",compressed:false,compact:false,clear_value:255))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlCiphertext((test_filename:"ct_compressed_seeded",key_filename:"client_key.cbor",compressed:true,compact:false,clear_value:255))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlCiphertext((test_filename:"ct_compressed_modswitched",key_filename:"client_key.cbor",compressed:true,compact:false,clear_value:255))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlCiphertext((test_filename:"ct_compact",key_filename:"client_key.cbor",compressed:false,compact:true,clear_value:255))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlCiphertextList((test_filename:"ct_list",key_filename:"client_key.cbor",clear_values:[0,255]))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlSignedCiphertext((test_filename:"ct1_signed",key_filename:"client_key.cbor",compressed:false,compact:false,clear_value:0))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlSignedCiphertext((test_filename:"ct2_signed",key_filename:"client_key.cbor",compressed:false,compact:false,clear_value:-127))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlSignedCiphertext((test_filename:"ct_compressed_seeded_signed",key_filename:"client_key.cbor",compressed:true,compact:false,clear_value:255))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlSignedCiphertext((test_filename:"ct_compressed_modswitched_signed",key_filename:"client_key.cbor",compressed:true,compact:false,clear_value:255))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlSignedCiphertext((test_filename:"ct_compact_signed",key_filename:"client_key.cbor",compressed:false,compact:true,clear_value:255))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlSignedCiphertextList((test_filename:"ct_list_signed",key_filename:"client_key.cbor",clear_values:[-127,0,127]))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlBoolCiphertext((test_filename:"bool1",key_filename:"client_key.cbor",compressed:false,compact:false,clear_value:true))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlBoolCiphertext((test_filename:"bool2",key_filename:"client_key.cbor",compressed:false,compact:false,clear_value:false))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlBoolCiphertext((test_filename:"compressed_seeded_bool",key_filename:"client_key.cbor",compressed:true,compact:false,clear_value:true))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlBoolCiphertext((test_filename:"compressed_modswitched_bool",key_filename:"client_key.cbor",compressed:true,compact:false,clear_value:true))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlBoolCiphertext((test_filename:"compact_bool",key_filename:"client_key.cbor",compressed:false,compact:true,clear_value:true))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlBoolCiphertextList((test_filename:"bool_list",key_filename:"client_key.cbor",clear_values:[true,false,true]))),(tfhe_version_min:"0.7",tfhe_module:"high_level_api",metadata:HlHeterogeneousCiphertextList((test_filename:"hl_packed_heterogeneous_list",key_filename:"client_key.cbor",compressed:false,clear_values:[17,18446744073709551604,0,1],data_kinds:[Unsigned,Signed,Bool,Bool]))),(tfhe_version_min:"0.7",tfhe_module:"high_level_api",metadata:HlHeterogeneousCiphertextList((test_filename:"hl_heterogeneous_list",key_filename:"client_key.cbor",compressed:false,clear_values:[17,18446744073709551604,0,1],data_kinds:[Unsigned,Signed,Bool,Bool])))] \ No newline at end of file diff --git a/src/data_0_7.rs b/src/data_0_7.rs index 1b4ec2d..4e95689 100644 --- a/src/data_0_7.rs +++ b/src/data_0_7.rs @@ -72,7 +72,7 @@ const HL_PACKED_COMPACTLIST_TEST: HlHeterogeneousCiphertextListTest = DataKind::Bool, DataKind::Bool, ]), - packed: true, + compressed: false, }; const HL_COMPACTLIST_TEST: HlHeterogeneousCiphertextListTest = HlHeterogeneousCiphertextListTest { @@ -85,7 +85,7 @@ const HL_COMPACTLIST_TEST: HlHeterogeneousCiphertextListTest = HlHeterogeneousCi DataKind::Bool, DataKind::Bool, ]), - packed: false, + compressed: false, }; pub struct V0_7; diff --git a/src/lib.rs b/src/lib.rs index 7dfe9aa..921ecb9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -343,7 +343,7 @@ pub enum DataKind { pub struct HlHeterogeneousCiphertextListTest { pub test_filename: Cow<'static, str>, pub key_filename: Cow<'static, str>, - pub packed: bool, + pub compressed: bool, pub clear_values: Cow<'static, [u64]>, pub data_kinds: Cow<'static, [DataKind]>, } From 5851c15bd9b68c8994e2eddd0838c5fdd2468f31 Mon Sep 17 00:00:00 2001 From: Nicolas Sarlin Date: Fri, 19 Jul 2024 11:58:35 +0200 Subject: [PATCH 2/2] chore: prettify metadata file --- data/high_level_api.ron | 330 +++++++++++++++++++++++++++++++++++++++- data/shortint.ron | 45 +++++- src/generate.rs | 2 +- 3 files changed, 374 insertions(+), 3 deletions(-) diff --git a/data/high_level_api.ron b/data/high_level_api.ron index 313cc52..d965dcc 100644 --- a/data/high_level_api.ron +++ b/data/high_level_api.ron @@ -1 +1,329 @@ -[(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlClientKey((test_filename:"client_key",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.6",tfhe_module:"high_level_api",metadata:HlServerKey((test_filename:"server_key",client_key_filename:"client_key.cbor",compressed:false))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlPublicKey((test_filename:"public_key",client_key_filename:"client_key_for_pubkey.cbor",compressed:false,compact:false))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlPublicKey((test_filename:"compressed_public_key",client_key_filename:"client_key.cbor",compressed:true,compact:false))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlPublicKey((test_filename:"compact_public_key",client_key_filename:"client_key.cbor",compressed:false,compact:true))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlPublicKey((test_filename:"compressed_compact_public_key",client_key_filename:"client_key.cbor",compressed:true,compact:true))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlServerKey((test_filename:"compressed_server_key",client_key_filename:"client_key.cbor",compressed:true))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlCiphertext((test_filename:"ct1",key_filename:"client_key.cbor",compressed:false,compact:false,clear_value:0))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlCiphertext((test_filename:"ct2",key_filename:"client_key.cbor",compressed:false,compact:false,clear_value:255))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlCiphertext((test_filename:"ct_compressed_seeded",key_filename:"client_key.cbor",compressed:true,compact:false,clear_value:255))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlCiphertext((test_filename:"ct_compressed_modswitched",key_filename:"client_key.cbor",compressed:true,compact:false,clear_value:255))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlCiphertext((test_filename:"ct_compact",key_filename:"client_key.cbor",compressed:false,compact:true,clear_value:255))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlCiphertextList((test_filename:"ct_list",key_filename:"client_key.cbor",clear_values:[0,255]))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlSignedCiphertext((test_filename:"ct1_signed",key_filename:"client_key.cbor",compressed:false,compact:false,clear_value:0))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlSignedCiphertext((test_filename:"ct2_signed",key_filename:"client_key.cbor",compressed:false,compact:false,clear_value:-127))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlSignedCiphertext((test_filename:"ct_compressed_seeded_signed",key_filename:"client_key.cbor",compressed:true,compact:false,clear_value:255))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlSignedCiphertext((test_filename:"ct_compressed_modswitched_signed",key_filename:"client_key.cbor",compressed:true,compact:false,clear_value:255))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlSignedCiphertext((test_filename:"ct_compact_signed",key_filename:"client_key.cbor",compressed:false,compact:true,clear_value:255))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlSignedCiphertextList((test_filename:"ct_list_signed",key_filename:"client_key.cbor",clear_values:[-127,0,127]))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlBoolCiphertext((test_filename:"bool1",key_filename:"client_key.cbor",compressed:false,compact:false,clear_value:true))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlBoolCiphertext((test_filename:"bool2",key_filename:"client_key.cbor",compressed:false,compact:false,clear_value:false))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlBoolCiphertext((test_filename:"compressed_seeded_bool",key_filename:"client_key.cbor",compressed:true,compact:false,clear_value:true))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlBoolCiphertext((test_filename:"compressed_modswitched_bool",key_filename:"client_key.cbor",compressed:true,compact:false,clear_value:true))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlBoolCiphertext((test_filename:"compact_bool",key_filename:"client_key.cbor",compressed:false,compact:true,clear_value:true))),(tfhe_version_min:"0.6",tfhe_module:"high_level_api",metadata:HlBoolCiphertextList((test_filename:"bool_list",key_filename:"client_key.cbor",clear_values:[true,false,true]))),(tfhe_version_min:"0.7",tfhe_module:"high_level_api",metadata:HlHeterogeneousCiphertextList((test_filename:"hl_packed_heterogeneous_list",key_filename:"client_key.cbor",compressed:false,clear_values:[17,18446744073709551604,0,1],data_kinds:[Unsigned,Signed,Bool,Bool]))),(tfhe_version_min:"0.7",tfhe_module:"high_level_api",metadata:HlHeterogeneousCiphertextList((test_filename:"hl_heterogeneous_list",key_filename:"client_key.cbor",compressed:false,clear_values:[17,18446744073709551604,0,1],data_kinds:[Unsigned,Signed,Bool,Bool])))] \ No newline at end of file +[ + ( + tfhe_version_min: "0.6", + tfhe_module: "high_level_api", + metadata: HlClientKey(( + test_filename: "client_key", + 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.6", + tfhe_module: "high_level_api", + metadata: HlServerKey(( + test_filename: "server_key", + client_key_filename: "client_key.cbor", + compressed: false, + )), + ), + ( + tfhe_version_min: "0.6", + tfhe_module: "high_level_api", + metadata: HlPublicKey(( + test_filename: "public_key", + client_key_filename: "client_key_for_pubkey.cbor", + compressed: false, + compact: false, + )), + ), + ( + tfhe_version_min: "0.6", + tfhe_module: "high_level_api", + metadata: HlPublicKey(( + test_filename: "compressed_public_key", + client_key_filename: "client_key.cbor", + compressed: true, + compact: false, + )), + ), + ( + tfhe_version_min: "0.6", + tfhe_module: "high_level_api", + metadata: HlPublicKey(( + test_filename: "compact_public_key", + client_key_filename: "client_key.cbor", + compressed: false, + compact: true, + )), + ), + ( + tfhe_version_min: "0.6", + tfhe_module: "high_level_api", + metadata: HlPublicKey(( + test_filename: "compressed_compact_public_key", + client_key_filename: "client_key.cbor", + compressed: true, + compact: true, + )), + ), + ( + tfhe_version_min: "0.6", + tfhe_module: "high_level_api", + metadata: HlServerKey(( + test_filename: "compressed_server_key", + client_key_filename: "client_key.cbor", + compressed: true, + )), + ), + ( + tfhe_version_min: "0.6", + tfhe_module: "high_level_api", + metadata: HlCiphertext(( + test_filename: "ct1", + key_filename: "client_key.cbor", + compressed: false, + compact: false, + clear_value: 0, + )), + ), + ( + tfhe_version_min: "0.6", + tfhe_module: "high_level_api", + metadata: HlCiphertext(( + test_filename: "ct2", + key_filename: "client_key.cbor", + compressed: false, + compact: false, + clear_value: 255, + )), + ), + ( + tfhe_version_min: "0.6", + tfhe_module: "high_level_api", + metadata: HlCiphertext(( + test_filename: "ct_compressed_seeded", + key_filename: "client_key.cbor", + compressed: true, + compact: false, + clear_value: 255, + )), + ), + ( + tfhe_version_min: "0.6", + tfhe_module: "high_level_api", + metadata: HlCiphertext(( + test_filename: "ct_compressed_modswitched", + key_filename: "client_key.cbor", + compressed: true, + compact: false, + clear_value: 255, + )), + ), + ( + tfhe_version_min: "0.6", + tfhe_module: "high_level_api", + metadata: HlCiphertext(( + test_filename: "ct_compact", + key_filename: "client_key.cbor", + compressed: false, + compact: true, + clear_value: 255, + )), + ), + ( + tfhe_version_min: "0.6", + tfhe_module: "high_level_api", + metadata: HlCiphertextList(( + test_filename: "ct_list", + key_filename: "client_key.cbor", + clear_values: [ + 0, + 255, + ], + )), + ), + ( + tfhe_version_min: "0.6", + tfhe_module: "high_level_api", + metadata: HlSignedCiphertext(( + test_filename: "ct1_signed", + key_filename: "client_key.cbor", + compressed: false, + compact: false, + clear_value: 0, + )), + ), + ( + tfhe_version_min: "0.6", + tfhe_module: "high_level_api", + metadata: HlSignedCiphertext(( + test_filename: "ct2_signed", + key_filename: "client_key.cbor", + compressed: false, + compact: false, + clear_value: -127, + )), + ), + ( + tfhe_version_min: "0.6", + tfhe_module: "high_level_api", + metadata: HlSignedCiphertext(( + test_filename: "ct_compressed_seeded_signed", + key_filename: "client_key.cbor", + compressed: true, + compact: false, + clear_value: 255, + )), + ), + ( + tfhe_version_min: "0.6", + tfhe_module: "high_level_api", + metadata: HlSignedCiphertext(( + test_filename: "ct_compressed_modswitched_signed", + key_filename: "client_key.cbor", + compressed: true, + compact: false, + clear_value: 255, + )), + ), + ( + tfhe_version_min: "0.6", + tfhe_module: "high_level_api", + metadata: HlSignedCiphertext(( + test_filename: "ct_compact_signed", + key_filename: "client_key.cbor", + compressed: false, + compact: true, + clear_value: 255, + )), + ), + ( + tfhe_version_min: "0.6", + tfhe_module: "high_level_api", + metadata: HlSignedCiphertextList(( + test_filename: "ct_list_signed", + key_filename: "client_key.cbor", + clear_values: [ + -127, + 0, + 127, + ], + )), + ), + ( + tfhe_version_min: "0.6", + tfhe_module: "high_level_api", + metadata: HlBoolCiphertext(( + test_filename: "bool1", + key_filename: "client_key.cbor", + compressed: false, + compact: false, + clear_value: true, + )), + ), + ( + tfhe_version_min: "0.6", + tfhe_module: "high_level_api", + metadata: HlBoolCiphertext(( + test_filename: "bool2", + key_filename: "client_key.cbor", + compressed: false, + compact: false, + clear_value: false, + )), + ), + ( + tfhe_version_min: "0.6", + tfhe_module: "high_level_api", + metadata: HlBoolCiphertext(( + test_filename: "compressed_seeded_bool", + key_filename: "client_key.cbor", + compressed: true, + compact: false, + clear_value: true, + )), + ), + ( + tfhe_version_min: "0.6", + tfhe_module: "high_level_api", + metadata: HlBoolCiphertext(( + test_filename: "compressed_modswitched_bool", + key_filename: "client_key.cbor", + compressed: true, + compact: false, + clear_value: true, + )), + ), + ( + tfhe_version_min: "0.6", + tfhe_module: "high_level_api", + metadata: HlBoolCiphertext(( + test_filename: "compact_bool", + key_filename: "client_key.cbor", + compressed: false, + compact: true, + clear_value: true, + )), + ), + ( + tfhe_version_min: "0.6", + tfhe_module: "high_level_api", + metadata: HlBoolCiphertextList(( + test_filename: "bool_list", + key_filename: "client_key.cbor", + clear_values: [ + true, + false, + true, + ], + )), + ), + ( + tfhe_version_min: "0.7", + tfhe_module: "high_level_api", + metadata: HlHeterogeneousCiphertextList(( + test_filename: "hl_packed_heterogeneous_list", + key_filename: "client_key.cbor", + compressed: false, + clear_values: [ + 17, + 18446744073709551604, + 0, + 1, + ], + data_kinds: [ + Unsigned, + Signed, + Bool, + Bool, + ], + )), + ), + ( + tfhe_version_min: "0.7", + tfhe_module: "high_level_api", + metadata: HlHeterogeneousCiphertextList(( + test_filename: "hl_heterogeneous_list", + key_filename: "client_key.cbor", + compressed: false, + clear_values: [ + 17, + 18446744073709551604, + 0, + 1, + ], + data_kinds: [ + Unsigned, + Signed, + Bool, + Bool, + ], + )), + ), +] \ No newline at end of file diff --git a/data/shortint.ron b/data/shortint.ron index 41182b6..0eb8506 100644 --- a/data/shortint.ron +++ b/data/shortint.ron @@ -1 +1,44 @@ -[(tfhe_version_min:"0.6",tfhe_module:"shortint",metadata:ShortintClientKey((test_filename:"client_key",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.6",tfhe_module:"shortint",metadata:ShortintCiphertext((test_filename:"ct1",key_filename:"client_key.cbor",clear_value:0))),(tfhe_version_min:"0.6",tfhe_module:"shortint",metadata:ShortintCiphertext((test_filename:"ct2",key_filename:"client_key.cbor",clear_value:3)))] \ No newline at end of file +[ + ( + tfhe_version_min: "0.6", + tfhe_module: "shortint", + metadata: ShortintClientKey(( + test_filename: "client_key", + 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.6", + tfhe_module: "shortint", + metadata: ShortintCiphertext(( + test_filename: "ct1", + key_filename: "client_key.cbor", + clear_value: 0, + )), + ), + ( + tfhe_version_min: "0.6", + tfhe_module: "shortint", + metadata: ShortintCiphertext(( + test_filename: "ct2", + key_filename: "client_key.cbor", + clear_value: 3, + )), + ), +] \ No newline at end of file diff --git a/src/generate.rs b/src/generate.rs index a0a7d91..cdcbe4e 100644 --- a/src/generate.rs +++ b/src/generate.rs @@ -77,7 +77,7 @@ pub fn store_versioned_test>( } pub fn store_metadata>(value: &Meta, path: P) { - let serialized = ron::to_string(value).unwrap(); + let serialized = ron::ser::to_string_pretty(value, ron::ser::PrettyConfig::default()).unwrap(); fs::write(path, serialized).unwrap(); }