decrypt

fun decrypt(packet: ByteArray, sharedSecrets: SharedSecrets): Try<DecryptedFailurePacket>

Decrypt a failure packet. Node shared secrets are applied until the packet's MAC becomes valid, which means that it was sent by the corresponding node. Note that malicious nodes in the route may have altered the packet, triggering a decryption failure.

Return

Success(secret, failure message) if the origin of the packet could be identified and the packet decrypted, Failure otherwise.

Parameters

packet

failure packet.

sharedSecrets

nodes shared secrets.