Procházet zdrojové kódy

Clarify "smaller index" -> "index of the smaller child" in comments

Ian Goldberg před 2 roky
rodič
revize
ccd78ec898
2 změnil soubory, kde provedl 9 přidání a 7 odebrání
  1. 6 4
      heap.cpp
  2. 3 3
      heap.hpp

+ 6 - 4
heap.cpp

@@ -264,7 +264,7 @@ static void verify_parent_children_heaps(MPCTIO tio, yield_t & yield, RegAS pare
 /*
 /*
 Protocol 6 from PRAC: Round-Efficient 3-Party MPC for Dynamic Data Structures
 Protocol 6 from PRAC: Round-Efficient 3-Party MPC for Dynamic Data Structures
 Takes in as an input the XOR shares of the index at which the heap property has to be restored
 Takes in as an input the XOR shares of the index at which the heap property has to be restored
-Returns the XOR shares of the smaller index
+Returns the XOR shares of the index of the smaller child
 
 
 Basic restore heap property has the following functionality:
 Basic restore heap property has the following functionality:
 
 
@@ -295,7 +295,7 @@ a) Comparison between the left and right child.
 b) Comparison between the smaller child and the parent.
 b) Comparison between the smaller child and the parent.
 
 
 Two MPC-selects are performed in parallel:
 Two MPC-selects are performed in parallel:
-- Computing the smaller child and the smaller index using MPC-select operations.
+- Computing the smaller child and its index using MPC-select operations.
 
 
 Next, the offsets by which the parent and children need to be updated are computed.
 Next, the offsets by which the parent and children need to be updated are computed.
 Offset computation involves:
 Offset computation involves:
@@ -395,11 +395,13 @@ RegXS MinHeap::restore_heap_property(MPCIO & mpcio, MPCTIO tio, yield_t & yield,
 // This Protocol 7 is derived from PRAC: Round-Efficient 3-Party MPC for Dynamic Data Structures
 // This Protocol 7 is derived from PRAC: Round-Efficient 3-Party MPC for Dynamic Data Structures
 // Takes in as an input the XOR shares of the index at which
 // Takes in as an input the XOR shares of the index at which
 // the heap property has to be restored
 // the heap property has to be restored
-// Returns the XOR shares of the smaller index and 
+// Returns the XOR shares of the index of the smaller child and 
 // comparison between the left and right child
 // comparison between the left and right child
 // This protocol represents an optimized version of restoring the heap property
 // This protocol represents an optimized version of restoring the heap property
 // The key difference between the optimized and basic versions is that the optimized version utilizes a wide DPF (Distributed Point Function) for reads and writes
 // The key difference between the optimized and basic versions is that the optimized version utilizes a wide DPF (Distributed Point Function) for reads and writes
-// In addition to restoring the heap property, the function also returns the result of the comparison (leftchild > rightchild)
+// In addition to restoring the heap property, the function also returns
+// shares of the index of the smaller child, and the result of the
+// comparison (leftchild > rightchild)
 // The (leftchild > rightchild) comparison is utilized in the extract_min operation to increment the oblivindx by a certain value
 // The (leftchild > rightchild) comparison is utilized in the extract_min operation to increment the oblivindx by a certain value
 // The function restores the heap property at node index
 // The function restores the heap property at node index
 // The parameter layer is the height at which the node at index lies
 // The parameter layer is the height at which the node at index lies

+ 3 - 3
heap.hpp

@@ -16,20 +16,20 @@ private:
     // Basic restore heap property at a secret shared index
     // Basic restore heap property at a secret shared index
     // Takes in as an input the XOR shares of the index at which
     // Takes in as an input the XOR shares of the index at which
     // the heap property has to be restored
     // the heap property has to be restored
-    // Returns the XOR shares of the smaller index
+    // Returns the XOR shares of the index of the smaller child
     RegXS restore_heap_property(MPCIO &mpcio, MPCTIO tio, yield_t & yield, RegXS index);
     RegXS restore_heap_property(MPCIO &mpcio, MPCTIO tio, yield_t & yield, RegXS index);
     
     
     // Optimized restore heap property at a secret shared index
     // Optimized restore heap property at a secret shared index
     // Takes in as an input the XOR shares of the index at which
     // Takes in as an input the XOR shares of the index at which
     // the heap property has to be restored
     // the heap property has to be restored
-    // Returns the XOR shares of the smaller index and 
+    // Returns the XOR shares of the index of the smaller child and 
     // comparison between the left and right child
     // comparison between the left and right child
     std::pair<RegXS, RegBS> restore_heap_property_optimized(MPCTIO tio, yield_t & yield, RegXS index, size_t layer, typename Duoram<RegAS>::template OblivIndex<RegXS,3> oidx);
     std::pair<RegXS, RegBS> restore_heap_property_optimized(MPCTIO tio, yield_t & yield, RegXS index, size_t layer, typename Duoram<RegAS>::template OblivIndex<RegXS,3> oidx);
     
     
     // Restore heap property at an index in clear
     // Restore heap property at an index in clear
     // Takes in as an input the index (in clear) at which
     // Takes in as an input the index (in clear) at which
     // the heap property has to be restored
     // the heap property has to be restored
-    // Returns the XOR shares of the smaller index and 
+    // Returns the XOR shares of the index of the smaller child and 
     // comparison between the left and right child
     // comparison between the left and right child
     std::pair<RegXS, RegBS> restore_heap_property_at_explicit_index(MPCTIO tio, yield_t & yield,  size_t index);
     std::pair<RegXS, RegBS> restore_heap_property_at_explicit_index(MPCTIO tio, yield_t & yield,  size_t index);