Skip to content

Commit

Permalink
fixing criterion
Browse files Browse the repository at this point in the history
  • Loading branch information
sga001 committed Jan 3, 2023
1 parent c6c50cf commit dede8ae
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

SealPIR is a research library and should not be used in production systems. SealPIR allows a client to download an element from a database stored by a server without revealing which element was downloaded. SealPIR was introduced in our [paper](https://eprint.iacr.org/2017/1142.pdf).

SealPIR relies on SEAL v2.3.1. The rest of this README assumes that the SEAL v2.3.1 source code is placed in the folder
deps/SEAL_2.3.1 within this repository. You can get SEAL v2.3.1 from this [link](http://sealcrypto.org).
SealPIR relies on SEAL v2.3.1. We have a copy of this old version of SEAL (which is no longer available from the official
repository) in the deps folder of this repository.


# Compiling SealPIR-Rust

SealPIR's Rust wrapper works with [Rust](https://www.rust-lang.org/) nightly (we have tested with Rust 1.30.0). It also depends on the C++ version of SealPIR (included as a submodule) and SEAL (see above). We have tested these versions with g++ 8.1.0.
SealPIR's Rust wrapper works with [Rust](https://www.rust-lang.org/) stable (we have tested with Rust 1.66). It also depends on the C++ version of SealPIR (included as a submodule). We have tested these versions with gcc/g++ 11.3 (as of 1/3/2023).

To compile SealPIR-Rust just do:

Expand Down
13 changes: 5 additions & 8 deletions benches/pir.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(custom_attribute, custom_derive, plugin)]

#[macro_use]
extern crate criterion;
extern crate rand;
Expand All @@ -9,8 +7,7 @@ extern crate serde;
extern crate serde_derive;

use criterion::Criterion;
use rand::ChaChaRng;
use rand::{RngCore, FromEntropy};
use rand::{thread_rng, RngCore};
use sealpir::client::PirClient;
use sealpir::server::PirServer;
use std::time::Duration;
Expand All @@ -32,7 +29,7 @@ fn setup(c: &mut Criterion) {
&format!("setup_d{}", DIM),
|b, &&num| {
// setup
let mut rng = ChaChaRng::from_entropy();
let mut rng = thread_rng();
let mut collection = vec![];
for _ in 0..num {
let mut x = [0u8; SIZE];
Expand Down Expand Up @@ -67,7 +64,7 @@ fn expand(c: &mut Criterion) {
&format!("expand_d{}", DIM),
|b, &&num| {
// setup
let mut rng = ChaChaRng::from_entropy();
let mut rng = thread_rng();
let mut collection = vec![];
for _ in 0..num {
let mut x = [0u8; SIZE];
Expand Down Expand Up @@ -96,7 +93,7 @@ fn reply(c: &mut Criterion) {
&format!("reply_d{}", DIM),
|b, &&num| {
// setup
let mut rng = ChaChaRng::from_entropy();
let mut rng = thread_rng();
let mut collection = vec![];
for _ in 0..num {
let mut x = [0u8; SIZE];
Expand Down Expand Up @@ -125,7 +122,7 @@ fn decode(c: &mut Criterion) {
&format!("decode_d{}", DIM),
|b, &&num| {
// setup
let mut rng = ChaChaRng::from_entropy();
let mut rng = thread_rng();
let mut collection = vec![];
for _ in 0..num {
let mut x = [0u8; SIZE];
Expand Down

0 comments on commit dede8ae

Please sign in to comment.