From 37a2a7e26321692c1cf12e3d140a2275604324c0 Mon Sep 17 00:00:00 2001
From: "a.stevan" <antoine.stevan@isae-supaero.fr>
Date: Tue, 9 Apr 2024 11:26:58 +0200
Subject: [PATCH] don't try to compress with validation

that's useless.

the commit also modifies the plot script accordingly.
---
 benches/plot.py              |  6 ++----
 examples/bench_setup_size.rs | 15 +++------------
 2 files changed, 5 insertions(+), 16 deletions(-)

diff --git a/benches/plot.py b/benches/plot.py
index 3e9dcdce..6272be95 100644
--- a/benches/plot.py
+++ b/benches/plot.py
@@ -142,10 +142,8 @@ def plot_setup(data: Data, save: bool = False):
     axs[2].legend()
     axs[2].grid()
 
-    plot(data, "serialized size with no compression and no validation", "uncompressed unvalidated", "red", False, axs[3])
-    plot(data, "serialized size with compression and no validation", "compressed unvalidated", "orange", False, axs[3])
-    plot(data, "serialized size with no compression and validation", "uncompressed validated", "blue", False, axs[3])
-    plot(data, "serialized size with compression and validation", "compressed validated", "green", False, axs[3])
+    plot(data, "serialized size with no compression", "uncompressed", "orange", False, axs[3])
+    plot(data, "serialized size with compression", "compressed", "blue", False, axs[3])
     axs[3].set_title("size")
     axs[3].set_xlabel("degree")
     axs[3].set_ylabel("size (in kb)")
diff --git a/examples/bench_setup_size.rs b/examples/bench_setup_size.rs
index 6873b44c..cc7781c2 100644
--- a/examples/bench_setup_size.rs
+++ b/examples/bench_setup_size.rs
@@ -2,7 +2,7 @@ use ark_bls12_381::{Fr, G1Projective};
 use ark_ec::CurveGroup;
 use ark_ff::PrimeField;
 use ark_poly::{univariate::DensePolynomial, DenseUVPolynomial};
-use ark_serialize::{CanonicalSerialize, Compress, Validate};
+use ark_serialize::{CanonicalSerialize, Compress};
 use ark_std::ops::Div;
 
 use komodo::zk;
@@ -20,22 +20,13 @@ where
 
     let setup = zk::setup::<_, F, G>(degree, rng).unwrap();
 
-    for (compress, validate) in [
-        (Compress::Yes, Validate::Yes),
-        (Compress::Yes, Validate::No),
-        (Compress::No, Validate::Yes),
-        (Compress::No, Validate::No),
-    ] {
+    for compress in [Compress::Yes, Compress::No] {
         println!(
-            r#"{{"reason": "benchmark-complete", "id": "serialized size with {} and {} {} on {}", "mean": {}}}"#,
+            r#"{{"reason": "benchmark-complete", "id": "serialized size with {} {} on {}", "mean": {}}}"#,
             match compress {
                 Compress::Yes => "compression",
                 Compress::No => "no compression",
             },
-            match validate {
-                Validate::Yes => "validation",
-                Validate::No => "no validation",
-            },
             degree,
             std::any::type_name::<F>(),
             setup.serialized_size(compress),
-- 
GitLab