pub struct SharedKeys<E: Scalar, G: GroupElement<E>> {
pub alpha: Alpha<G::AlphaLen>,
pub secrets: Vec<SharedSecret>,
/* private fields */
}
Expand description
Structure containing shared keys for peers using the Sphinx algorithm.
Fields§
§alpha: Alpha<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: &Alpha<G::AlphaLen>,
private_scalar: &E,
public_group_element: &G,
) -> Result<(Alpha<G::AlphaLen>, SharedSecret)>
pub fn forward_transform( alpha: &Alpha<G::AlphaLen>, private_scalar: &E, public_group_element: &G, ) -> Result<(Alpha<G::AlphaLen>, SharedSecret)>
Calculates the forward transformation for the given the local private key.
The public_group_element
is a precomputed group element associated to 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