Browse Source

Update the README

Ian Goldberg 1 year ago
parent
commit
c205c0121a
1 changed files with 21 additions and 17 deletions
  1. 21 17
      README.md

+ 21 - 17
README.md

@@ -57,38 +57,42 @@ We slightly optimize the protocol in that instead of the client sending both β0
 
 ## Running the code
 
+To build the code:
+
+`RUSTFLAGS="-C target-cpu=native" cargo build --release`
+
 To run the code:
 
-`cargo run --release 20`
+`./target/release/spiral-spir 20 4`
 
-Where `20` is the value of r (that is, the database will have N=2^20 entries).  Each entry is 8 bytes.  There are three phases of execution: a one-time Spiral public key generation (this only has to be done once, regardless of how many SPIR queries you do), a preprocessing phase per SPIR query (this can be done _before_ knowing the contents of the database on the server side, or the desired index on the client side), and the runtime phase per SPIR query (once those two things are known).
+Where `20` is the value of r (that is, the database will have N=2^20 entries), and 4 is the number of threads to use (defaults to 1).  Each entry is 8 bytes.  There are three phases of execution: a one-time Spiral public key generation (this only has to be done once, regardless of how many SPIR queries you do), a preprocessing phase per SPIR query (this can be done _before_ knowing the contents of the database on the server side, or the desired index on the client side), and the runtime phase per SPIR query (once those two things are known).
 
-A sample output (for r=20):
+A sample output (for r=20, 4 threads):
 
 ```
 ===== ONE-TIME SETUP =====
 
 Using a 2048 x 4096 byte database (8388608 bytes total)
-OT one-time setup: 3064 µs
-Spiral client one-time setup: 224935 µs, 10878976 bytes
+OT one-time setup: 3637 µs
+Spiral client one-time setup: 157144 µs, 10878976 bytes
 
 ===== PREPROCESSING =====
 
-rand_idx = 425489 rand_pir_idx = 831
-Spiral query: 691 µs, 32768 bytes
-key OT query in 365 µs, 640 bytes
-key OT serve in 1860 µs, 1280 bytes
-key OT receive in 1148 µs
+rand_idx = 146516 rand_pir_idx = 286
+Spiral query: 457 µs, 32768 bytes
+key OT query in 324 µs, 640 bytes
+key OT serve in 1653 µs, 1280 bytes
+key OT receive in 1029 µs
 
 ===== RUNTIME =====
 
 Send to server 8 bytes
-Server encrypt database 89036 µs
-Server load database 974249 µs
-expansion (took 166596 us).
-Server compute response 344613 µs, 14336 bytes (*including* the above expansion time)
-Client decode response 888 µs
-index = 948810, Response = 9488100948830
+Server encrypt database 29738 µs
+Server load database 248825 µs
+expansion (took 101920 us).
+Server compute response 181293 µs, 14336 bytes (*including* the above expansion time)
+Client decode response 790 µs
+index = 919657, Response = 9196570919677
 ```
 
-The various lines show the amount of compute time taken and the amount of data transferred between the client and the server.  The last line shows the random index that was looked up, and the database value the client retrieved.  The value for index i should be (10000001*i+20).
+The various lines show the amount of wall-clock time taken for various parts of the computation and the amount of data transferred between the client and the server.  The last line shows the random index that was looked up, and the database value the client retrieved.  The value for index i should be (10000001*i+20).