From 2655aa7636502d678eebe0d590d77217079b296c Mon Sep 17 00:00:00 2001 From: yet Date: Fri, 15 May 2026 17:57:22 +0400 Subject: [PATCH] refactor(noise/protocol): align DHStateHybrid with non-null DHState - Match the tightened `copyFrom` signature on DHState by making the primary `other` parameter non-null while keeping `remote` nullable (a missing peer is meaningful for hybrid algorithms). - Note the inheritance relationship between the single- and two-arg copyFrom overloads. Co-Authored-By: Claude Opus 4.7 --- .../android/noise/southernstorm/protocol/DHStateHybrid.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/bitchat/android/noise/southernstorm/protocol/DHStateHybrid.kt b/app/src/main/java/com/bitchat/android/noise/southernstorm/protocol/DHStateHybrid.kt index 9c714ddc..7a589517 100644 --- a/app/src/main/java/com/bitchat/android/noise/southernstorm/protocol/DHStateHybrid.kt +++ b/app/src/main/java/com/bitchat/android/noise/southernstorm/protocol/DHStateHybrid.kt @@ -37,6 +37,9 @@ interface DHStateHybrid : DHState { */ fun generateKeyPair(remote: DHState?) + // Note: copyFrom(other) is inherited from DHState; the two-arg overload + // below adds the remote-peer parameter required by hybrid algorithms. + /** * Copies the key values from another DH object of the same type. * @@ -46,7 +49,7 @@ interface DHStateHybrid : DHState { * @throws IllegalStateException The other or remote DH object does not have * the same type as this object. */ - fun copyFrom(other: DHState?, remote: DHState?) + fun copyFrom(other: DHState, remote: DHState?) /** * Specifies the local peer object prior to setting a public key