Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: change heterogeneous list metadata #15

Merged
merged 2 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
330 changes: 329 additions & 1 deletion data/high_level_api.ron
Original file line number Diff line number Diff line change
@@ -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",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])))]
[
(
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,
],
)),
),
]
45 changes: 44 additions & 1 deletion data/shortint.ron
Original file line number Diff line number Diff line change
@@ -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)))]
[
(
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,
)),
),
]
4 changes: 2 additions & 2 deletions src/data_0_7.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const HL_PACKED_COMPACTLIST_TEST: HlHeterogeneousCiphertextListTest =
DataKind::Bool,
DataKind::Bool,
]),
packed: true,
compressed: false,
};

const HL_COMPACTLIST_TEST: HlHeterogeneousCiphertextListTest = HlHeterogeneousCiphertextListTest {
Expand All @@ -85,7 +85,7 @@ const HL_COMPACTLIST_TEST: HlHeterogeneousCiphertextListTest = HlHeterogeneousCi
DataKind::Bool,
DataKind::Bool,
]),
packed: false,
compressed: false,
};

pub struct V0_7;
Expand Down
Loading