Skip to main content

forward_header

Function forward_header 

Source
pub fn forward_header<H: SphinxHeaderSpec>(
    secret: &SecretKey,
    header: &mut [u8],
) -> Result<ForwardedHeader<H>>
Expand description

Applies the forward transformation to the header. If the packet is destined for this node, it returns the additional data for the final destination (ForwardedHeader::Final). Otherwise, it returns the transformed header, the next authentication tag, the public key of the next node, and the additional data for the relayer (ForwardedHeader::Relayed).

ยงArguments

  • secret - the shared secret with the creator of the packet
  • header - entire sphinx header to be forwarded