Skip to main content

encode_aead

Function encode_aead 

Source
pub fn encode_aead(
    shared_secret: &[u8],
    plaintext: &[u8],
    aad: &[u8],
) -> Result<KkAeadPacket>
Expand description

Encode plaintext with authenticated associated data (AEAD).

The AAD is included in the commitment MAC but is NOT encrypted. This is useful for metadata (headers, routing info, version tags) that must be readable in the clear but tamper-proof.

ยงArguments

  • shared_secret - the pre-shared key
  • plaintext - data to encrypt
  • aad - associated data to authenticate (not encrypted)