getMessageKeys

fun getMessageKeys(conversationKey: ByteArray, nonce: ByteArray): Nip44.MessageKeys

Derives per-message encryption keys from a conversation key and nonce.

Uses HKDF-Expand to derive ChaCha20 key, ChaCha20 nonce, and HMAC key from the conversation key and message nonce. These keys are used for a single message encryption/decryption.

Return

MessageKeys containing ChaCha20 key (32 bytes), ChaCha20 nonce (12 bytes), and HMAC key (32 bytes)

Parameters

conversationKey

The 32-byte conversation key

nonce

The 32-byte random nonce (unique per message)

Throws

if conversationKey or nonce are not 32 bytes