Browse Source

Correct the call to oram_read in the readwrite test

And make it choose an independent random index from the write
Ian Goldberg 1 year ago
parent
commit
8d7fd27f5e
2 changed files with 4 additions and 4 deletions
  1. 1 3
      Dockerfile
  2. 3 1
      bench_oram_readwrite.oc

+ 1 - 3
Dockerfile

@@ -2,10 +2,9 @@ FROM ubuntu:18.04
 ARG DEBIAN_FRONTEND=noninteractive 
 #the above line is avoid interaction
 WORKDIR /root
-RUN apt update && apt install -y git build-essential libbsd-dev libssl-dev libboost-all-dev iproute2 iperf iputils-ping wget unzip net-tools wget ocaml libgcrypt20-dev ocaml-findlib opam m4 
+RUN apt update && apt install -y git build-essential libbsd-dev libssl-dev libboost-all-dev iproute2 iperf iputils-ping wget unzip net-tools wget ocaml libgcrypt20-dev ocaml-findlib opam m4 ocamlbuild numactl
 RUN opam init -y && opam switch 4.06.0 && eval `opam config env` && opam install -y camlp4 ocamlfind ocamlbuild batteries
 RUN git clone https://github.com/samee/obliv-c.git 
-RUN apt-get install -y ocamlbuild
 RUN cd obliv-c && ./configure && make
 RUN wget https://gitlab.com/neucrypt/floram/-/archive/floram-release/floram-floram-release.zip && unzip floram-floram-release.zip
 COPY bench_oram_readwrite.oc bench_oram.patch /root/
@@ -14,4 +13,3 @@ RUN cd floram-floram-release && sed -i -e '28s/$/ bench_oram_readwrite/' Makefil
 RUN cd floram-floram-release/tests && cp /root/bench_oram_readwrite.oc bench_oram_readwrite.oc
 RUN cd floram-floram-release/tests && patch -p0 < /root/bench_oram.patch
 RUN cd floram-floram-release && make -j`nproc`
-RUN apt install -y numactl

+ 3 - 1
bench_oram_readwrite.oc

@@ -123,12 +123,14 @@ void test_main(void*varg) {
 	for (int ii = 0; ii < samples; ii++) {
 		uint32_t index_raw = ocBroadcastInt(rand() % elct, 2);
 		obliv uint32_t index = feedOblivInt(index_raw, 2);
+		uint32_t rindex_raw = ocBroadcastInt(rand() % elct, 2);
+		obliv uint32_t rindex = feedOblivInt(rindex_raw, 2);
 		for (int kk = 0; kk < elsz; kk++) input[kk] = feedOblivInt(rand(), 1);
 		int64_t runtime = -current_timestamp();
 		int64_t rungates = -yaoGateCount();
 		int64_t runbytes = -tcp2PBytesSent(ocCurrentProto());
 		oram_write(o, input, index);
-		oram_read(o, input, index);
+		oram_read(input, o, rindex);
 		runtime += current_timestamp();
 		rungates += yaoGateCount();
 		runbytes += tcp2PBytesSent(ocCurrentProto());