Encrypts a media file for an encrypted-media-v1 attachment.
Uses ChaCha20-Poly1305 AEAD with a random 12-byte nonce. The AAD binds the
scheme version, plaintext hash, canonical MIME type, and filename. Computes
ciphertextSha256 = SHA256(encrypted) and returns a MediaAttachment
with locators left empty for the caller to fill after upload.
Encrypts a media file for an
encrypted-media-v1attachment.Uses ChaCha20-Poly1305 AEAD with a random 12-byte nonce. The AAD binds the scheme version, plaintext hash, canonical MIME type, and filename. Computes
ciphertextSha256 = SHA256(encrypted)and returns a MediaAttachment withlocatorsleft empty for the caller to fill after upload.