From c67dfd297509700073b81b02d333c6dfd563c8af Mon Sep 17 00:00:00 2001 From: Naomi Plasterer Date: Tue, 5 Mar 2024 18:35:33 -0700 Subject: [PATCH] derive the hmac key correctl (#194) --- .../src/main/java/org/xmtp/android/library/Conversations.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/library/src/main/java/org/xmtp/android/library/Conversations.kt b/library/src/main/java/org/xmtp/android/library/Conversations.kt index 535efe0fd..b60f2b1ca 100644 --- a/library/src/main/java/org/xmtp/android/library/Conversations.kt +++ b/library/src/main/java/org/xmtp/android/library/Conversations.kt @@ -324,8 +324,9 @@ data class Conversations( (thirtyDayPeriodsSinceEpoch - 1..thirtyDayPeriodsSinceEpoch + 1).forEach { value -> val info = "$value-${client.address}" val hmacKey = - Crypto.calculateMac( + Crypto.deriveKey( conversation.keyMaterial!!, + ByteArray(0), info.toByteStringUtf8().toByteArray() ) val hmacKeyData = HmacKeyData.newBuilder()