pub struct SharedKeys<E: Scalar, G: GroupElement<E>> {
pub alpha: GenericArray<u8, G::AlphaLen>,
pub secrets: Vec<SharedSecret>,
/* private fields */
}
Expand description
Structure containing shared keys for peers using the Sphinx algorithm.
Fields§
§alpha: GenericArray<u8, G::AlphaLen>
§secrets: Vec<SharedSecret>
Implementations§
Sourcepub fn generate(peer_group_elements: Vec<G>) -> Result<SharedKeys<E, G>>
pub fn generate(peer_group_elements: Vec<G>) -> Result<SharedKeys<E, G>>
Generates shared secrets given the group element of the peers. The order of the peer group elements is preserved for resulting shared keys.
Sourcepub fn forward_transform(
alpha: &GenericArray<u8, G::AlphaLen>,
private_scalar: &E,
public_group_element: &G,
) -> Result<(GenericArray<u8, G::AlphaLen>, SharedSecret)>
pub fn forward_transform( alpha: &GenericArray<u8, G::AlphaLen>, private_scalar: &E, public_group_element: &G, ) -> Result<(GenericArray<u8, G::AlphaLen>, SharedSecret)>
Calculates the forward transformation given the local private key.
The public_group_element
is a precomputed group element associated with the private key for efficiency.
Auto Trait Implementations§
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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 more