Skip to main content

decrypt_event_full

Function decrypt_event_full 

Source
pub fn decrypt_event_full(
    group_key: &[u8; 32],
    nonce: &[u8; 12],
    tag: &[u8],
    ciphertext: &[u8],
    prefix: &str,
) -> Result<Vec<u8>, String>
Expand description

Decrypt an event with full AAD binding (tag + ciphertext + prefix).

This is the preferred decryption path for EventEnvelopeV2, which binds the prefix as AAD.

ยงArguments

  • group_key - 32-byte group encryption key
  • nonce - 12-byte nonce
  • tag - 16-byte authentication tag
  • ciphertext - Encrypted payload (without tag)
  • prefix - Topic prefix (must match encryption AAD)