File tree Expand file tree Collapse file tree 9 files changed +16
-28
lines changed Expand file tree Collapse file tree 9 files changed +16
-28
lines changed Original file line number Diff line number Diff line change @@ -9,8 +9,7 @@ int main(void) {
9
9
10
10
// Note that simply changing parameters like this does not yield secure parameters
11
11
// Its only done for the example / tests
12
- ShortintPBSParameters params = SHORTINT_PARAM_MESSAGE_2_CARRY_2_KS_PBS ;
13
- params .glwe_noise_distribution = new_t_uniform (9 );
12
+ ShortintPBSParameters params = SHORTINT_PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_KS_PBS_TUNIFORM_2M40 ;
14
13
assert (params .encryption_key_choice == ShortintEncryptionKeyChoiceBig );
15
14
16
15
int status ;
Original file line number Diff line number Diff line change @@ -22,8 +22,8 @@ pub fn main() -> Result<(), Box<dyn std::error::Error>> {
22
22
23
23
let max_num_message = 1 ;
24
24
25
- let mut params = tfhe :: shortint :: parameters :: PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_KS_PBS ;
26
- params . glwe_noise_distribution = DynamicDistribution :: new_t_uniform ( 9 ) ;
25
+ let mut params =
26
+ tfhe :: shortint :: parameters :: PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_KS_PBS_TUNIFORM_2M40 ;
27
27
28
28
let client_key = tfhe :: ClientKey :: generate (tfhe :: ConfigBuilder :: with_custom_parameters (params , None ));
29
29
// This is done in an offline phase and the CRS is shared to all clients and the server
Original file line number Diff line number Diff line change @@ -658,8 +658,7 @@ function generateRandomBigInt(bitLength) {
658
658
}
659
659
660
660
test ( 'hlapi_compact_public_key_encrypt_and_prove_compact_uint256' , ( t ) => {
661
- let block_params = new ShortintParameters ( ShortintParametersName . PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_PBS_KS ) ;
662
- block_params . set_lwe_noise_distribution ( Shortint . try_new_t_uniform ( 9 ) ) ;
661
+ let block_params = new ShortintParameters ( ShortintParametersName . PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_KS_PBS_TUNIFORM_2M40 ) ;
663
662
664
663
let config = TfheConfigBuilder . default ( )
665
664
. use_custom_parameters ( block_params )
Original file line number Diff line number Diff line change @@ -832,11 +832,10 @@ mod cpu {
832
832
#[ cfg( feature = "zk-pok-experimental" ) ]
833
833
#[ test]
834
834
fn test_fhe_bool_zk ( ) {
835
- use crate :: core_crypto:: prelude:: DynamicDistribution ;
836
835
use crate :: zk:: { CompactPkeCrs , ZkComputeLoad } ;
837
836
838
- let mut params = crate :: shortint :: parameters :: PARAM_MESSAGE_2_CARRY_2_KS_PBS ;
839
- params . glwe_noise_distribution = DynamicDistribution :: new_t_uniform ( 9 ) ;
837
+ let params =
838
+ crate :: shortint :: parameters :: PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_KS_PBS_TUNIFORM_2M40 ;
840
839
841
840
let config = ConfigBuilder :: with_custom_parameters ( params, None ) . build ( ) ;
842
841
let crs = CompactPkeCrs :: from_config ( config, 2 ) . unwrap ( ) ;
Original file line number Diff line number Diff line change @@ -805,11 +805,10 @@ fn test_safe_deserialize_conformant_compact_fhe_int32_list() {
805
805
#[ cfg( feature = "zk-pok-experimental" ) ]
806
806
#[ test]
807
807
fn test_fhe_int_zk ( ) {
808
- use crate :: core_crypto:: prelude:: DynamicDistribution ;
809
808
use crate :: zk:: { CompactPkeCrs , ZkComputeLoad } ;
810
809
811
- let mut params = crate :: shortint :: parameters :: PARAM_MESSAGE_2_CARRY_2_KS_PBS ;
812
- params . glwe_noise_distribution = DynamicDistribution :: new_t_uniform ( 9 ) ;
810
+ let params =
811
+ crate :: shortint :: parameters :: PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_KS_PBS_TUNIFORM_2M40 ;
813
812
814
813
let config = ConfigBuilder :: with_custom_parameters ( params, None ) . build ( ) ;
815
814
let crs = CompactPkeCrs :: from_config ( config, 32 ) . unwrap ( ) ;
Original file line number Diff line number Diff line change @@ -550,8 +550,7 @@ fn test_safe_deserialize_conformant_compact_fhe_uint32_list() {
550
550
fn test_fhe_uint_zk ( ) {
551
551
use crate :: zk:: { CompactPkeCrs , ZkComputeLoad } ;
552
552
553
- let mut params = PARAM_MESSAGE_2_CARRY_2_KS_PBS ;
554
- params. glwe_noise_distribution = DynamicDistribution :: new_t_uniform ( 9 ) ;
553
+ let params = PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_KS_PBS_TUNIFORM_2M40 ;
555
554
556
555
let config = ConfigBuilder :: with_custom_parameters ( params, None ) . build ( ) ;
557
556
let crs = CompactPkeCrs :: from_config ( config, 32 ) . unwrap ( ) ;
Original file line number Diff line number Diff line change @@ -94,15 +94,13 @@ impl ProvenCompactCiphertextList {
94
94
#[ cfg( test) ]
95
95
mod tests {
96
96
use crate :: integer:: { ClientKey , CompactPublicKey } ;
97
- use crate :: shortint:: parameters:: DynamicDistribution ;
98
- use crate :: shortint:: prelude:: PARAM_MESSAGE_2_CARRY_2_KS_PBS ;
97
+ use crate :: shortint:: parameters:: PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_KS_PBS_TUNIFORM_2M40 ;
99
98
use crate :: zk:: { CompactPkeCrs , ZkComputeLoad } ;
100
99
use rand:: random;
101
100
102
101
#[ test]
103
102
fn test_zk_compact_ciphertext_list_encryption_ci_run_filter ( ) {
104
- let mut params = PARAM_MESSAGE_2_CARRY_2_KS_PBS ;
105
- params. glwe_noise_distribution = DynamicDistribution :: new_t_uniform ( 9 ) ;
103
+ let params = PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_KS_PBS_TUNIFORM_2M40 ;
106
104
107
105
let num_blocks = 4usize ;
108
106
let modulus = ( params. message_modulus . 0 as u64 )
Original file line number Diff line number Diff line change @@ -138,16 +138,14 @@ impl ProvenCompactCiphertextList {
138
138
139
139
#[ cfg( test) ]
140
140
mod tests {
141
- use crate :: shortint:: parameters:: DynamicDistribution ;
142
- use crate :: shortint:: prelude:: PARAM_MESSAGE_2_CARRY_2_KS_PBS ;
141
+ use crate :: shortint:: parameters:: PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_KS_PBS_TUNIFORM_2M40 ;
143
142
use crate :: shortint:: { ClientKey , CompactPublicKey } ;
144
143
use crate :: zk:: { CompactPkeCrs , ZkComputeLoad } ;
145
144
use rand:: random;
146
145
147
146
#[ test]
148
147
fn test_zk_ciphertext_encryption_ci_run_filter ( ) {
149
- let mut params = PARAM_MESSAGE_2_CARRY_2_KS_PBS ;
150
- params. glwe_noise_distribution = DynamicDistribution :: new_t_uniform ( 9 ) ;
148
+ let params = PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_KS_PBS_TUNIFORM_2M40 ;
151
149
152
150
let crs = CompactPkeCrs :: from_shortint_params ( params, 4 ) . unwrap ( ) ;
153
151
let cks = ClientKey :: new ( params) ;
@@ -166,8 +164,7 @@ mod tests {
166
164
167
165
#[ test]
168
166
fn test_zk_compact_ciphertext_list_encryption_ci_run_filter ( ) {
169
- let mut params = PARAM_MESSAGE_2_CARRY_2_KS_PBS ;
170
- params. glwe_noise_distribution = DynamicDistribution :: new_t_uniform ( 9 ) ;
167
+ let params = PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_KS_PBS_TUNIFORM_2M40 ;
171
168
172
169
let crs = CompactPkeCrs :: from_shortint_params ( params, 512 ) . unwrap ( ) ;
173
170
let cks = ClientKey :: new ( params) ;
Original file line number Diff line number Diff line change @@ -388,9 +388,8 @@ function generateRandomBigInt(bitLen) {
388
388
389
389
async function compactPublicKeyZeroKnowledge ( ) {
390
390
let block_params = new ShortintParameters (
391
- ShortintParametersName . PARAM_MESSAGE_2_CARRY_2_KS_PBS ,
391
+ ShortintParametersName . PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_KS_PBS_TUNIFORM_2M40 ,
392
392
) ;
393
- block_params . set_glwe_noise_distribution ( Shortint . try_new_t_uniform ( 9 ) ) ;
394
393
395
394
let config = TfheConfigBuilder . default ( )
396
395
. use_custom_parameters ( block_params )
@@ -650,9 +649,8 @@ async function compressedServerKeyBenchMessage2Carry2() {
650
649
651
650
async function compactPublicKeyZeroKnowledgeBench ( ) {
652
651
let block_params = new ShortintParameters (
653
- ShortintParametersName . PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_PBS_KS ,
652
+ ShortintParametersName . PARAM_MESSAGE_2_CARRY_2_COMPACT_PK_KS_PBS_TUNIFORM_2M40 ,
654
653
) ;
655
- block_params . set_lwe_noise_distribution ( Shortint . try_new_t_uniform ( 9 ) ) ;
656
654
657
655
let config = TfheConfigBuilder . default ( )
658
656
. use_custom_parameters ( block_params )
You can’t perform that action at this time.
0 commit comments