Skip to content

Commit

Permalink
size is expressed in bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
piotr-roslaniec committed Jan 30, 2023
1 parent 6966b28 commit 6f1b7d4
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions ferveo/examples/bench_primitives_size.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,25 @@ pub fn create_or_truncate_output_file() -> std::io::Result<()> {
.open(file_path)?;
file.sync_all()?;

writeln!(file, "|shares_num|threshold|pvss_transcript_size|",)?;
writeln!(file, "|shares_num|threshold|pvss_transcript_size_bytes|",)?;
writeln!(file, "|---|---|---|---|")
}

pub fn save_data(shares_num: usize, threshold: usize, transcript_size: usize) {
pub fn save_data(
shares_num: usize,
threshold: usize,
transcript_size_bytes: usize,
) {
let file_path = PathBuf::from(OUTPUT_DIR_PATH).join(OUTPUT_FILE_NAME);

eprintln!("Appending to file: {}", file_path.display());
let mut file = OpenOptions::new().append(true).open(&file_path).unwrap();
writeln!(file, "{}|{}|{}|", shares_num, threshold, transcript_size)
.unwrap();
writeln!(
file,
"{}|{}|{}|",
shares_num, threshold, transcript_size_bytes
)
.unwrap();
}

// TODO: Find a way to deduplicate the following methods with benchmarks and test setup
Expand Down

0 comments on commit 6f1b7d4

Please sign in to comment.