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 packetheader
u8a containing the headermac
current macmax_hops
maximal number of hopsadditional_data_relayer_len
length of the additional data for each relayeradditional_data_last_hop_len
length of the additional data for the final destination