@@ -11,7 +11,7 @@ use itertools::Itertools;
1111use mxx:: storage:: store_and_drop_poly;
1212use mxx:: {
1313 bgg:: { digits_to_int:: DigitsToInt , public_key:: BggPublicKey , sampler:: BGGPublicKeySampler } ,
14- lookup:: simple_eval :: SimpleBggPubKeyEvaluator ,
14+ lookup:: lwe_eval :: LweBggPubKeyEvaluator ,
1515 matrix:: PolyMatrix ,
1616 poly:: { Poly , PolyParams } ,
1717 rlwe_enc:: rlwe_encrypt,
6262 let d = obf_params. d ;
6363 let sampler_uniform = SU :: new ( ) ;
6464 let sampler_trapdoor = ST :: new ( & params, obf_params. trapdoor_sigma ) ;
65- let bgg_pubkey_sampler = BGGPublicKeySampler :: < _ , SH > :: new ( hash_key, d) ;
65+ // sample d+1 public keys explictly
66+ let bgg_pubkey_sampler = BGGPublicKeySampler :: < _ , SH > :: new ( hash_key, d + 1 ) ;
6667 let m_b = ( 1 + packed_input_size) * ( d + 1 ) * ( 2 + log_base_q) ;
6768 let packed_output_size = public_data. packed_output_size ;
6869
8081 =============================================================================
8182 */
8283
83- // Sample BGG+ encoding secret key
84- let s_bars = sampler_uniform. sample_uniform ( & params, 1 , d, DistType :: BitDist ) . get_row ( 0 ) ;
85- log_mem ( "Sampled s_bars" ) ;
8684 // Sample FHE secret key t
8785 let t_bar = sampler_uniform. sample_uniform ( & params, 1 , 1 , DistType :: BitDist ) ;
8886 log_mem ( "Sampled t_bar" ) ;
@@ -102,6 +100,9 @@ where
102100 reveals
103101 } ;
104102 let s_init = {
103+ // Sample BGG+ encoding secret key
104+ let s_bars = sampler_uniform. sample_uniform ( & params, 1 , d, DistType :: BitDist ) . get_row ( 0 ) ;
105+ log_mem ( "Sampled s_bars" ) ;
105106 let minus_one_poly = <SU :: M as PolyMatrix >:: P :: const_minus_one ( & params) ;
106107 let mut secrets = s_bars. to_vec ( ) ;
107108 secrets. push ( minus_one_poly) ;
@@ -401,7 +402,7 @@ where
401402 ) ;
402403 log_mem ( "Computed final_circuit" ) ;
403404
404- let bgg_plt_evaluator = SimpleBggPubKeyEvaluator :: < M , SH , SU , ST > :: new (
405+ let bgg_plt_evaluator = LweBggPubKeyEvaluator :: < M , SH , ST > :: new (
405406 hash_key,
406407 sampler_trapdoor. clone ( ) ,
407408 b_l_plus_one. clone ( ) ,
0 commit comments