pub struct PointShare<C: Curve> { /* private fields */ }Expand description
A share of a point on a curve, with its associated MACs and the keys for all other parties’ shares.
Implementations§
pub fn try_new( value: Point<C>, macs: Box<[Point<C>]>, keys: Box<[CurveKey<C>]>, ) -> Result<Self, PrimitiveError>
pub fn zero_from_alphas( alphas: impl ExactSizeIterator<Item = GlobalFieldKey<C::Scalar>>, ) -> Self
pub fn get_value(&self) -> &Point<C>
pub fn value(self) -> Point<C>
pub fn get_keys(&self) -> &[CurveKey<C>]
pub fn get_key(&self, index: PeerIndex) -> Option<&CurveKey<C>>
pub fn get_macs(&self) -> &[Point<C>]
pub fn get_mac(&self, index: PeerIndex) -> Option<&Point<C>>
pub fn get_alphas( &self, ) -> impl ExactSizeIterator<Item = GlobalCurveKey<C>> + '_
Trait Implementations§
Source§type Output = PointShare<C>
type Output = PointShare<C>
+ operator.Source§type Output = PointShare<C>
type Output = PointShare<C>
+ operator.Source§type Output = PointShare<C>
type Output = PointShare<C>
+ operator.Source§type Output = PointShare<C>
type Output = PointShare<C>
+ operator.Source§fn add_assign(&mut self, other: &'a PointShare<C>)
fn add_assign(&mut self, other: &'a PointShare<C>)
+= operation. Read moreSource§fn add_assign(&mut self, rhs: PointShare<C>)
fn add_assign(&mut self, rhs: PointShare<C>)
+= operation. Read moreSource§fn add_plaintext(&self, constant: &Point<C>, is_peer_zero: IsFirstPeer) -> Self
fn add_plaintext(&self, constant: &Point<C>, is_peer_zero: IsFirstPeer) -> Self
Adds a public constant to the secret shared value, updating the keys accordingly. A designated peer (P_0) will modify its value, while the other peers will update their keys.
Source§fn add_plaintext_owned(
self,
constant: &Point<C>,
is_peer_zero: IsFirstPeer,
) -> Self
fn add_plaintext_owned( self, constant: &Point<C>, is_peer_zero: IsFirstPeer, ) -> Self
Adds a public constant to the secret shared value, updating the keys accordingly. A designated peer (P_0) will modify its value, while the other peers will update their keys.
type AssociatedInformation = bool
Source§fn clone(&self) -> PointShare<C>
fn clone(&self) -> PointShare<C>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self
fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self
Source§fn default() -> PointShare<C>
fn default() -> PointShare<C>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§type Output = PointShare<C>
type Output = PointShare<C>
* operator.Source§type Output = PointShare<C>
type Output = PointShare<C>
* operator.Source§type Output = PointShare<C>
type Output = PointShare<C>
* operator.Source§type Output = PointShare<C>
type Output = PointShare<C>
* operator.Source§fn mul_assign(&mut self, other: &'a ScalarAsExtension<C>)
fn mul_assign(&mut self, other: &'a ScalarAsExtension<C>)
*= operation. Read moreSource§fn mul_assign(&mut self, other: &'a Scalar<C>)
fn mul_assign(&mut self, other: &'a Scalar<C>)
*= operation. Read moreSource§fn mul_assign(&mut self, rhs: ScalarAsExtension<C>)
fn mul_assign(&mut self, rhs: ScalarAsExtension<C>)
*= operation. Read moreSource§fn mul_assign(&mut self, rhs: Scalar<C>)
fn mul_assign(&mut self, rhs: Scalar<C>)
*= operation. Read moreSource§fn random_n<Container: FromIterator<Self>>(
rng: impl CryptoRngCore,
n_parties: usize,
) -> Container
fn random_n<Container: FromIterator<Self>>( rng: impl CryptoRngCore, n_parties: usize, ) -> Container
Generate one random field share per peer, with consistent MACs and keys across all peers.
fn random(_rng: impl CryptoRngCore) -> Self
Source§fn random_with(
rng: impl CryptoRngCore,
value_alphas: (Point<C>, Vec<GlobalCurveKey<C>>),
) -> Self
fn random_with( rng: impl CryptoRngCore, value_alphas: (Point<C>, Vec<GlobalCurveKey<C>>), ) -> Self
Generate a random field share from its global keys (alphas) and its share
Source§fn random_n_with_each<Container: FromIterator<Self>>(
rng: impl CryptoRngCore,
unauth_shares_and_alphas: impl IntoIterator<Item = (Point<C>, Vec<GlobalCurveKey<C>>)>,
) -> Container
fn random_n_with_each<Container: FromIterator<Self>>( rng: impl CryptoRngCore, unauth_shares_and_alphas: impl IntoIterator<Item = (Point<C>, Vec<GlobalCurveKey<C>>)>, ) -> Container
Generate one random field share per peer from their global keys (alphas).
fn random_n_with<Container: FromIterator<Self>>( rng: impl CryptoRngCore, size: usize, data: D, ) -> Container
Source§fn random_n_with<Container: FromIterator<Self>>(
rng: impl CryptoRngCore,
n_parties: usize,
secret_value_and_alphas: (Point<C>, Vec<Vec<GlobalCurveKey<C>>>),
) -> Container
fn random_n_with<Container: FromIterator<Self>>( rng: impl CryptoRngCore, n_parties: usize, secret_value_and_alphas: (Point<C>, Vec<Vec<GlobalCurveKey<C>>>), ) -> Container
Generate a random field share per peer from a value to secret share and global keys (alphas).
fn random_with( _source: impl CryptoRngCore, _data: (Point<C>, Vec<Vec<GlobalCurveKey<C>>>), ) -> Self
fn random_n_with_each<Container: FromIterator<Self>>( rng: impl CryptoRngCore, all_data: impl IntoExactSizeIterator<Item = D>, ) -> Container
Source§fn random_with(
rng: impl CryptoRngCore,
n_parties_value: (usize, Point<C>),
) -> Self
fn random_with( rng: impl CryptoRngCore, n_parties_value: (usize, Point<C>), ) -> Self
Generate a random field share with a specific secret share as value and random macs & keys.
fn random_n_with<Container: FromIterator<Self>>( rng: impl CryptoRngCore, size: usize, data: D, ) -> Container
fn random_n_with_each<Container: FromIterator<Self>>( rng: impl CryptoRngCore, all_data: impl IntoExactSizeIterator<Item = D>, ) -> Container
Source§fn random_n_with<Container: FromIterator<Self>>(
rng: impl CryptoRngCore,
n_parties: usize,
value: Point<C>,
) -> Container
fn random_n_with<Container: FromIterator<Self>>( rng: impl CryptoRngCore, n_parties: usize, value: Point<C>, ) -> Container
Secret share a value among n parties, generating an authenticated share for each peer with consistent MACs and keys across all peers.
Source§fn random_n_with_each<Container: FromIterator<Self>>(
rng: impl CryptoRngCore,
all_unauth_shares: impl IntoExactSizeIterator<Item = Point<C>>,
) -> Container
fn random_n_with_each<Container: FromIterator<Self>>( rng: impl CryptoRngCore, all_unauth_shares: impl IntoExactSizeIterator<Item = Point<C>>, ) -> Container
Generate a random field share with a specific secret share as value, with consistent random MACs and keys across all peers.
fn random_with(_rng: impl CryptoRngCore, _data: Point<C>) -> Self
Source§fn random_with(rng: impl CryptoRngCore, alphas: Vec<GlobalCurveKey<C>>) -> Self
fn random_with(rng: impl CryptoRngCore, alphas: Vec<GlobalCurveKey<C>>) -> Self
Generate a random field share from its global keys (alphas).
Source§fn random_n_with_each<Container: FromIterator<Self>>(
rng: impl CryptoRngCore,
all_alphas: impl IntoExactSizeIterator<Item = Vec<GlobalCurveKey<C>>>,
) -> Container
fn random_n_with_each<Container: FromIterator<Self>>( rng: impl CryptoRngCore, all_alphas: impl IntoExactSizeIterator<Item = Vec<GlobalCurveKey<C>>>, ) -> Container
Generate one random field share per peer from their global keys (alphas).
fn random_n_with<Container: FromIterator<Self>>( rng: impl CryptoRngCore, size: usize, data: D, ) -> Container
Source§fn random_with(rng: impl CryptoRngCore, n_parties: usize) -> Self
fn random_with(rng: impl CryptoRngCore, n_parties: usize) -> Self
Generate a random field share, with Macs and keys for all the other parties.
fn random_n_with<Container: FromIterator<Self>>( rng: impl CryptoRngCore, size: usize, data: D, ) -> Container
fn random_n_with_each<Container: FromIterator<Self>>( rng: impl CryptoRngCore, all_data: impl IntoExactSizeIterator<Item = D>, ) -> Container
Source§fn open_to(
&self,
for_peer: PeerIndex,
) -> Result<OpenPointShare<C>, PrimitiveError>
fn open_to( &self, for_peer: PeerIndex, ) -> Result<OpenPointShare<C>, PrimitiveError>
Open the share towards another peer.
Source§fn open_to_all_others(&self) -> impl ExactSizeIterator<Item = OpenPointShare<C>>
fn open_to_all_others(&self) -> impl ExactSizeIterator<Item = OpenPointShare<C>>
Open the share towards all other peers.
Source§fn reconstruct(
&self,
openings: &[OpenPointShare<C>],
) -> Result<Self::Secret, PrimitiveError>
fn reconstruct( &self, openings: &[OpenPointShare<C>], ) -> Result<Self::Secret, PrimitiveError>
Reconstruct a secret from openings coming from all other parties.
Source§type Opening = OpenPointShare<C>
type Opening = OpenPointShare<C>
Source§fn reconstruct_all<T: Borrow<Self>>(
shares: &[T],
) -> Result<Self::Secret, PrimitiveError>
fn reconstruct_all<T: Borrow<Self>>( shares: &[T], ) -> Result<Self::Secret, PrimitiveError>
n secrets from the openings and
checking that they are all equal.Source§type Output = PointShare<C>
type Output = PointShare<C>
- operator.Source§type Output = PointShare<C>
type Output = PointShare<C>
- operator.Source§type Output = PointShare<C>
type Output = PointShare<C>
- operator.Source§type Output = PointShare<C>
type Output = PointShare<C>
- operator.Source§fn sub_assign(&mut self, other: &'a PointShare<C>)
fn sub_assign(&mut self, other: &'a PointShare<C>)
-= operation. Read moreSource§fn sub_assign(&mut self, rhs: PointShare<C>)
fn sub_assign(&mut self, rhs: PointShare<C>)
-= operation. Read moreSource§fn verify_from_peer_with(
&self,
open_share: &OpenPointShare<C>,
peer: PeerIndex,
_verification_data: (),
) -> Result<(), PrimitiveError>
fn verify_from_peer_with( &self, open_share: &OpenPointShare<C>, peer: PeerIndex, _verification_data: (), ) -> Result<(), PrimitiveError>
Check the MACs of the share received from another peer.
Source§fn verify_with(
&self,
open_shares: &[OpenPointShare<C>],
_verification_data: (),
) -> Result<(), PrimitiveError>
fn verify_with( &self, open_shares: &[OpenPointShare<C>], _verification_data: (), ) -> Result<(), PrimitiveError>
Check the MACs of each share received from all other peers.
Source§type VerificationData = ()
type VerificationData = ()
Source§fn verify_all_with(
shares: &[Self],
verification_data: Self::VerificationData,
) -> Result<(), PrimitiveError>
fn verify_all_with( shares: &[Self], verification_data: Self::VerificationData, ) -> Result<(), PrimitiveError>
Auto Trait Implementations§
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<F, T, S> RandomAuthenticatedForNPeersWith<F, T> for S
impl<F, T, S> RandomAuthenticatedForNPeersWith<F, T> for S
fn random_authenticated_for_n_peers_with<Container: FromIterator<Self>>( rng: impl CryptoRngCore, n_parties: usize, value: T, all_alphas: Vec<Vec<GlobalFieldKey<F>>>, ) -> Container
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.