Skip to content

Commit

Permalink
reverted the creation of the associated data.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Henkes committed Aug 1, 2018
1 parent aa41a7a commit 573d8a7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 14 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
15 changes: 3 additions & 12 deletions tests/test_x3dh.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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())
Expand All @@ -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"]
2 changes: 1 addition & 1 deletion x3dh/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down

0 comments on commit 573d8a7

Please sign in to comment.