From 6972e3a387aa267c6d99e9997f4283e8489712c6 Mon Sep 17 00:00:00 2001 From: Ertugrul Aypek Date: Fri, 10 Jan 2025 11:13:08 +0100 Subject: [PATCH] simplify size --- iris-mpc-store/src/lib.rs | 1 - iris-mpc-store/src/s3_importer.rs | 24 ++++++++---------------- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/iris-mpc-store/src/lib.rs b/iris-mpc-store/src/lib.rs index 97d29b7cc..46841ee16 100644 --- a/iris-mpc-store/src/lib.rs +++ b/iris-mpc-store/src/lib.rs @@ -13,7 +13,6 @@ use iris_mpc_common::{ config::Config, galois_engine::degree4::{GaloisRingIrisCodeShare, GaloisRingTrimmedMaskCodeShare}, iris_db::iris::IrisCode, - IRIS_CODE_LENGTH, MASK_CODE_LENGTH, }; use rand::{rngs::StdRng, Rng, SeedableRng}; pub use s3_importer::{fetch_and_parse_chunks, last_snapshot_timestamp, ObjectStore, S3Store}; diff --git a/iris-mpc-store/src/s3_importer.rs b/iris-mpc-store/src/s3_importer.rs index d339b846d..59df6b017 100644 --- a/iris-mpc-store/src/s3_importer.rs +++ b/iris-mpc-store/src/s3_importer.rs @@ -58,22 +58,14 @@ impl S3StoredIris { ) as i64; // parse codes and masks for each limb separately - let left_code_odd = - extract_slice(bytes, &mut cursor, IRIS_CODE_LENGTH * size_of::() / 2)?; - let left_code_even = - extract_slice(bytes, &mut cursor, IRIS_CODE_LENGTH * size_of::() / 2)?; - let left_mask_odd = - extract_slice(bytes, &mut cursor, MASK_CODE_LENGTH * size_of::() / 2)?; - let left_mask_even = - extract_slice(bytes, &mut cursor, MASK_CODE_LENGTH * size_of::() / 2)?; - let right_code_odd = - extract_slice(bytes, &mut cursor, IRIS_CODE_LENGTH * size_of::() / 2)?; - let right_code_even = - extract_slice(bytes, &mut cursor, IRIS_CODE_LENGTH * size_of::() / 2)?; - let right_mask_odd = - extract_slice(bytes, &mut cursor, MASK_CODE_LENGTH * size_of::() / 2)?; - let right_mask_even = - extract_slice(bytes, &mut cursor, MASK_CODE_LENGTH * size_of::() / 2)?; + let left_code_odd = extract_slice(bytes, &mut cursor, IRIS_CODE_LENGTH)?; + let left_code_even = extract_slice(bytes, &mut cursor, IRIS_CODE_LENGTH)?; + let left_mask_odd = extract_slice(bytes, &mut cursor, MASK_CODE_LENGTH)?; + let left_mask_even = extract_slice(bytes, &mut cursor, MASK_CODE_LENGTH)?; + let right_code_odd = extract_slice(bytes, &mut cursor, IRIS_CODE_LENGTH)?; + let right_code_even = extract_slice(bytes, &mut cursor, IRIS_CODE_LENGTH)?; + let right_mask_odd = extract_slice(bytes, &mut cursor, MASK_CODE_LENGTH)?; + let right_mask_even = extract_slice(bytes, &mut cursor, MASK_CODE_LENGTH)?; Ok(S3StoredIris { id,