Skip to main content

seal

Function seal 

Source
pub fn seal(
    session: &mut Session<Secure>,
    addr: Address,
    sqn: Sqn,
    direction: Direction,
    encrypt: bool,
    code: u8,
    data: &[u8],
) -> Result<Vec<u8>, Error>
Expand description

Build a fully-secured packet (SCB + optional encryption + MAC + trailer).

data is the plaintext DATA payload — it will be AES-CBC encrypted with the current ICV if encrypt is true. The code byte is not encrypted (it sits in front of DATA in the wire layout).