Procházet zdrojové kódy

Correct sizes of Round 2 messages and buffers to match the paper

Ian Goldberg před 11 měsíci
rodič
revize
6f71b7a820
1 změnil soubory, kde provedl 4 přidání a 3 odebrání
  1. 4 3
      Enclave/route.cpp

+ 4 - 3
Enclave/route.cpp

@@ -89,8 +89,8 @@ bool route_init()
 
     // Which will be at most this many from us
     uint32_t max_msg_to_each_stg;
-    max_msg_to_each_stg = CEILDIV(tot_msg_per_stg, g_teems_config.tot_weight) *
-        g_teems_config.my_weight;
+    max_msg_to_each_stg = (tot_msg_per_stg/g_teems_config.tot_weight
+        + g_teems_config.tot_weight) * g_teems_config.my_weight;
 
     // But we can't send more messages to each storage server than we
     // could receive in total
@@ -111,7 +111,8 @@ bool route_init()
 
     // The max number of messages that can arrive at a storage server
     uint32_t max_stg_msgs;
-    max_stg_msgs = tot_msg_per_stg + g_teems_config.tot_weight;
+    max_stg_msgs = (tot_msg_per_stg/g_teems_config.tot_weight
+        + g_teems_config.tot_weight) * g_teems_config.tot_weight;
 
     // Calculating public-routing buffer sizes
     // Weights are not used in public routing