pub fn encrypt_event(
group_key: &[u8; 32],
prefix: &str,
plaintext: &[u8],
_privacy_mode: EventPrivacy,
) -> Result<(Vec<u8>, Vec<u8>, [u8; 12], [u8; 16]), String>Expand description
Encrypt an EventEnvelopeV2 payload with a group key.
Returns (tag, ciphertext, nonce, key_commitment) suitable for
populating a TaggedPayload on the wire.
§Arguments
group_key- 32-byte group encryption keyprefix- Topic prefix used as AAD for domain separationplaintext- Event payload bytes to encrypt_privacy_mode- Privacy mode (reserved for future routing decisions)
§Returns
tag- 16-byte AES-GCM authentication tag (last 16 bytes of AEAD output)ciphertext- Encrypted payload (AEAD output minus trailing tag)nonce- 12-byte random noncekey_commitment- 16-byte commitment for fast key rejection