From dc5acd28db03920982de623f51dd4df236ff7381 Mon Sep 17 00:00:00 2001 From: Daniel Kales <11509575+dkales@users.noreply.github.com> Date: Tue, 15 Oct 2024 11:27:45 +0200 Subject: [PATCH] refactor!: make pointshare in Groth16 MPC trait generic over the curve This de-duplicates a bit of code. BREAKING CHANGE: the public interface of the Groth16MPCProver trait has changed. --- co-circom/co-groth16/src/groth16.rs | 48 ++++++++-------- co-circom/co-groth16/src/mpc.rs | 74 ++++++++++++------------- co-circom/co-groth16/src/mpc/plain.rs | 77 ++++++++++++-------------- co-circom/co-groth16/src/mpc/rep3.rs | 72 ++++++++++++------------ co-circom/co-groth16/src/mpc/shamir.rs | 72 ++++++++++++------------ 5 files changed, 164 insertions(+), 179 deletions(-) diff --git a/co-circom/co-groth16/src/groth16.rs b/co-circom/co-groth16/src/groth16.rs index edaedd3b6..0cec318f8 100644 --- a/co-circom/co-groth16/src/groth16.rs +++ b/co-circom/co-groth16/src/groth16.rs @@ -291,12 +291,12 @@ where fn calculate_coeff_g1( id: T::PartyID, - initial: T::PointShareG1, + initial: T::PointShare, query: &[P::G1Affine], vk_param: P::G1Affine, input_assignment: &[P::ScalarField], aux_assignment: &[T::ArithmeticShare], - ) -> T::PointShareG1 { + ) -> T::PointShare { let pub_len = input_assignment.len(); // we block this thread of the runtime here. @@ -304,25 +304,25 @@ where // runtime. let (pub_acc, priv_acc) = rayon::join( || P::G1::msm_unchecked(&query[1..=pub_len], input_assignment), - || T::msm_public_points_g1(&query[1 + pub_len..], aux_assignment), + || T::msm_public_points(&query[1 + pub_len..], aux_assignment), ); let mut res = initial; - T::add_assign_points_public_g1(id, &mut res, &query[0].into_group()); - T::add_assign_points_public_g1(id, &mut res, &vk_param.into_group()); - T::add_assign_points_public_g1(id, &mut res, &pub_acc); - T::add_assign_points_g1(&mut res, &priv_acc); + T::add_assign_points_public(id, &mut res, &query[0].into_group()); + T::add_assign_points_public(id, &mut res, &vk_param.into_group()); + T::add_assign_points_public(id, &mut res, &pub_acc); + T::add_assign_points(&mut res, &priv_acc); res } fn calculate_coeff_g2( id: T::PartyID, - initial: T::PointShareG2, + initial: T::PointShare, query: &[P::G2Affine], vk_param: P::G2Affine, input_assignment: &[P::ScalarField], aux_assignment: &[T::ArithmeticShare], - ) -> T::PointShareG2 { + ) -> T::PointShare { let pub_len = input_assignment.len(); // we block this thread of the runtime here. @@ -330,14 +330,14 @@ where // runtime. let (pub_acc, priv_acc) = rayon::join( || P::G2::msm_unchecked(&query[1..=pub_len], input_assignment), - || T::msm_public_points_g2(&query[1 + pub_len..], aux_assignment), + || T::msm_public_points(&query[1 + pub_len..], aux_assignment), ); let mut res = initial; - T::add_assign_points_public_g2(id, &mut res, &query[0].into_group()); - T::add_assign_points_public_g2(id, &mut res, &vk_param.into_group()); - T::add_assign_points_public_g2(id, &mut res, &pub_acc); - T::add_assign_points_g2(&mut res, &priv_acc); + T::add_assign_points_public(id, &mut res, &query[0].into_group()); + T::add_assign_points_public(id, &mut res, &vk_param.into_group()); + T::add_assign_points_public(id, &mut res, &pub_acc); + T::add_assign_points(&mut res, &priv_acc); res } @@ -380,7 +380,7 @@ where let compute_a = tracing::debug_span!("compute A in create proof with assignment").entered(); // Compute A - let r_g1 = T::scalar_mul_public_point_g1(&delta_g1, r); + let r_g1 = T::scalar_mul_public_point(&delta_g1, r); let r_g1 = Self::calculate_coeff_g1( party_id, r_g1, @@ -398,7 +398,7 @@ where tracing::debug_span!("compute B/G1 in create proof with assignment").entered(); // Compute B in G1 // In original implementation this is skipped if r==0, however r is shared in our case - let s_g1 = T::scalar_mul_public_point_g1(&delta_g1, s); + let s_g1 = T::scalar_mul_public_point(&delta_g1, s); let s_g1 = Self::calculate_coeff_g1( party_id, s_g1, @@ -415,7 +415,7 @@ where let compute_b = tracing::debug_span!("compute B/G2 in create proof with assignment").entered(); // Compute B in G2 - let s_g2 = T::scalar_mul_public_point_g2(&delta_g2, s); + let s_g2 = T::scalar_mul_public_point(&delta_g2, s); let s_g2 = Self::calculate_coeff_g2( party_id, s_g2, @@ -430,7 +430,7 @@ where rayon::spawn(move || { let msm_l_query = tracing::debug_span!("msm l_query").entered(); - let result = T::msm_public_points_g1(l_query.as_ref(), &aux_assignment4); + let result = T::msm_public_points(l_query.as_ref(), &aux_assignment4); l_acc_tx.send(result).expect("channel not dropped"); msm_l_query.exit(); }); @@ -442,7 +442,7 @@ where }); let rs = self.driver.mul(r, s)?; - let r_s_delta_g1 = T::scalar_mul_public_point_g1(&delta_g1, rs); + let r_s_delta_g1 = T::scalar_mul_public_point(&delta_g1, rs); let l_aux_acc = l_acc_rx.blocking_recv().expect("channel not dropped"); @@ -456,15 +456,15 @@ where network_round.exit(); let last_round = tracing::debug_span!("finish open two points and some adds").entered(); - let s_g_a = T::scalar_mul_public_point_g1(&g_a_opened, s); + let s_g_a = T::scalar_mul_public_point(&g_a_opened, s); let mut g_c = s_g_a; - T::add_assign_points_g1(&mut g_c, &r_g1_b); - T::sub_assign_points_g1(&mut g_c, &r_s_delta_g1); - T::add_assign_points_g1(&mut g_c, &l_aux_acc); + T::add_assign_points(&mut g_c, &r_g1_b); + T::sub_assign_points(&mut g_c, &r_s_delta_g1); + T::add_assign_points(&mut g_c, &l_aux_acc); let h_acc = h_acc_rx.blocking_recv()?; - let g_c = T::add_points_g1_half_share(g_c, &h_acc); + let g_c = T::add_points_half_share(g_c, &h_acc); let g2_b = s_g2_rx.blocking_recv()?; let (g_c_opened, g2_b_opened) = self.driver.open_two_points(g_c, g2_b)?; diff --git a/co-circom/co-groth16/src/mpc.rs b/co-circom/co-groth16/src/mpc.rs index ff8db8c44..718b11350 100644 --- a/co-circom/co-groth16/src/mpc.rs +++ b/co-circom/co-groth16/src/mpc.rs @@ -1,7 +1,7 @@ use core::fmt; use std::fmt::Debug; -use ark_ec::pairing::Pairing; +use ark_ec::{pairing::Pairing, CurveGroup}; use ark_poly::domain::DomainCoeff; use ark_serialize::{CanonicalDeserialize, CanonicalSerialize}; @@ -28,9 +28,9 @@ pub trait CircomGroth16Prover: Send + Sized { + DomainCoeff + 'static; /// The G1 point share type - type PointShareG1: Debug + Send + 'static; - /// The G2 point share type - type PointShareG2: Debug + Send + 'static; + type PointShare: Debug + Send + 'static + where + C: CurveGroup; /// The party id type type PartyID: Send + Sync + Copy + fmt::Display + 'static; @@ -78,64 +78,62 @@ pub trait CircomGroth16Prover: Send + Sized { roots: &[P::ScalarField], ); - /// Perform msm between G1 `points` and `scalars` - fn msm_public_points_g1( - points: &[P::G1Affine], + /// Perform msm between `points` and `scalars` + fn msm_public_points( + points: &[C::Affine], scalars: &[Self::ArithmeticShare], - ) -> Self::PointShareG1; - - /// Perform msm between G2 `points` and `scalars` - fn msm_public_points_g2( - points: &[P::G2Affine], - scalars: &[Self::ArithmeticShare], - ) -> Self::PointShareG2; + ) -> Self::PointShare + where + C: CurveGroup; /// Multiplies a public point B to the shared point A in place: \[A\] *= B - fn scalar_mul_public_point_g1(a: &P::G1, b: Self::ArithmeticShare) -> Self::PointShareG1; + fn scalar_mul_public_point(a: &C, b: Self::ArithmeticShare) -> Self::PointShare + where + C: CurveGroup; /// Add a shared point B in place to the shared point A: \[A\] += \[B\] - fn add_assign_points_g1(a: &mut Self::PointShareG1, b: &Self::PointShareG1); + fn add_assign_points(a: &mut Self::PointShare, b: &Self::PointShare); + + /// Subtract a shared point B in place from the shared point A: \[A\] -= \[B\] + fn sub_assign_points(a: &mut Self::PointShare, b: &Self::PointShare); /// Add a shared point B in place to the shared point A: \[A\] += \[B\] - fn add_points_g1_half_share(a: Self::PointShareG1, b: &P::G1) -> P::G1; + fn add_points_half_share(a: Self::PointShare, b: &C) -> C; /// Add a public point B in place to the shared point A - fn add_assign_points_public_g1(id: Self::PartyID, a: &mut Self::PointShareG1, b: &P::G1); + fn add_assign_points_public( + id: Self::PartyID, + a: &mut Self::PointShare, + b: &C, + ); /// Reconstructs a shared point: A = Open(\[A\]). - fn open_point_g1(&mut self, a: &Self::PointShareG1) -> IoResult; + fn open_point(&mut self, a: &Self::PointShare) -> IoResult + where + C: CurveGroup; /// Multiplies a share b to the shared point A: \[A\] *= \[b\]. Requires network communication. - fn scalar_mul_g1( + fn scalar_mul( &mut self, - a: &Self::PointShareG1, + a: &Self::PointShare, b: Self::ArithmeticShare, - ) -> IoResult; - - /// Subtract a shared point B in place from the shared point A: \[A\] -= \[B\] - fn sub_assign_points_g1(a: &mut Self::PointShareG1, b: &Self::PointShareG1); - - /// Perform scalar multiplication of point A with a shared scalar b - fn scalar_mul_public_point_g2(a: &P::G2, b: Self::ArithmeticShare) -> Self::PointShareG2; - - /// Add a shared point B in place to the shared point A: \[A\] += \[B\] - fn add_assign_points_g2(a: &mut Self::PointShareG2, b: &Self::PointShareG2); - - /// Add a public point B in place to the shared point A - fn add_assign_points_public_g2(id: Self::PartyID, a: &mut Self::PointShareG2, b: &P::G2); + ) -> IoResult> + where + C: CurveGroup; /// Reconstructs a shared points: A = Open(\[A\]), B = Open(\[B\]). fn open_two_points( &mut self, a: P::G1, - b: Self::PointShareG2, + b: Self::PointShare, ) -> std::io::Result<(P::G1, P::G2)>; /// Reconstruct point G_a and perform scalar multiplication of G1_b and r concurrently + #[allow(clippy::type_complexity)] fn open_point_and_scalar_mul( &mut self, - g_a: &Self::PointShareG1, - g1_b: &Self::PointShareG1, + g_a: &Self::PointShare, + g1_b: &Self::PointShare, r: Self::ArithmeticShare, - ) -> std::io::Result<(P::G1, Self::PointShareG1)>; + ) -> std::io::Result<(P::G1, Self::PointShare)>; } diff --git a/co-circom/co-groth16/src/mpc/plain.rs b/co-circom/co-groth16/src/mpc/plain.rs index d8f6d86b3..fbc6b6f6a 100644 --- a/co-circom/co-groth16/src/mpc/plain.rs +++ b/co-circom/co-groth16/src/mpc/plain.rs @@ -1,5 +1,5 @@ use ark_ec::pairing::Pairing; -use ark_ec::scalar_mul::variable_base::VariableBaseMSM; +use ark_ec::CurveGroup; use ark_ff::UniformRand; use rand::thread_rng; @@ -13,9 +13,7 @@ pub struct PlainGroth16Driver; impl CircomGroth16Prover

for PlainGroth16Driver { type ArithmeticShare = P::ScalarField; - type PointShareG1 = P::G1; - - type PointShareG2 = P::G2; + type PointShare = C where C: CurveGroup; type PartyID = usize; @@ -79,78 +77,75 @@ impl CircomGroth16Prover

for PlainGroth16Driver { } } - fn msm_public_points_g1( - points: &[P::G1Affine], - scalars: &[Self::ArithmeticShare], - ) -> Self::PointShareG1 { - P::G1::msm_unchecked(points, scalars) - } - - fn msm_public_points_g2( - points: &[P::G2Affine], + fn msm_public_points( + points: &[C::Affine], scalars: &[Self::ArithmeticShare], - ) -> Self::PointShareG2 { - P::G2::msm_unchecked(points, scalars) + ) -> Self::PointShare + where + C: CurveGroup, + { + C::msm_unchecked(points, scalars) } - fn scalar_mul_public_point_g1(a: &P::G1, b: Self::ArithmeticShare) -> Self::PointShareG1 { + fn scalar_mul_public_point(a: &C, b: Self::ArithmeticShare) -> Self::PointShare + where + C: CurveGroup, + { *a * b } - fn add_assign_points_g1(a: &mut Self::PointShareG1, b: &Self::PointShareG1) { + fn add_assign_points(a: &mut Self::PointShare, b: &Self::PointShare) { *a += b; } - fn add_points_g1_half_share(a: Self::PointShareG1, b: &P::G1) -> P::G1 { + fn add_points_half_share(a: Self::PointShare, b: &C) -> C { a + b } - fn add_assign_points_public_g1(_: Self::PartyID, a: &mut Self::PointShareG1, b: &P::G1) { + fn add_assign_points_public( + _: Self::PartyID, + a: &mut Self::PointShare, + b: &C, + ) { *a += b; } - fn open_point_g1(&mut self, a: &Self::PointShareG1) -> super::IoResult { + fn open_point(&mut self, a: &Self::PointShare) -> super::IoResult + where + C: CurveGroup, + { Ok(*a) } - fn scalar_mul_g1( + fn scalar_mul( &mut self, - a: &Self::PointShareG1, + a: &Self::PointShare, b: Self::ArithmeticShare, - ) -> super::IoResult { + ) -> super::IoResult> + where + C: CurveGroup, + { Ok(*a * b) } - fn sub_assign_points_g1(a: &mut Self::PointShareG1, b: &Self::PointShareG1) { + fn sub_assign_points(a: &mut Self::PointShare, b: &Self::PointShare) { *a -= b; } - fn scalar_mul_public_point_g2(a: &P::G2, b: Self::ArithmeticShare) -> Self::PointShareG2 { - *a * b - } - - fn add_assign_points_g2(a: &mut Self::PointShareG2, b: &Self::PointShareG2) { - *a += b; - } - - fn add_assign_points_public_g2(_: Self::PartyID, a: &mut Self::PointShareG2, b: &P::G2) { - *a += b; - } - fn open_two_points( &mut self, - a: Self::PointShareG1, - b: Self::PointShareG2, + a: Self::PointShare, + b: Self::PointShare, ) -> std::io::Result<(P::G1, P::G2)> { Ok((a, b)) } fn open_point_and_scalar_mul( &mut self, - g_a: &Self::PointShareG1, - g1_b: &Self::PointShareG1, + g_a: &Self::PointShare, + g1_b: &Self::PointShare, r: Self::ArithmeticShare, - ) -> super::IoResult<(P::G1, Self::PointShareG1)> { + ) -> super::IoResult<(P::G1, Self::PointShare)> { Ok((*g_a, *g1_b * r)) } } diff --git a/co-circom/co-groth16/src/mpc/rep3.rs b/co-circom/co-groth16/src/mpc/rep3.rs index 545825b05..4afa1346e 100644 --- a/co-circom/co-groth16/src/mpc/rep3.rs +++ b/co-circom/co-groth16/src/mpc/rep3.rs @@ -1,4 +1,4 @@ -use ark_ec::pairing::Pairing; +use ark_ec::{pairing::Pairing, CurveGroup}; use mpc_core::protocols::rep3::{ arithmetic, id::PartyID, @@ -32,8 +32,7 @@ where N: 'static, { type ArithmeticShare = Rep3PrimeFieldShare; - type PointShareG1 = Rep3PointShare; - type PointShareG2 = Rep3PointShare; + type PointShare = Rep3PointShare where C: CurveGroup; type PartyID = PartyID; @@ -105,70 +104,67 @@ where }) } - fn msm_public_points_g1( - points: &[P::G1Affine], + fn msm_public_points( + points: &[C::Affine], scalars: &[Self::ArithmeticShare], - ) -> Self::PointShareG1 { + ) -> Self::PointShare + where + C: CurveGroup, + { pointshare::msm_public_points(points, scalars) } - fn msm_public_points_g2( - points: &[P::G2Affine], - scalars: &[Self::ArithmeticShare], - ) -> Self::PointShareG2 { - pointshare::msm_public_points(points, scalars) - } - - fn scalar_mul_public_point_g1(a: &P::G1, b: Self::ArithmeticShare) -> Self::PointShareG1 { + fn scalar_mul_public_point(a: &C, b: Self::ArithmeticShare) -> Self::PointShare + where + C: CurveGroup, + { pointshare::scalar_mul_public_point(a, b) } /// Add a shared point B in place to the shared point A: \[A\] += \[B\] - fn add_assign_points_g1(a: &mut Self::PointShareG1, b: &Self::PointShareG1) { + fn add_assign_points(a: &mut Self::PointShare, b: &Self::PointShare) { pointshare::add_assign(a, b) } - fn add_points_g1_half_share(a: Self::PointShareG1, b: &P::G1) -> P::G1 { + fn add_points_half_share(a: Self::PointShare, b: &C) -> C { let (a, _) = a.ab(); a + b } - fn add_assign_points_public_g1(id: Self::PartyID, a: &mut Self::PointShareG1, b: &P::G1) { + fn add_assign_points_public( + id: Self::PartyID, + a: &mut Self::PointShare, + b: &C, + ) { pointshare::add_assign_public(a, b, id) } - fn open_point_g1(&mut self, a: &Self::PointShareG1) -> IoResult { + fn open_point(&mut self, a: &Self::PointShare) -> IoResult + where + C: CurveGroup, + { pointshare::open_point(a, &mut self.io_context0) } - fn scalar_mul_g1( + fn scalar_mul( &mut self, - a: &Self::PointShareG1, + a: &Self::PointShare, b: Self::ArithmeticShare, - ) -> IoResult { + ) -> IoResult> + where + C: CurveGroup, + { pointshare::scalar_mul(a, b, &mut self.io_context0) } - fn sub_assign_points_g1(a: &mut Self::PointShareG1, b: &Self::PointShareG1) { + fn sub_assign_points(a: &mut Self::PointShare, b: &Self::PointShare) { pointshare::sub_assign(a, b); } - fn scalar_mul_public_point_g2(a: &P::G2, b: Self::ArithmeticShare) -> Self::PointShareG2 { - pointshare::scalar_mul_public_point(a, b) - } - - fn add_assign_points_g2(a: &mut Self::PointShareG2, b: &Self::PointShareG2) { - pointshare::add_assign(a, b) - } - - fn add_assign_points_public_g2(id: Self::PartyID, a: &mut Self::PointShareG2, b: &P::G2) { - pointshare::add_assign_public(a, b, id) - } - fn open_two_points( &mut self, a: P::G1, - b: Self::PointShareG2, + b: Self::PointShare, ) -> std::io::Result<(P::G1, P::G2)> { let mut s1 = a; let s2 = b.b; @@ -186,10 +182,10 @@ where fn open_point_and_scalar_mul( &mut self, - g_a: &Self::PointShareG1, - g1_b: &Self::PointShareG1, + g_a: &Self::PointShare, + g1_b: &Self::PointShare, r: Self::ArithmeticShare, - ) -> std::io::Result<(

::G1, Self::PointShareG1)> { + ) -> std::io::Result<(

::G1, Self::PointShare)> { std::thread::scope(|s| { let opened = s.spawn(|| pointshare::open_point(g_a, &mut self.io_context0)); let mul_result = pointshare::scalar_mul(g1_b, r, &mut self.io_context1)?; diff --git a/co-circom/co-groth16/src/mpc/shamir.rs b/co-circom/co-groth16/src/mpc/shamir.rs index a73520f02..ea6f5a1f9 100644 --- a/co-circom/co-groth16/src/mpc/shamir.rs +++ b/co-circom/co-groth16/src/mpc/shamir.rs @@ -1,5 +1,5 @@ use super::{CircomGroth16Prover, IoResult}; -use ark_ec::pairing::Pairing; +use ark_ec::{pairing::Pairing, CurveGroup}; use ark_ff::PrimeField; use mpc_core::protocols::shamir::{ arithmetic, core, network::ShamirNetwork, pointshare, ShamirPointShare, ShamirPrimeFieldShare, @@ -29,8 +29,7 @@ impl CircomGroth16Prover

for ShamirGroth16Driver { type ArithmeticShare = ShamirPrimeFieldShare; - type PointShareG1 = ShamirPointShare; - type PointShareG2 = ShamirPointShare; + type PointShare = ShamirPointShare where C: CurveGroup; type PartyID = usize; @@ -98,68 +97,65 @@ impl CircomGroth16Prover

}) } - fn msm_public_points_g1( - points: &[P::G1Affine], + fn msm_public_points( + points: &[C::Affine], scalars: &[Self::ArithmeticShare], - ) -> Self::PointShareG1 { + ) -> Self::PointShare + where + C: CurveGroup, + { pointshare::msm_public_points(points, scalars) } - fn msm_public_points_g2( - points: &[P::G2Affine], - scalars: &[Self::ArithmeticShare], - ) -> Self::PointShareG2 { - pointshare::msm_public_points(points, scalars) - } - - fn scalar_mul_public_point_g1(a: &P::G1, b: Self::ArithmeticShare) -> Self::PointShareG1 { + fn scalar_mul_public_point(a: &C, b: Self::ArithmeticShare) -> Self::PointShare + where + C: CurveGroup, + { pointshare::scalar_mul_public_point(b, a) } - fn add_assign_points_g1(a: &mut Self::PointShareG1, b: &Self::PointShareG1) { + fn add_assign_points(a: &mut Self::PointShare, b: &Self::PointShare) { pointshare::add_assign(a, b) } - fn add_points_g1_half_share(a: Self::PointShareG1, b: &P::G1) -> P::G1 { + fn add_points_half_share(a: Self::PointShare, b: &C) -> C { a.inner() + b } - fn add_assign_points_public_g1(_id: Self::PartyID, a: &mut Self::PointShareG1, b: &P::G1) { + fn add_assign_points_public( + _id: Self::PartyID, + a: &mut Self::PointShare, + b: &C, + ) { pointshare::add_assign_public(a, b) } - fn open_point_g1(&mut self, a: &Self::PointShareG1) -> IoResult { + fn open_point(&mut self, a: &Self::PointShare) -> IoResult + where + C: CurveGroup, + { pointshare::open_point(a, &mut self.protocol0) } - fn scalar_mul_g1( + fn scalar_mul( &mut self, - a: &Self::PointShareG1, + a: &Self::PointShare, b: Self::ArithmeticShare, - ) -> IoResult { + ) -> IoResult> + where + C: CurveGroup, + { pointshare::scalar_mul(a, b, &mut self.protocol0) } - fn sub_assign_points_g1(a: &mut Self::PointShareG1, b: &Self::PointShareG1) { + fn sub_assign_points(a: &mut Self::PointShare, b: &Self::PointShare) { pointshare::sub_assign(a, b); } - fn scalar_mul_public_point_g2(a: &P::G2, b: Self::ArithmeticShare) -> Self::PointShareG2 { - pointshare::scalar_mul_public_point(b, a) - } - - fn add_assign_points_g2(a: &mut Self::PointShareG2, b: &Self::PointShareG2) { - pointshare::add_assign(a, b) - } - - fn add_assign_points_public_g2(_id: Self::PartyID, a: &mut Self::PointShareG2, b: &P::G2) { - pointshare::add_assign_public(a, b) - } - fn open_two_points( &mut self, a: P::G1, - b: Self::PointShareG2, + b: Self::PointShare, ) -> std::io::Result<(P::G1, P::G2)> { let s1 = a; let s2 = b.a; @@ -183,10 +179,10 @@ impl CircomGroth16Prover

fn open_point_and_scalar_mul( &mut self, - g_a: &Self::PointShareG1, - g1_b: &Self::PointShareG1, + g_a: &Self::PointShare, + g1_b: &Self::PointShare, r: Self::ArithmeticShare, - ) -> super::IoResult<(P::G1, Self::PointShareG1)> { + ) -> super::IoResult<(P::G1, Self::PointShare)> { std::thread::scope(|s| { let opened = s.spawn(|| pointshare::open_point(g_a, &mut self.protocol0)); let mul_result = pointshare::scalar_mul(g1_b, r, &mut self.protocol1)?;