Procházet zdrojové kódy

BST insertion in AVL style

sshsshy před 1 rokem
rodič
revize
090acf7421
3 změnil soubory, kde provedl 6 přidání a 6 odebrání
  1. 1 1
      Makefile
  2. 4 4
      bst.cpp
  3. 1 1
      online.cpp

+ 1 - 1
Makefile

@@ -9,7 +9,7 @@ LDLIBS=-lbsd -lboost_system -lboost_context -lboost_chrono -lboost_thread -lpthr
 
 BIN=prac
 SRCS=prac.cpp mpcio.cpp preproc.cpp online.cpp mpcops.cpp rdpf.cpp \
-    cdpf.cpp duoram.cpp cell.cpp node.cpp
+    cdpf.cpp duoram.cpp cell.cpp bst.cpp
 OBJS=$(SRCS:.cpp=.o)
 ASMS=$(SRCS:.cpp=.s)
 

+ 4 - 4
bst.cpp

@@ -2,7 +2,7 @@
 
 #include "types.hpp"
 #include "duoram.hpp"
-#include "node.hpp"
+#include "bst.hpp"
 
 // This file demonstrates how to implement custom ORAM wide cell types.
 // Such types can be structures of arbitrary numbers of RegAS and RegXS
@@ -196,12 +196,11 @@ std::tuple<RegXS, RegBS> insert(MPCTIO &tio, yield_t &yield, RegXS ptr, Node new
   RegXS next_ptr;
   mpc_select(tio, yield, next_ptr, gt, left, right, 32);
 
-  //RegBS F_z = check_ptr_zero(next_ptr, tio, yield);
-  CDPF dpf;
+  CDPF dpf = tio.cdpf(yield);
   size_t &aes_ops = tio.aes_ops();
   //RegAS next_ptr_as;
   //mpc_xs_to_as(tio, yield, next_ptr_as, next_ptr);
-  //RegBS F_z = dpf.is_zero(tio, yield, next_ptr, aes_ops); 
+  RegBS F_z = dpf.is_zero(tio, yield, next_ptr, aes_ops); 
   RegBS F_i;
 
   if(tio.player()==0) {
@@ -273,6 +272,7 @@ void newnode(Node &a) {
 
 // Now we use the node in various ways.  This function is called by
 // online.cpp.
+
 void bst(MPCIO &mpcio,
     const PRACOptions &opts, char **args)
 {

+ 1 - 1
online.cpp

@@ -7,8 +7,8 @@
 #include "cdpf.hpp"
 #include "cell.hpp"
 #include "shapes.hpp"
-#include "bst.hpp"
 #include "node.hpp"
+#include "bst.hpp"
 
 static void online_test(MPCIO &mpcio,
     const PRACOptions &opts, char **args)