pub struct SharedKeys<E: Scalar, G: GroupElement<E>> {
pub alpha: GenericArray<u8, G::AlphaLen>,
pub secrets: Vec<SharedSecret>,
_d: PhantomData<(E, G)>,
}Expand description
Structure containing shared keys for peers using the Sphinx algorithm.
Fields§
§alpha: GenericArray<u8, G::AlphaLen>§secrets: Vec<SharedSecret>§_d: PhantomData<(E, G)>Implementations§
Sourcepub(crate) fn generate(
peer_group_elements: Vec<(G, &GenericArray<u8, G::AlphaLen>)>,
) -> Result<SharedKeys<E, G>>
pub(crate) fn generate( peer_group_elements: Vec<(G, &GenericArray<u8, G::AlphaLen>)>, ) -> Result<SharedKeys<E, G>>
Generates shared secrets given the group element of the peers and their Alpha value encodings.
The order of the peer group elements is preserved for resulting shared keys.
Sourcepub(crate) fn forward_transform(
alpha: &GenericArray<u8, G::AlphaLen>,
private_scalar: &E,
public_element_alpha: &GenericArray<u8, G::AlphaLen>,
) -> Result<(GenericArray<u8, G::AlphaLen>, SharedSecret)>
pub(crate) fn forward_transform( alpha: &GenericArray<u8, G::AlphaLen>, private_scalar: &E, public_element_alpha: &GenericArray<u8, G::AlphaLen>, ) -> Result<(GenericArray<u8, G::AlphaLen>, SharedSecret)>
Calculates the forward transformation given the local private key.
Efficiency note: the public_element_alpha is a precomputed group element Alpha encoding associated with the
private_scalar.
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> 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