@@ -2,19 +2,19 @@ use serde::{Deserialize, Serialize};
2
2
use tfhe_versionable:: Versionize ;
3
3
4
4
pub use crate :: core_crypto:: commons:: parameters:: {
5
- CiphertextModulus as CoreCiphertextModulus , CiphertextModulusLog , DecompositionBaseLog ,
6
- DecompositionLevelCount , DynamicDistribution , EncryptionKeyChoice , GlweDimension ,
7
- LweBskGroupingFactor , LweCiphertextCount , LweDimension , NoiseEstimationMeasureBound ,
8
- PolynomialSize , RSigmaFactor ,
5
+ CiphertextModulusLog , DecompositionBaseLog , DecompositionLevelCount , DynamicDistribution ,
6
+ EncryptionKeyChoice , GlweDimension , LweBskGroupingFactor , LweCiphertextCount , LweDimension ,
7
+ NoiseEstimationMeasureBound , PolynomialSize , RSigmaFactor ,
9
8
} ;
10
9
use crate :: core_crypto:: prelude:: {
11
10
LweCiphertextConformanceParams , LweKeyswitchKeyConformanceParams , MsDecompressionType ,
12
11
} ;
13
12
use crate :: shortint:: backward_compatibility:: parameters:: KeySwitch32PBSParametersVersions ;
14
13
15
14
use super :: {
16
- AtomicPatternKind , CarryModulus , CiphertextConformanceParams , CiphertextModulus , Degree ,
17
- MaxNoiseLevel , MessageModulus , ModulusSwitchNoiseReductionParams , NoiseLevel ,
15
+ AtomicPatternKind , CarryModulus , CiphertextConformanceParams , CiphertextModulus ,
16
+ CiphertextModulus32 , Degree , MaxNoiseLevel , MessageModulus , ModulusSwitchNoiseReductionParams ,
17
+ NoiseLevel ,
18
18
} ;
19
19
20
20
/// A set of cryptographic parameters used with the atomic pattern
@@ -35,6 +35,7 @@ pub struct KeySwitch32PBSParameters {
35
35
pub carry_modulus : CarryModulus ,
36
36
pub max_noise_level : MaxNoiseLevel ,
37
37
pub log2_p_fail : f64 ,
38
+ pub post_keyswitch_ciphertext_modulus : CiphertextModulus32 ,
38
39
pub ciphertext_modulus : CiphertextModulus ,
39
40
pub modulus_switch_noise_reduction_params : Option < ModulusSwitchNoiseReductionParams > ,
40
41
}
@@ -49,8 +50,7 @@ impl From<&KeySwitch32PBSParameters> for LweKeyswitchKeyConformanceParams<u32> {
49
50
input_lwe_dimension : value
50
51
. glwe_dimension ( )
51
52
. to_equivalent_lwe_dimension ( value. polynomial_size ( ) ) ,
52
- // For the moment we only handle the native u32 modulus for the KSK
53
- ciphertext_modulus : CoreCiphertextModulus :: new_native ( ) ,
53
+ ciphertext_modulus : value. post_keyswitch_ciphertext_modulus ( ) ,
54
54
}
55
55
}
56
56
}
@@ -104,6 +104,10 @@ impl KeySwitch32PBSParameters {
104
104
self . max_noise_level
105
105
}
106
106
107
+ pub const fn post_keyswitch_ciphertext_modulus ( & self ) -> CiphertextModulus32 {
108
+ self . post_keyswitch_ciphertext_modulus
109
+ }
110
+
107
111
pub const fn ciphertext_modulus ( & self ) -> CiphertextModulus {
108
112
self . ciphertext_modulus
109
113
}
0 commit comments