From 326376aa729338cdc1a5ceee58263c07428fcc80 Mon Sep 17 00:00:00 2001 From: Shinta Liem Date: Thu, 27 Jun 2024 23:08:15 +0800 Subject: [PATCH 1/8] Integer multiplication implementation (draft) --- .../src/protocol/ipa_prf/boolean_ops/mod.rs | 1 + .../ipa_prf/boolean_ops/multiplication.rs | 152 ++++++++++++++++-- 2 files changed, 140 insertions(+), 13 deletions(-) diff --git a/ipa-core/src/protocol/ipa_prf/boolean_ops/mod.rs b/ipa-core/src/protocol/ipa_prf/boolean_ops/mod.rs index a50c260ad..b15dc5692 100644 --- a/ipa-core/src/protocol/ipa_prf/boolean_ops/mod.rs +++ b/ipa-core/src/protocol/ipa_prf/boolean_ops/mod.rs @@ -2,6 +2,7 @@ pub mod addition_sequential; pub mod comparison_and_subtraction_sequential; mod share_conversion_aby; pub(crate) mod step; +mod multiplication; pub use share_conversion_aby::{ convert_to_fp25519, expand_shared_array_in_place, extract_from_shared_array, }; diff --git a/ipa-core/src/protocol/ipa_prf/boolean_ops/multiplication.rs b/ipa-core/src/protocol/ipa_prf/boolean_ops/multiplication.rs index 345747043..38ce99bb5 100644 --- a/ipa-core/src/protocol/ipa_prf/boolean_ops/multiplication.rs +++ b/ipa-core/src/protocol/ipa_prf/boolean_ops/multiplication.rs @@ -1,33 +1,159 @@ -use std::iter::zip; - +use crate::protocol::basics::mul::SecureMul; use crate::{ error::Error, ff::boolean::Boolean, protocol::{ - context::Context, - RecordId, - ipa_prf::boolean_ops::{ - addition_sequential::integer_add, - }, + boolean::NBitStep, context::Context, + ipa_prf::boolean_ops::addition_sequential::integer_add, BooleanProtocols, RecordId, }, secret_sharing::{replicated::semi_honest::AdditiveShare, BitDecomposed, FieldSimd}, }; - +/// This function multiplies x by y in these steps: +/// 1. Double the input precision and repeat the most significant bit in the extra bits (Sign extension) +/// 2. Repeatedly multiply x with each digits of y, shift the result 1 digit up each time +/// 3. Add up the partial products using integer_add +/// y is assumed to be a positive number +/// x is assumed to be in two's complement and can be either signed or unsigned +#[allow(dead_code)] pub async fn integer_mul( ctx: C, record_id: RecordId, x: &BitDecomposed>, y: &BitDecomposed>, -) -> Result< - BitDecomposed>, - Error, -> +) -> Result>, Error> where C: Context, S: NBitStep, Boolean: FieldSimd, AdditiveShare: BooleanProtocols, { - //TODO: To be implemented + let new_len = x.len() + y.len(); + let mut y = y.clone(); + y.resize(new_len, AdditiveShare::ZERO); + let mut x = x.clone(); + x.resize(new_len, x[x.len() - 1].clone()); + + let mut result = BitDecomposed::with_capacity(new_len); + for (i, xb) in x.into_iter().enumerate() { + let mut t = BitDecomposed::with_capacity(new_len); + t.resize(i, AdditiveShare::ZERO); + let ctx_for_bit_of_x = ctx.narrow(&S::from(i)); + for (j, yb) in y.iter().take(new_len - i).enumerate() { + let ctx_for_x_times_y_combo = ctx_for_bit_of_x.narrow(&S::from(j)); + + let m = xb.multiply(yb, ctx_for_x_times_y_combo, record_id).await?; + t.push(m); + } + if i == 0 { + result = t; + } else { + let (new_result, _) = integer_add::<_, S, N>( + ctx_for_bit_of_x.narrow("add_partial_products"), + record_id, + &t, + &result, + ) + .await?; + result = new_result; + } + assert_eq!(result.len(), new_len); + } + + Ok(result) +} + +#[cfg(all(test, unit_test))] +mod test { + use std::iter; + + use rand::{thread_rng, Rng}; + + use crate::{ + ff::{ + boolean::Boolean, + boolean_array::{BooleanArray, BA16, BA8}, + U128Conversions, + }, + protocol::{ + boolean::step::DefaultBitStep, context::Context, + ipa_prf::boolean_ops::multiplication::integer_mul, RecordId, + }, + secret_sharing::{replicated::semi_honest::AdditiveShare, BitDecomposed, TransposeFrom}, + test_executor::run, + test_fixture::{Reconstruct, Runner, TestWorld}, + }; + + fn as_i128(x: B) -> i128 + where + B: BooleanArray + U128Conversions, + { + let mut out: i128 = i128::try_from(x.as_u128()).unwrap(); + let msb = (out >> (B::BITS - 1)) & 1; + out -= msb * (1 << B::BITS); + out + } + + #[test] + #[allow(clippy::cast_precision_loss)] + fn semi_honest_mul() { + run(|| async move { + let world = TestWorld::default(); + + let mut rng = thread_rng(); + + let all_x_values = (0..256) + .map(|i| BA8::truncate_from(u128::try_from(i).unwrap())) + .collect::>(); + let random_y_values = (0..256).map(|_| rng.gen::()).collect::>(); + + let result: Vec = world + .upgraded_semi_honest( + all_x_values + .clone() + .into_iter() + .zip(random_y_values.clone()), + |ctx, x_y_vals| async move { + let (x_vals, y_vals): (Vec>, Vec>) = + x_y_vals.into_iter().unzip(); + let mut vectorized_x_inputs: BitDecomposed> = + BitDecomposed::new(iter::empty()); + let _ = vectorized_x_inputs.transpose_from(&x_vals); + + let mut vectorized_y_inputs: BitDecomposed> = + BitDecomposed::new(iter::empty()); + let _ = vectorized_y_inputs.transpose_from(&y_vals); + + let result = integer_mul::<_, DefaultBitStep, 256>( + ctx.set_total_records(1), + RecordId::FIRST, + &vectorized_y_inputs, + &vectorized_x_inputs, + ) + .await + .unwrap(); + + Vec::transposed_from(&result).unwrap() + }, + ) + .await + .reconstruct(); + + for ((res, x), y) in result + .iter() + .zip(all_x_values.iter()) + .zip(random_y_values.iter()) + { + let y_as_signed_number: i128 = as_i128(*y); + let x_as_unsigned_number: i128 = x.as_u128() as i128; + let expected: i128 = y_as_signed_number * x_as_unsigned_number; + + assert_eq!( + (x, y, y_as_signed_number, x_as_unsigned_number, expected), + // (x, y, y_as_unsigned_number, x_as_signed_number, res.as_u128()) + (x, y, y_as_signed_number, x_as_unsigned_number, as_i128(*res)) + ); + } + }); + } } From 9c3e640f8a0a31545e02324054a4394a725c6ad8 Mon Sep 17 00:00:00 2001 From: Shinta Liem Date: Fri, 28 Jun 2024 12:31:37 +0800 Subject: [PATCH 2/8] (Draft) Fix mixed up signed and unsigned number in input; mistake in copying MSB in extend --- .../ipa_prf/boolean_ops/multiplication.rs | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/ipa-core/src/protocol/ipa_prf/boolean_ops/multiplication.rs b/ipa-core/src/protocol/ipa_prf/boolean_ops/multiplication.rs index 38ce99bb5..6799066a3 100644 --- a/ipa-core/src/protocol/ipa_prf/boolean_ops/multiplication.rs +++ b/ipa-core/src/protocol/ipa_prf/boolean_ops/multiplication.rs @@ -13,8 +13,8 @@ use crate::{ /// 1. Double the input precision and repeat the most significant bit in the extra bits (Sign extension) /// 2. Repeatedly multiply x with each digits of y, shift the result 1 digit up each time /// 3. Add up the partial products using integer_add -/// y is assumed to be a positive number -/// x is assumed to be in two's complement and can be either signed or unsigned +/// x is assumed to be a positive number +/// y is assumed to be in two's complement and can be either signed or unsigned #[allow(dead_code)] pub async fn integer_mul( ctx: C, @@ -29,27 +29,32 @@ where AdditiveShare: BooleanProtocols, { let new_len = x.len() + y.len(); - let mut y = y.clone(); - y.resize(new_len, AdditiveShare::ZERO); let mut x = x.clone(); - x.resize(new_len, x[x.len() - 1].clone()); + x.resize(new_len, AdditiveShare::ZERO); + let mut y = y.clone(); + y.resize(new_len, y[y.len() - 1].clone()); let mut result = BitDecomposed::with_capacity(new_len); - for (i, xb) in x.into_iter().enumerate() { + for (i, yb) in y.into_iter().enumerate() { let mut t = BitDecomposed::with_capacity(new_len); t.resize(i, AdditiveShare::ZERO); - let ctx_for_bit_of_x = ctx.narrow(&S::from(i)); - for (j, yb) in y.iter().take(new_len - i).enumerate() { - let ctx_for_x_times_y_combo = ctx_for_bit_of_x.narrow(&S::from(j)); + // TODO fix the context with proper steps + let ctx_for_bit_of_y = ctx.narrow(&S::from(i)); + for (j, xb) in x.iter().take(new_len - i).enumerate() { + let ctx_for_x_times_y_combo = ctx_for_bit_of_y.narrow(&S::from(j)); - let m = xb.multiply(yb, ctx_for_x_times_y_combo, record_id).await?; + let m = yb.multiply(xb, ctx_for_x_times_y_combo, record_id).await?; t.push(m); } + + // TODO : Optimisation - make this run in paralel: + // - calculate all the partial products store it in a matrix + // - sum it all up in paralel if i == 0 { result = t; } else { let (new_result, _) = integer_add::<_, S, N>( - ctx_for_bit_of_x.narrow("add_partial_products"), + ctx_for_bit_of_y.narrow("add_partial_products"), record_id, &t, &result, @@ -127,8 +132,8 @@ mod test { let result = integer_mul::<_, DefaultBitStep, 256>( ctx.set_total_records(1), RecordId::FIRST, - &vectorized_y_inputs, &vectorized_x_inputs, + &vectorized_y_inputs, ) .await .unwrap(); From c6da94e9965f671cab3dc7cb8ca586a06861e0d7 Mon Sep 17 00:00:00 2001 From: Shinta Liem Date: Tue, 2 Jul 2024 15:36:05 +0800 Subject: [PATCH 3/8] add parallel join --- .../src/protocol/ipa_prf/boolean_ops/mod.rs | 2 +- .../ipa_prf/boolean_ops/multiplication.rs | 46 ++++++++----------- 2 files changed, 21 insertions(+), 27 deletions(-) diff --git a/ipa-core/src/protocol/ipa_prf/boolean_ops/mod.rs b/ipa-core/src/protocol/ipa_prf/boolean_ops/mod.rs index b15dc5692..78f2631e8 100644 --- a/ipa-core/src/protocol/ipa_prf/boolean_ops/mod.rs +++ b/ipa-core/src/protocol/ipa_prf/boolean_ops/mod.rs @@ -1,8 +1,8 @@ pub mod addition_sequential; pub mod comparison_and_subtraction_sequential; +mod multiplication; mod share_conversion_aby; pub(crate) mod step; -mod multiplication; pub use share_conversion_aby::{ convert_to_fp25519, expand_shared_array_in_place, extract_from_shared_array, }; diff --git a/ipa-core/src/protocol/ipa_prf/boolean_ops/multiplication.rs b/ipa-core/src/protocol/ipa_prf/boolean_ops/multiplication.rs index 6799066a3..2ea067bbd 100644 --- a/ipa-core/src/protocol/ipa_prf/boolean_ops/multiplication.rs +++ b/ipa-core/src/protocol/ipa_prf/boolean_ops/multiplication.rs @@ -10,7 +10,8 @@ use crate::{ }; /// This function multiplies x by y in these steps: -/// 1. Double the input precision and repeat the most significant bit in the extra bits (Sign extension) +/// 1. Double the input precision for y and repeat the most significant bit in the extra bits (Sign extension) +/// X is assumed to be a positive number, so we will automatically pad with ZERO. /// 2. Repeatedly multiply x with each digits of y, shift the result 1 digit up each time /// 3. Add up the partial products using integer_add /// x is assumed to be a positive number @@ -29,31 +30,28 @@ where AdditiveShare: BooleanProtocols, { let new_len = x.len() + y.len(); - let mut x = x.clone(); - x.resize(new_len, AdditiveShare::ZERO); let mut y = y.clone(); y.resize(new_len, y[y.len() - 1].clone()); let mut result = BitDecomposed::with_capacity(new_len); for (i, yb) in y.into_iter().enumerate() { - let mut t = BitDecomposed::with_capacity(new_len); - t.resize(i, AdditiveShare::ZERO); - // TODO fix the context with proper steps let ctx_for_bit_of_y = ctx.narrow(&S::from(i)); - for (j, xb) in x.iter().take(new_len - i).enumerate() { - let ctx_for_x_times_y_combo = ctx_for_bit_of_y.narrow(&S::from(j)); - - let m = yb.multiply(xb, ctx_for_x_times_y_combo, record_id).await?; - t.push(m); - } + let product_of_x_and_yb = ctx_for_bit_of_y + .parallel_join(x.iter().take(new_len - i).enumerate().map(|(j, xb)| { + let ctx_for_x_times_y_combo = ctx_for_bit_of_y.narrow(&S::from(j)); + let yb = yb.clone(); + async move { yb.multiply(xb, ctx_for_x_times_y_combo, record_id).await } + })) + .await?; - // TODO : Optimisation - make this run in paralel: - // - calculate all the partial products store it in a matrix - // - sum it all up in paralel + let mut t = BitDecomposed::with_capacity(new_len); + // |x| * y(i) << i + t.resize(i, AdditiveShare::ZERO); + product_of_x_and_yb.into_iter().for_each(|b| t.push(b)); if i == 0 { result = t; } else { - let (new_result, _) = integer_add::<_, S, N>( + let (new_result, carry) = integer_add::<_, S, N>( ctx_for_bit_of_y.narrow("add_partial_products"), record_id, &t, @@ -61,8 +59,11 @@ where ) .await?; result = new_result; + + if result.len() < new_len { + result.push(carry); + } } - assert_eq!(result.len(), new_len); } Ok(result) @@ -149,15 +150,8 @@ mod test { .zip(all_x_values.iter()) .zip(random_y_values.iter()) { - let y_as_signed_number: i128 = as_i128(*y); - let x_as_unsigned_number: i128 = x.as_u128() as i128; - let expected: i128 = y_as_signed_number * x_as_unsigned_number; - - assert_eq!( - (x, y, y_as_signed_number, x_as_unsigned_number, expected), - // (x, y, y_as_unsigned_number, x_as_signed_number, res.as_u128()) - (x, y, y_as_signed_number, x_as_unsigned_number, as_i128(*res)) - ); + let expected: i128 = as_i128(*y) * x.as_u128() as i128; + assert_eq!((x, y, expected), (x, y, as_i128(*res))); } }); } From 809d4d4866f912c0007596b88e81412a979acbe3 Mon Sep 17 00:00:00 2001 From: Shinta Liem Date: Wed, 3 Jul 2024 10:50:59 +0800 Subject: [PATCH 4/8] Fix failing tests --- .../ipa_prf/boolean_ops/multiplication.rs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/ipa-core/src/protocol/ipa_prf/boolean_ops/multiplication.rs b/ipa-core/src/protocol/ipa_prf/boolean_ops/multiplication.rs index 2ea067bbd..b65d6c005 100644 --- a/ipa-core/src/protocol/ipa_prf/boolean_ops/multiplication.rs +++ b/ipa-core/src/protocol/ipa_prf/boolean_ops/multiplication.rs @@ -1,10 +1,11 @@ -use crate::protocol::basics::mul::SecureMul; +use ipa_step::StepNarrow; + use crate::{ error::Error, ff::boolean::Boolean, protocol::{ - boolean::NBitStep, context::Context, - ipa_prf::boolean_ops::addition_sequential::integer_add, BooleanProtocols, RecordId, + basics::mul::SecureMul, boolean::NBitStep, context::Context, + ipa_prf::boolean_ops::addition_sequential::integer_add, BooleanProtocols, Gate, RecordId, }, secret_sharing::{replicated::semi_honest::AdditiveShare, BitDecomposed, FieldSimd}, }; @@ -13,7 +14,7 @@ use crate::{ /// 1. Double the input precision for y and repeat the most significant bit in the extra bits (Sign extension) /// X is assumed to be a positive number, so we will automatically pad with ZERO. /// 2. Repeatedly multiply x with each digits of y, shift the result 1 digit up each time -/// 3. Add up the partial products using integer_add +/// 3. Add up the partial products using `integer_add` /// x is assumed to be a positive number /// y is assumed to be in two's complement and can be either signed or unsigned #[allow(dead_code)] @@ -28,6 +29,7 @@ where S: NBitStep, Boolean: FieldSimd, AdditiveShare: BooleanProtocols, + Gate: StepNarrow, { let new_len = x.len() + y.len(); let mut y = y.clone(); @@ -52,7 +54,7 @@ where result = t; } else { let (new_result, carry) = integer_add::<_, S, N>( - ctx_for_bit_of_y.narrow("add_partial_products"), + ctx_for_bit_of_y.narrow(&S::from(i)), record_id, &t, &result, @@ -150,7 +152,8 @@ mod test { .zip(all_x_values.iter()) .zip(random_y_values.iter()) { - let expected: i128 = as_i128(*y) * x.as_u128() as i128; + #[allow(clippy::cast_possible_wrap)] // we assume x is always positive + let expected: i128 = as_i128(*y) * (x.as_u128() as i128); assert_eq!((x, y, expected), (x, y, as_i128(*res))); } }); From a2fc14bb5be63b73cc06f22b85b129e3f3c2fc30 Mon Sep 17 00:00:00 2001 From: Shinta Liem Date: Wed, 3 Jul 2024 14:18:44 +0800 Subject: [PATCH 5/8] invoke only on i..new_len bits of the interim multiplication result --- .../ipa_prf/boolean_ops/multiplication.rs | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/ipa-core/src/protocol/ipa_prf/boolean_ops/multiplication.rs b/ipa-core/src/protocol/ipa_prf/boolean_ops/multiplication.rs index b65d6c005..388b55666 100644 --- a/ipa-core/src/protocol/ipa_prf/boolean_ops/multiplication.rs +++ b/ipa-core/src/protocol/ipa_prf/boolean_ops/multiplication.rs @@ -46,23 +46,24 @@ where })) .await?; - let mut t = BitDecomposed::with_capacity(new_len); - // |x| * y(i) << i - t.resize(i, AdditiveShare::ZERO); - product_of_x_and_yb.into_iter().for_each(|b| t.push(b)); + let t = BitDecomposed::try_from(product_of_x_and_yb).unwrap(); if i == 0 { result = t; } else { - let (new_result, carry) = integer_add::<_, S, N>( + // add up bits i.. with the product + let mut add_y = BitDecomposed::with_capacity(new_len); + result.iter().skip(i).for_each(|b| { add_y.push(b.clone()) }); + let (add_result, carry) = integer_add::<_, S, N>( ctx_for_bit_of_y.narrow(&S::from(i)), record_id, &t, - &result, + &add_y, ) .await?; - result = new_result; - if result.len() < new_len { + result.truncate(i); // replace the bits on i.. with the one we add up + add_result.iter().for_each(|b| { result.push(b.clone()) }); + if result.len() < new_len { // if carry bit is more than max length, we let it overflow result.push(carry); } } @@ -152,8 +153,7 @@ mod test { .zip(all_x_values.iter()) .zip(random_y_values.iter()) { - #[allow(clippy::cast_possible_wrap)] // we assume x is always positive - let expected: i128 = as_i128(*y) * (x.as_u128() as i128); + let expected: i128 = as_i128(*y) * i128::try_from(x.as_u128()).unwrap(); assert_eq!((x, y, expected), (x, y, as_i128(*res))); } }); From 51cd83365313e72694ad5ab5f54a0c86ed738c06 Mon Sep 17 00:00:00 2001 From: Shinta Liem Date: Wed, 3 Jul 2024 14:46:55 +0800 Subject: [PATCH 6/8] Add MultiplicationStep --- .../protocol/ipa_prf/boolean_ops/multiplication.rs | 11 +++++++---- ipa-core/src/protocol/ipa_prf/boolean_ops/step.rs | 8 ++++++++ 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/ipa-core/src/protocol/ipa_prf/boolean_ops/multiplication.rs b/ipa-core/src/protocol/ipa_prf/boolean_ops/multiplication.rs index 388b55666..fe6d1df60 100644 --- a/ipa-core/src/protocol/ipa_prf/boolean_ops/multiplication.rs +++ b/ipa-core/src/protocol/ipa_prf/boolean_ops/multiplication.rs @@ -31,6 +31,8 @@ where AdditiveShare: BooleanProtocols, Gate: StepNarrow, { + use super::step::MultiplicationStep as Step; + let new_len = x.len() + y.len(); let mut y = y.clone(); y.resize(new_len, y[y.len() - 1].clone()); @@ -52,9 +54,9 @@ where } else { // add up bits i.. with the product let mut add_y = BitDecomposed::with_capacity(new_len); - result.iter().skip(i).for_each(|b| { add_y.push(b.clone()) }); + result.iter().skip(i).for_each(|b| add_y.push(b.clone())); let (add_result, carry) = integer_add::<_, S, N>( - ctx_for_bit_of_y.narrow(&S::from(i)), + ctx_for_bit_of_y.narrow::(&Step::Add), record_id, &t, &add_y, @@ -62,8 +64,9 @@ where .await?; result.truncate(i); // replace the bits on i.. with the one we add up - add_result.iter().for_each(|b| { result.push(b.clone()) }); - if result.len() < new_len { // if carry bit is more than max length, we let it overflow + add_result.iter().for_each(|b| result.push(b.clone())); + if result.len() < new_len { + // if carry bit is more than max length, we let it overflow result.push(carry); } } diff --git a/ipa-core/src/protocol/ipa_prf/boolean_ops/step.rs b/ipa-core/src/protocol/ipa_prf/boolean_ops/step.rs index c4d10bdf6..7979e7e8c 100644 --- a/ipa-core/src/protocol/ipa_prf/boolean_ops/step.rs +++ b/ipa-core/src/protocol/ipa_prf/boolean_ops/step.rs @@ -29,3 +29,11 @@ pub(crate) enum Fp25519ConversionStep { #[step(count = 256)] RevealY(usize), } + +#[derive(CompactStep)] +pub(crate) enum MultiplicationStep { + #[step(child = crate::protocol::boolean::step::SixteenBitStep)] + MultiplyBits, + #[step(child = crate::protocol::boolean::step::SixteenBitStep)] + Add, +} From 851b46109c66901d2d9c5cbe16b13761fbddc622 Mon Sep 17 00:00:00 2001 From: Shinta Liem Date: Wed, 3 Jul 2024 22:13:38 +0800 Subject: [PATCH 7/8] Simplify code --- ipa-core/src/protocol/ipa_prf/boolean_ops/multiplication.rs | 6 ++---- ipa-core/src/protocol/ipa_prf/boolean_ops/step.rs | 2 -- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/ipa-core/src/protocol/ipa_prf/boolean_ops/multiplication.rs b/ipa-core/src/protocol/ipa_prf/boolean_ops/multiplication.rs index fe6d1df60..3adfb93eb 100644 --- a/ipa-core/src/protocol/ipa_prf/boolean_ops/multiplication.rs +++ b/ipa-core/src/protocol/ipa_prf/boolean_ops/multiplication.rs @@ -53,8 +53,7 @@ where result = t; } else { // add up bits i.. with the product - let mut add_y = BitDecomposed::with_capacity(new_len); - result.iter().skip(i).for_each(|b| add_y.push(b.clone())); + let add_y = BitDecomposed::new(result.clone().into_iter().skip(i)); let (add_result, carry) = integer_add::<_, S, N>( ctx_for_bit_of_y.narrow::(&Step::Add), record_id, @@ -63,8 +62,7 @@ where ) .await?; - result.truncate(i); // replace the bits on i.. with the one we add up - add_result.iter().for_each(|b| result.push(b.clone())); + result = BitDecomposed::new(result.into_iter().take(i).chain(add_result.into_iter())); if result.len() < new_len { // if carry bit is more than max length, we let it overflow result.push(carry); diff --git a/ipa-core/src/protocol/ipa_prf/boolean_ops/step.rs b/ipa-core/src/protocol/ipa_prf/boolean_ops/step.rs index 7979e7e8c..f45ab0828 100644 --- a/ipa-core/src/protocol/ipa_prf/boolean_ops/step.rs +++ b/ipa-core/src/protocol/ipa_prf/boolean_ops/step.rs @@ -32,8 +32,6 @@ pub(crate) enum Fp25519ConversionStep { #[derive(CompactStep)] pub(crate) enum MultiplicationStep { - #[step(child = crate::protocol::boolean::step::SixteenBitStep)] - MultiplyBits, #[step(child = crate::protocol::boolean::step::SixteenBitStep)] Add, } From 701803e4e0bd30ef83c848fd7be7860cc0b81711 Mon Sep 17 00:00:00 2001 From: Shinta Liem Date: Thu, 4 Jul 2024 13:32:11 +0800 Subject: [PATCH 8/8] Add MultiplicationStep to DeadCodeStep --- ipa-core/src/protocol/step.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ipa-core/src/protocol/step.rs b/ipa-core/src/protocol/step.rs index ca915ed8b..a8c9dd1e4 100644 --- a/ipa-core/src/protocol/step.rs +++ b/ipa-core/src/protocol/step.rs @@ -49,4 +49,6 @@ pub enum DeadCodeStep { NoiseGen, #[step(child = crate::protocol::dp::step::DPStep)] ApplyNoise, + #[step(child = crate::protocol::ipa_prf::boolean_ops::step::MultiplicationStep)] + Multiplication, }