@@ -236,6 +236,7 @@ fn setup_verifier_verify_client_message(args: &Args) -> VerifierInputs {
236236 inputs. server . split_client_message ( client_message) . unwrap ( ) ;
237237 decryption_request_contributions. push ( decryption_request_contribution) ;
238238 }
239+ decryption_request_contributions. sort_by ( |a, b| a. nonce . cmp ( & b. nonce ) ) ;
239240 VerifierInputs {
240241 verifier : inputs. verifier ,
241242 verifier_state : inputs. verifier_state ,
@@ -348,28 +349,25 @@ struct DecryptorInputs {
348349
349350fn setup_decryptor_partial_decryption ( args : & Args ) -> DecryptorInputs {
350351 let mut inputs = setup_base ( args) ;
351- for _ in 0 ..args. max_num_clients {
352- // Generates a plaintext and encrypts.
353- let client_input_values =
354- generate_random_unsigned_vector ( args. input_length , args. input_domain ) ;
355- let client_plaintext = HashMap :: from ( [ ( String :: from ( DEFAULT_ID ) , client_input_values) ] ) ;
356- let client_message =
357- inputs. client . create_client_message ( & client_plaintext, & inputs. public_key ) . unwrap ( ) ;
352+ // Generates a plaintext and encrypts.
353+ let client_input_values = generate_random_unsigned_vector ( args. input_length , args. input_domain ) ;
354+ let client_plaintext = HashMap :: from ( [ ( String :: from ( DEFAULT_ID ) , client_input_values) ] ) ;
355+ let client_message =
356+ inputs. client . create_client_message ( & client_plaintext, & inputs. public_key ) . unwrap ( ) ;
358357
359- // Server splits the client message.
360- let ( ciphertext_contribution, decryption_request_contribution) =
361- inputs. server . split_client_message ( client_message) . unwrap ( ) ;
358+ // Server splits the client message.
359+ let ( ciphertext_contribution, decryption_request_contribution) =
360+ inputs. server . split_client_message ( client_message) . unwrap ( ) ;
362361
363- // The server and verifier each handle their part of the client message.
364- inputs
365- . server
366- . handle_ciphertext_contribution ( ciphertext_contribution, & mut inputs. server_state )
367- . unwrap ( ) ;
368- inputs
369- . verifier
370- . verify_and_include ( decryption_request_contribution, & mut inputs. verifier_state )
371- . unwrap ( ) ;
372- }
362+ // The server and verifier each handle their part of the client message.
363+ inputs
364+ . server
365+ . handle_ciphertext_contribution ( ciphertext_contribution, & mut inputs. server_state )
366+ . unwrap ( ) ;
367+ inputs
368+ . verifier
369+ . verify_and_include ( decryption_request_contribution, & mut inputs. verifier_state )
370+ . unwrap ( ) ;
373371
374372 // Verifier creates the partial decryption request.
375373 let pd_ct = inputs. verifier . create_partial_decryption_request ( inputs. verifier_state ) . unwrap ( ) ;
0 commit comments