hopr_crypto_sphinx::routing

Function forward_header

Source
pub fn forward_header<S: SphinxSuite>(
    secret: &SecretKey,
    header: &mut [u8],
    mac: &[u8],
    max_hops: usize,
    additional_data_relayer_len: usize,
    additional_data_last_hop_len: usize,
) -> Result<ForwardedHeader>
Expand description

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

ยงArguments

  • secret shared secret with the creator of the packet
  • header u8a containing the header
  • mac current mac
  • max_hops maximal number of hops
  • additional_data_relayer_len length of the additional data for each relayer
  • additional_data_last_hop_len length of the additional data for the final destination