diff --git a/setup.py b/setup.py index c7a7e1f..122f02b 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setup( name = "X3DH", - version = "0.4.2", + version = "0.4.3", description = "A python implementation of the Extended Triple Diffie-Hellman key agreement protocol.", long_description = long_description, long_description_content_type = "text/markdown", diff --git a/tests/test_x3dh.py b/tests/test_x3dh.py index 404122b..cc6c87b 100644 --- a/tests/test_x3dh.py +++ b/tests/test_x3dh.py @@ -54,10 +54,7 @@ def test_x3dh(): previous = len(state_bob.getPublicBundle().otpks) assert session_init_data["sk"] == other_session_data["sk"] - - ad_len = len(session_init_data["ad"]) // 2 - assert session_init_data["ad"][:ad_len] == other_session_data["ad"][ad_len:] - assert session_init_data["ad"][ad_len:] == other_session_data["ad"][:ad_len] + assert session_init_data["ad"] == other_session_data["ad"] def test_spk_rotation(): state = ExampleStateB() @@ -89,10 +86,7 @@ def test_serialization(): previous = len(state_bob.getPublicBundle().otpks) assert session_init_data["sk"] == other_session_data["sk"] - - ad_len = len(session_init_data["ad"]) // 2 - assert session_init_data["ad"][:ad_len] == other_session_data["ad"][ad_len:] - assert session_init_data["ad"][ad_len:] == other_session_data["ad"][:ad_len] + assert session_init_data["ad"] == other_session_data["ad"] state_alice_serialized = json.dumps(state_alice.serialize()) state_bob_serialized = json.dumps(state_bob.serialize()) @@ -114,7 +108,4 @@ def test_serialization(): previous = len(state_bob.getPublicBundle().otpks) assert session_init_data["sk"] == other_session_data["sk"] - - ad_len = len(session_init_data["ad"]) // 2 - assert session_init_data["ad"][:ad_len] == other_session_data["ad"][ad_len:] - assert session_init_data["ad"][ad_len:] == other_session_data["ad"][:ad_len] + assert session_init_data["ad"] == other_session_data["ad"] diff --git a/x3dh/state.py b/x3dh/state.py index 8f5998b..ab4c9d6 100644 --- a/x3dh/state.py +++ b/x3dh/state.py @@ -391,7 +391,7 @@ def initSessionActive( self.__curve ) - ad = other_ik_enc_serialized + ik_enc_serialized + ad = ik_enc_serialized + other_ik_enc_serialized return { "to_other": {