-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(shortint): move tuniform 0.10 parameters into their own folder
- Loading branch information
1 parent
0fab62b
commit a26e7fc
Showing
15 changed files
with
79 additions
and
51 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
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
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,2 +1,3 @@ | ||
pub mod compact_pk; | ||
pub mod gaussian; | ||
pub mod tuniform; |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
pub mod p_fail_2_minus_64; |
22 changes: 22 additions & 0 deletions
22
tfhe/src/shortint/parameters/v0_10/classic/tuniform/p_fail_2_minus_64/ks_pbs.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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
use crate::core_crypto::prelude::*; | ||
use crate::shortint::{CarryModulus, ClassicPBSParameters, MaxNoiseLevel, MessageModulus}; | ||
|
||
// security = 132 bits, p-fail = 2^-64.138, algorithmic cost ~ 113, 2-norm = 5 | ||
pub const V0_10_PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64: ClassicPBSParameters = | ||
ClassicPBSParameters { | ||
lwe_dimension: LweDimension(887), | ||
glwe_dimension: GlweDimension(1), | ||
polynomial_size: PolynomialSize(2048), | ||
lwe_noise_distribution: DynamicDistribution::new_t_uniform(46), | ||
glwe_noise_distribution: DynamicDistribution::new_t_uniform(17), | ||
pbs_base_log: DecompositionBaseLog(22), | ||
pbs_level: DecompositionLevelCount(1), | ||
ks_base_log: DecompositionBaseLog(3), | ||
ks_level: DecompositionLevelCount(5), | ||
message_modulus: MessageModulus(4), | ||
carry_modulus: CarryModulus(4), | ||
max_noise_level: MaxNoiseLevel::new(5), | ||
log2_p_fail: -64.138, | ||
ciphertext_modulus: CiphertextModulus::new_native(), | ||
encryption_key_choice: EncryptionKeyChoice::Big, | ||
}; |
1 change: 1 addition & 0 deletions
1
tfhe/src/shortint/parameters/v0_10/classic/tuniform/p_fail_2_minus_64/mod.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 |
---|---|---|
@@ -0,0 +1 @@ | ||
pub mod ks_pbs; |
1 change: 1 addition & 0 deletions
1
tfhe/src/shortint/parameters/v0_10/compact_public_key_only/mod.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 |
---|---|---|
@@ -0,0 +1 @@ | ||
pub mod p_fail_2_minus_64; |
19 changes: 19 additions & 0 deletions
19
tfhe/src/shortint/parameters/v0_10/compact_public_key_only/p_fail_2_minus_64/ks_pbs.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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
use crate::core_crypto::commons::parameters::{ | ||
CiphertextModulus, DynamicDistribution, LweDimension, | ||
}; | ||
use crate::shortint::parameters::{ | ||
CarryModulus, CompactCiphertextListExpansionKind, CompactPublicKeyEncryptionParameters, | ||
MessageModulus, | ||
}; | ||
|
||
/// This legacy parameter set were used with the v1 pke zk scheme on TFHE-rs v0.10 and lower | ||
pub const V0_10_PARAM_PKE_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64_ZKV1: | ||
CompactPublicKeyEncryptionParameters = CompactPublicKeyEncryptionParameters { | ||
encryption_lwe_dimension: LweDimension(1024), | ||
encryption_noise_distribution: DynamicDistribution::new_t_uniform(42), | ||
message_modulus: MessageModulus(4), | ||
carry_modulus: CarryModulus(4), | ||
ciphertext_modulus: CiphertextModulus::new_native(), | ||
expansion_kind: CompactCiphertextListExpansionKind::RequiresCasting, | ||
} | ||
.validate(); |
1 change: 1 addition & 0 deletions
1
tfhe/src/shortint/parameters/v0_10/compact_public_key_only/p_fail_2_minus_64/mod.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 |
---|---|---|
@@ -0,0 +1 @@ | ||
pub mod ks_pbs; |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
pub mod p_fail_2_minus_64; |
22 changes: 22 additions & 0 deletions
22
tfhe/src/shortint/parameters/v0_10/key_switching/p_fail_2_minus_64/ks_pbs.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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
use crate::shortint::parameters::{ | ||
DecompositionBaseLog, DecompositionLevelCount, EncryptionKeyChoice, | ||
ShortintKeySwitchingParameters, | ||
}; | ||
|
||
pub const V0_10_PARAM_KEYSWITCH_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64: | ||
ShortintKeySwitchingParameters = | ||
V0_10_PARAM_KEYSWITCH_PKE_TO_SMALL_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64; | ||
|
||
pub const V0_10_PARAM_KEYSWITCH_PKE_TO_SMALL_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64: | ||
ShortintKeySwitchingParameters = ShortintKeySwitchingParameters { | ||
ks_level: DecompositionLevelCount(5), | ||
ks_base_log: DecompositionBaseLog(3), | ||
destination_key: EncryptionKeyChoice::Small, | ||
}; | ||
|
||
pub const V0_10_PARAM_KEYSWITCH_PKE_TO_BIG_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64: | ||
ShortintKeySwitchingParameters = ShortintKeySwitchingParameters { | ||
ks_level: DecompositionLevelCount(1), | ||
ks_base_log: DecompositionBaseLog(27), | ||
destination_key: EncryptionKeyChoice::Big, | ||
}; |
1 change: 1 addition & 0 deletions
1
tfhe/src/shortint/parameters/v0_10/key_switching/p_fail_2_minus_64/mod.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 |
---|---|---|
@@ -0,0 +1 @@ | ||
pub mod ks_pbs; |
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,2 +1,8 @@ | ||
//! FHE Parameters as they were defined in TFHE-rs 0.10 and before. | ||
//! | ||
//! These parameters may be used for backward compatibility. | ||
pub mod classic; | ||
pub mod compact_public_key_only; | ||
pub mod key_switching; | ||
pub mod multi_bit; |