pub struct SphinxHeader {
pub shared_secret: PublicKey,
pub routing_info: EncapsulatedRoutingInformation,
}Fields§
§routing_info: EncapsulatedRoutingInformationImplementations§
Source§impl SphinxHeader
impl SphinxHeader
pub fn new( initial_secret: &StaticSecret, route: &[Node], delays: &[Delay], destination: &Destination, ) -> (Self, Vec<PayloadKey>)
Sourcepub fn process_with_derived_keys(
self,
new_blinded_secret: &Option<PublicKey>,
routing_keys: &RoutingKeys,
) -> Result<ProcessedHeader>
pub fn process_with_derived_keys( self, new_blinded_secret: &Option<PublicKey>, routing_keys: &RoutingKeys, ) -> Result<ProcessedHeader>
Processes the header with the provided derived keys. It could be useful in the situation where sender is re-using initial secret and we could cache processing results.
However, unless you know exactly what you are doing, you should NEVER use this method! Prefer normal [process] instead.
Sourcepub fn compute_routing_keys(
shared_secret: &PublicKey,
node_secret_key: &StaticSecret,
) -> RoutingKeys
pub fn compute_routing_keys( shared_secret: &PublicKey, node_secret_key: &StaticSecret, ) -> RoutingKeys
Using the provided shared_secret and node’s secret key, derive all routing keys for this hop.
pub fn process(self, node_secret_key: &StaticSecret) -> Result<ProcessedHeader>
pub fn to_bytes(&self) -> Vec<u8> ⓘ
pub fn from_bytes(bytes: &[u8]) -> Result<Self>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SphinxHeader
impl RefUnwindSafe for SphinxHeader
impl Send for SphinxHeader
impl Sync for SphinxHeader
impl Unpin for SphinxHeader
impl UnwindSafe for SphinxHeader
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