Struct sphinx_packet::header::SphinxHeader
source · pub struct SphinxHeader {
pub shared_secret: SharedSecret,
pub routing_info: EncapsulatedRoutingInformation,
}Fields§
§routing_info: EncapsulatedRoutingInformationImplementations§
source§impl SphinxHeader
impl SphinxHeader
pub fn new( initial_secret: &EphemeralSecret, route: &[Node], delays: &[Delay], destination: &Destination ) -> (Self, Vec<PayloadKey>)
sourcepub fn process_with_derived_keys(
self,
new_blinded_secret: &Option<SharedSecret>,
routing_keys: &RoutingKeys
) -> Result<ProcessedHeader>
pub fn process_with_derived_keys( self, new_blinded_secret: &Option<SharedSecret>, 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: &SharedSecret,
node_secret_key: &PrivateKey
) -> RoutingKeys
pub fn compute_routing_keys( shared_secret: &SharedSecret, node_secret_key: &PrivateKey ) -> RoutingKeys
Using the provided shared_secret and node’s secret key, derive all routing keys for this hop.